/* style.css - Premium Design System for สมาคมสื่อสารฉุกเฉิน (ศูนย์วิทยุวานร) */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

:root {
  /* Colors */
  --primary: #002D62;      /* Deep Royal Blue - Thai government official style */
  --primary-light: #0B3C5D;/* Medium Steel Blue */
  --primary-dark: #001A3A; /* Very Dark Navy */
  --secondary: #D4AF37;    /* Royal Gold */
  --secondary-light: #F3E5AB;/* Creamy Gold */
  --secondary-dark: #AA7C11; /* Dark Gold/Bronze */
  --accent: #D9534F;       /* Emergency Red/Coral */
  --accent-green: #28A745; /* Success Green */
  --text-dark: #333333;
  --text-light: #F8F9FA;
  --text-muted: #6C757D;
  --bg-light: #F4F6F9;
  --bg-white: #FFFFFF;
  --bg-dark: #0F172A;
  
  /* Shadows and Transitions */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 10px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-radius: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Sarabun', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

/* --- Layout Utility --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-weight: 600;
  border-radius: var(--border-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Sarabun', sans-serif;
  font-size: 15px;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-light);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-secondary:hover {
  background-color: var(--primary);
  color: var(--text-light);
  transform: translateY(-2px);
}

.btn-gold {
  background-color: var(--secondary);
  color: var(--primary-dark);
}

.btn-gold:hover {
  background-color: var(--secondary-dark);
  color: var(--text-light);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: var(--accent);
  color: var(--text-light);
}

.btn-danger:hover {
  background-color: #C9302C;
}

/* --- Top Bar & Ticker --- */
.top-bar {
  background-color: var(--primary-dark);
  color: var(--text-light);
  font-size: 13px;
  border-bottom: 3px solid var(--secondary);
}

.top-bar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
}

.top-contacts {
  display: flex;
  gap: 15px;
}

.top-contacts span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.freq-ticker-wrapper {
  display: inline-flex;
  overflow: hidden;
  max-width: 180px;
  vertical-align: bottom;
}

.top-contacts .setting-frequency {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 15s linear infinite;
  padding-left: 100%;
}

.top-contacts .setting-frequency:hover {
  animation-play-state: paused;
}

.top-contacts a {
  color: var(--secondary);
  font-weight: bold;
}

/* Ticker announcement */
.ticker-wrap {
  display: flex;
  align-items: center;
  background-color: rgba(217, 83, 79, 0.15);
  height: 40px;
  overflow: hidden;
  padding: 0 20px;
  flex: 1;
  max-width: 60%;
  border-left: 1px solid rgba(255,255,255,0.1);
  border-right: 1px solid rgba(255,255,255,0.1);
}

.ticker-label {
  background-color: var(--accent);
  color: var(--text-light);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: bold;
  border-radius: 3px;
  margin-right: 10px;
  white-space: nowrap;
  animation: pulse 2s infinite;
}

.ticker-scroll-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.ticker-scroll {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 25s linear infinite;
  padding-left: 100%;
}

.ticker-scroll:hover {
  animation-play-state: paused;
}

/* --- Official Header --- */
.official-header {
  background-color: var(--bg-white);
  padding: 20px 0;
  border-bottom: 1px solid #E2E8F0;
  background-image: linear-gradient(135deg, #ffffff 60%, #f0f4f8 100%);
}

.header-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-wrapper img {
  height: 100px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.header-title-wrapper h1 {
  font-size: 26px;
  color: var(--primary);
  font-weight: 700;
  line-height: 1.2;
}

.header-title-wrapper h2 {
  font-size: 16px;
  color: var(--secondary-dark);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.header-title-wrapper h3 {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 4px;
}

/* --- Main Navigation --- */
.main-navbar {
  background-color: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar-scrolled {
  box-shadow: var(--shadow-lg);
  opacity: 0.98;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li a {
  display: block;
  padding: 16px 20px;
  color: var(--text-light);
  font-weight: 500;
  font-size: 15px;
  border-bottom: 3px solid transparent;
}

.nav-links li a:hover,
.nav-links li.active a {
  color: var(--secondary);
  border-bottom-color: var(--secondary);
  background-color: rgba(255,255,255,0.05);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
}

/* --- Hero Slider (Carousel) --- */
.hero-slider-wrapper {
  position: relative;
  height: 480px;
  overflow: hidden;
  background-color: var(--primary-dark);
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  background-size: cover;
  background-position: center;
}

#hero-slide-1 {
  background-position: center 70%;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.hero-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0,45,98,0.3) 0%, rgba(0,45,98,0.85) 100%);
}

.slide-content {
  position: absolute;
  bottom: 110px;
  left: 0;
  width: 100%;
  z-index: 2;
  color: var(--text-light);
}

.slide-content h2 {
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  color: var(--secondary-light);
}

.slide-content p {
  font-size: 18px;
  max-width: 800px;
  margin-bottom: 20px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Slider Controls */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0,0,0,0.4);
  color: var(--text-light);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}

.slider-arrow:hover {
  background-color: var(--secondary);
  color: var(--primary-dark);
}

.slider-prev { left: 20px; }
.slider-next { right: 20px; }

.slider-dots {
  position: absolute;
  bottom: 105px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.slider-dot.active {
  background-color: var(--secondary);
  width: 28px;
  border-radius: 6px;
}

/* --- Emergency Contact Bar --- */
.emergency-bar-section {
  position: relative;
  z-index: 10;
}

.emergency-bar {
  background-color: var(--primary-dark);
  color: var(--text-light);
  padding: 20px;
  margin-top: -85px;
  position: relative;
  z-index: 5;
  border-radius: 8px;
  box-shadow: 0 15px 30px rgba(0,0,0,0.25);
  border-top: 4px solid var(--secondary);
}

.emergency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.emergency-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 0;
}

.emergency-widget:last-child {
  border-right: none;
}

.widget-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--secondary-light);
  flex-shrink: 0;
}

.widget-icon.alert-icon {
  background-color: rgba(217, 83, 79, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.widget-info {
  flex: 1;
  min-width: 0;
}

.widget-info h4 {
  font-size: 13px;
  color: var(--secondary-light);
  text-transform: uppercase;
  margin-bottom: 5px;
  font-weight: 600;
}

.widget-info p {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-light);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.widget-info a {
  color: var(--text-light);
  transition: var(--transition);
}

.widget-info a:hover {
  color: var(--secondary);
  text-decoration: none;
}

/* --- Section Layouts --- */
.section {
  padding: 60px 0;
}

.section-grey {
  background-color: var(--bg-light);
}

.section-white {
  background-color: var(--bg-white);
}

.section-title {
  position: relative;
  text-align: center;
  font-size: 28px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 40px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--secondary);
}

/* --- Info Cards / Welcome Page --- */
.welcome-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  align-items: start;
}

.welcome-text h3 {
  font-size: 22px;
  color: var(--primary-light);
  margin-bottom: 15px;
}

.welcome-text p {
  margin-bottom: 15px;
  color: #4A5568;
  text-indent: 2em;
}

.welcome-image-frame {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 4px solid var(--bg-white);
}

.welcome-image-frame img {
  width: 100%;
  display: block;
  transition: var(--transition);
}

.welcome-image-frame:hover img {
  transform: scale(1.05);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.feature-card {
  background-color: var(--bg-white);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--primary);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-top-color: var(--secondary);
}

.feature-icon {
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 20px;
}

.feature-card h4 {
  font-size: 18px;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
}

/* --- News Cards Grid --- */
.news-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 30px;
}

.news-card {
  background-color: var(--bg-white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.news-card-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.news-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  color: var(--text-light);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.bg-disaster { background-color: var(--accent); }
.bg-training { background-color: #337AB7; }
.bg-donation { background-color: var(--accent-green); }
.bg-general { background-color: #F0AD4E; }

.news-card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.news-title {
  font-size: 17px;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  height: 48px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-excerpt {
  font-size: 14px;
  color: #4A5568;
  margin-bottom: 20px;
  flex: 1;
}

.news-readmore-btn {
  font-weight: bold;
  color: var(--primary);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.news-readmore-btn:hover {
  color: var(--secondary-dark);
}

/* News details page */
.news-detail-wrapper {
  background-color: var(--bg-white);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.news-detail-header {
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.news-detail-header h2 {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 15px;
}

.news-detail-meta {
  display: flex;
  gap: 20px;
  align-items: center;
}

.news-detail-image-box {
  width: 100%;
  height: 450px;
  background-size: cover;
  background-position: center;
  border-radius: var(--border-radius);
  margin-bottom: 30px;
}

.news-detail-body {
  font-size: 17px;
  line-height: 1.8;
  color: #2D3748;
}

/* Filters for News */
.filters-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  background-color: var(--bg-white);
  border: 1px solid #CBD5E0;
  color: var(--text-dark);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--primary);
  color: var(--text-light);
  border-color: var(--primary);
}

/* --- About Us timeline and board --- */
.timeline-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  padding-left: 30px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10px;
  width: 2px;
  height: 100%;
  background-color: var(--secondary);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-dot {
  position: absolute;
  top: 5px;
  left: -26px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 2px solid var(--secondary);
}

.timeline-content {
  background-color: var(--bg-white);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.timeline-content h4 {
  color: var(--primary);
  font-size: 18px;
  margin-bottom: 8px;
}

/* Board grid (ทำเนียบผู้บริหาร) */
.board-grid {
  display: flex;
  flex-direction: column;
  gap: 50px;
  align-items: center;
  margin-top: 40px;
  position: relative;
  scroll-margin-top: 100px;
}

/* Central vertical connection line going down the center of the grid */
.board-grid::before {
  content: '';
  position: absolute;
  top: 35px;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background-color: var(--secondary);
  z-index: 1;
}

/* Tier Header Style */
.org-tier-header {
  position: relative;
  z-index: 3;
  text-align: center;
  width: 100%;
  margin-top: 15px;
  margin-bottom: -15px;
}

.org-tier-header span {
  background-color: var(--primary);
  color: var(--text-light);
  padding: 8px 26px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--secondary);
  display: inline-block;
  box-shadow: var(--shadow-md);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Tier wrapper containing board member cards */
.org-tier {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  width: 100%;
  padding-top: 25px; /* space for horizontal line */
}

/* Horizontal branching connector line */
.org-tier::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 2px;
  background-color: var(--secondary);
  z-index: 1;
}

/* If a tier contains only one card, hide the horizontal branch line */
.org-tier:has(> .board-card:only-child)::before {
  display: none;
}

/* Top connector line for Tier 1: disabled */
.org-tier.tier-1 {
  padding-top: 0;
}
.org-tier.tier-1::before {
  display: none;
}

/* Board card formatting */
.org-tier .board-card {
  width: 220px;
  flex-shrink: 0;
  background-color: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 25px 15px;
  text-align: center;
  border-bottom: 4px solid var(--secondary);
  transition: var(--transition);
  position: relative;
  z-index: 3;
}

/* Vertical line connecting each card to the horizontal branch line */
.org-tier .board-card::before {
  content: '';
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 25px;
  background-color: var(--secondary);
  z-index: 1;
}

.tier-1 .board-card::before {
  display: none;
}

.org-tier .board-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.tier-1 .board-card {
  width: 250px;
  border-bottom-color: var(--accent);
  box-shadow: 0 10px 20px rgba(0, 45, 98, 0.12);
}

.tier-1 .board-member-img {
  width: 150px;
  height: 150px;
  border-color: var(--accent);
}

/* Tier 3 - 5 members in one row on desktop */
.tier-3 .board-card {
  width: 195px;
  padding: 20px 10px;
}

.tier-3 .board-member-img {
  width: 100px;
  height: 100px;
}

.tier-3 .board-member-info h4 {
  font-size: 14px;
}

.tier-3 .board-position {
  font-size: 11px;
}

/* Tier 4 - 6 members in one row on desktop */
.tier-4 .board-card {
  width: 165px;
  padding: 15px 5px;
}

.tier-4 .board-member-img {
  width: 90px;
  height: 90px;
}

.tier-4 .board-member-info h4 {
  font-size: 13px;
}

/* Tier 5 - 7 members (Advisors) on desktop */
.tier-5 .board-card {
  width: 175px;
  padding: 15px 5px;
}

.tier-5 .board-member-img {
  width: 95px;
  height: 95px;
}

.tier-5 .board-member-info h4 {
  font-size: 13px;
}

.tier-5 .board-position {
  font-size: 11px;
}

/* Specific desktop sizing and spacing overrides to align members on a single row */
@media (min-width: 1200px) {
  .org-tier.tier-2 {
    gap: 12px !important;
  }
  .org-tier.tier-4 {
    gap: 15px !important;
  }
  .org-tier.tier-5 {
    gap: 15px !important;
  }
  .tier-2 .board-card {
    width: 130px !important;
    padding: 15px 5px !important;
  }
  .tier-2 .board-member-img {
    width: 85px !important;
    height: 85px !important;
  }
  .tier-2 .board-member-info h4 {
    font-size: 13px !important;
  }
  .tier-2 .board-position {
    font-size: 11px !important;
  }
  .tier-4 .board-card {
    width: 160px !important;
  }
  .tier-5 .board-card {
    width: 140px !important;
  }
  
  /* Horizontal line overrides for exact alignment with outer card centers */
  .org-tier.tier-2::before {
    left: calc(50% - 497px) !important;
    right: calc(50% - 497px) !important;
  }
  .org-tier.tier-3::before {
    left: calc(50% - 225px) !important;
    right: calc(50% - 225px) !important;
  }
  .org-tier.tier-4::before {
    left: calc(50% - 350px) !important;
    right: calc(50% - 350px) !important;
  }
  .org-tier.tier-5::before {
    left: calc(50% - 387.5px) !important;
    right: calc(50% - 387.5px) !important;
  }
}

.board-member-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 15px auto;
  border: 3px solid var(--primary-light);
  box-shadow: var(--shadow-sm);
  background-color: #f7fafc;
}

.board-member-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.board-member-info h4 {
  font-size: 15px;
  color: var(--primary-dark);
  margin-bottom: 5px;
  font-weight: 700;
}

.board-position {
  font-size: 12px;
  color: var(--secondary-dark);
  font-weight: bold;
}

/* Responsive Overrides for Organizational Diagram */
@media (max-width: 1199px) {
  .board-grid::before {
    display: none !important;
  }
  .org-tier {
    padding-top: 0 !important;
    gap: 20px !important;
  }
  .org-tier::before {
    display: none !important;
  }
  .org-tier .board-card::before {
    display: none !important;
  }
  .org-tier-header {
    margin-top: 25px !important;
    margin-bottom: -5px !important;
  }
}

@media (max-width: 768px) {
  .org-tier .board-card {
    width: 100% !important;
    max-width: 280px !important;
  }
}

/* --- Support & Donation --- */
.support-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
}

.donation-info-card {
  background-color: var(--bg-white);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--primary);
}

.donation-qr-card {
  background-color: var(--bg-white);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
  border: 2px dashed var(--secondary);
}

.qr-box {
  margin: 20px auto;
  width: 250px;
  height: 250px;
  border: 1px solid #E2E8F0;
  padding: 10px;
  background-color: #FFFFFF;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-placeholder {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #ffffff 40%, #000000 41%, #000000 45%, #ffffff 46%, #ffffff 100%);
  background-size: 10px 10px;
  opacity: 0.15;
}

/* SVG Custom Mock e-Donation QR */
.qr-official-svg {
  width: 100%;
  height: 100%;
}

.qr-caption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
}

.qr-logo-badge {
  background-color: var(--primary);
  color: var(--text-light);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  display: inline-block;
  margin-top: 5px;
}

/* --- Registration Form & Docs --- */
.register-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
}

.form-card {
  background-color: var(--bg-white);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.form-control {
  width: 100%;
  padding: 10px 15px;
  font-size: 15px;
  border: 1px solid #CBD5E0;
  border-radius: var(--border-radius);
  font-family: 'Sarabun', sans-serif;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 45, 98, 0.15);
}

textarea.form-control {
  resize: vertical;
}

/* Document download block */
.docs-card {
  background-color: var(--bg-white);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #E2E8F0;
}

.download-item:last-child {
  border-bottom: none;
}

.download-info h5 {
  font-size: 15px;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.download-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-download {
  background-color: #F0F4F8;
  color: var(--primary);
  font-weight: bold;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-download:hover {
  background-color: var(--primary);
  color: var(--text-light);
}

/* --- Official Contact & Map --- */
.contact-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact-info-panel h3 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 20px;
  border-bottom: 2px solid var(--secondary);
  padding-bottom: 8px;
  display: inline-block;
}

.contact-list {
  list-style: none;
  margin-bottom: 30px;
}

.contact-list li {
  display: flex;
  gap: 15px;
  margin-bottom: 18px;
}

.contact-list li i {
  font-size: 20px;
  color: var(--primary-light);
  margin-top: 4px;
}

.map-wrapper {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 4px solid var(--bg-white);
  height: 350px;
}

.map-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Footer --- */
.main-footer {
  background-color: var(--primary-dark);
  color: var(--text-light);
  padding: 50px 0 20px 0;
  border-top: 5px solid var(--secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-about h4 {
  font-size: 18px;
  color: var(--secondary-light);
  margin-bottom: 15px;
}

.footer-about p {
  font-size: 14px;
  color: #CBD5E0;
}

.footer-links h4,
.footer-contact h4 {
  font-size: 16px;
  color: var(--secondary-light);
  margin-bottom: 15px;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 8px;
}

.footer-links ul li a {
  font-size: 14px;
  color: #CBD5E0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.footer-links ul li a:hover {
  color: var(--secondary);
  padding-left: 5px;
}

.footer-contact-list {
  list-style: none;
  font-size: 14px;
  color: #CBD5E0;
}

.footer-contact-list li {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-contact-list li i {
  color: var(--secondary);
  margin-top: 3px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: #A0AEC0;
  display: flex;
  justify-content: space-between;
}

.footer-admin-link {
  color: #718096;
}

.footer-admin-link:hover {
  color: var(--secondary);
}

/* --- Modals CSS --- */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.custom-modal-card {
  background-color: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
}

.modal-header-success {
  background-color: var(--accent-green);
  color: var(--text-light);
  padding: 30px;
  text-align: center;
}

.modal-header-info {
  background-color: var(--primary);
  color: var(--text-light);
  padding: 20px;
}

.modal-icon {
  font-size: 60px;
  margin-bottom: 15px;
}

.modal-body {
  padding: 30px;
}

.modal-body p {
  margin-bottom: 15px;
}

.modal-notice {
  background-color: #FFFDF5;
  border-left: 4px solid var(--secondary);
  padding: 15px;
  font-size: 14px;
}

.modal-footer {
  padding: 20px 30px;
  background-color: var(--bg-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #E2E8F0;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table th {
  text-align: left;
  padding: 8px 12px;
  background-color: #EDF2F7;
  width: 30%;
  font-size: 14px;
  font-weight: 600;
}

.detail-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #EDF2F7;
  font-size: 14px;
}

/* --- Admin Panel --- */
.admin-login-wrapper {
  max-width: 400px;
  margin: 100px auto;
}

.admin-login-card {
  background-color: var(--bg-white);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--primary);
}

.admin-login-logo {
  text-align: center;
  margin-bottom: 25px;
}

.admin-login-logo img {
  height: 80px;
}

.admin-login-logo h3 {
  margin-top: 10px;
  color: var(--primary);
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 80vh;
  background-color: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-top: 20px;
}

.admin-sidebar {
  background-color: #1E293B;
  color: #94A3B8;
  padding: 20px 0;
}

.admin-profile {
  padding: 0 20px 20px 20px;
  border-bottom: 1px solid #334155;
  margin-bottom: 20px;
  text-align: center;
}

.admin-profile > i {
  font-size: 40px;
  color: var(--secondary);
  margin-bottom: 10px;
  display: block;
}

.admin-profile h4 {
  color: var(--text-light);
  font-size: 15px;
  margin-bottom: 8px;
}

.admin-profile span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-profile span i {
  font-size: 8px !important;
  color: var(--accent-green) !important;
  margin: 0 !important;
}

.admin-sidebar-menu {
  list-style: none;
}

.admin-sidebar-menu li {
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  transition: var(--transition);
}

.admin-sidebar-menu li:hover,
.admin-sidebar-menu li.active {
  background-color: #334155;
  color: var(--text-light);
  border-left: 4px solid var(--secondary);
}

.admin-content {
  padding: 40px;
  background-color: #F8FAFC;
  overflow-y: auto;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  border-bottom: 2px solid #E2E8F0;
  padding-bottom: 15px;
}

.admin-section-header h3 {
  color: var(--primary);
  font-size: 22px;
}

/* Admin tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.admin-table th {
  background-color: var(--primary);
  color: var(--text-light);
  text-align: left;
  padding: 12px 18px;
  font-size: 14px;
}

.admin-table td {
  padding: 12px 18px;
  border-bottom: 1px solid #E2E8F0;
  font-size: 14px;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background-color: #F1F5F9;
}

.btn-table {
  border: none;
  background: none;
  cursor: pointer;
  padding: 5px 8px;
  font-size: 14px;
  border-radius: 3px;
  transition: var(--transition);
}

.btn-view { color: var(--primary); }
.btn-view:hover { background-color: rgba(0,45,98,0.1); }
.btn-edit { color: #E0A800; }
.btn-edit:hover { background-color: rgba(224,168,0,0.1); }
.btn-delete { color: var(--accent); }
.btn-delete:hover { background-color: rgba(217,83,79,0.1); }

.sub-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}

.status-select {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #CBD5E0;
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.select-status-pending { background-color: #FEF3C7; color: #D97706; border-color: #FCD34D; }
.select-status-approved { background-color: #D1FAE5; color: #059669; border-color: #A7F3D0; }
.select-status-rejected { background-color: #FEE2E2; color: #DC2626; border-color: #FCA5A5; }

.admin-news-item {
  display: flex;
  align-items: center;
  gap: 15px;
}

.admin-news-thumb {
  width: 50px;
  height: 38px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #CBD5E0;
}

.btn-file-upload {
  font-size: 12px !important;
  padding: 6px 12px !important;
}

/* --- Animations --- */
@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.animate-zoom-in {
  animation: zoomIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* --- Mobile Menu Styles & Responsiveness --- */
@media (max-width: 992px) {
  .top-bar-container {
    height: auto;
    padding: 10px 20px;
    flex-direction: column;
    gap: 5px;
  }
  .top-contacts .setting-frequency {
    animation: none;
    padding-left: 0;
    display: inline;
  }
  .freq-ticker-wrapper {
    max-width: none;
    display: inline;
  }
  .ticker-wrap {
    max-width: 100%;
    width: 100%;
    border: none;
  }
  .header-container {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .welcome-grid, .support-wrapper, .register-layout, .contact-section-grid, .footer-grid {
    grid-template-columns: 1fr;
  }
  .emergency-bar {
    margin-top: 0;
  }
  .emergency-grid {
    grid-template-columns: 1fr;
  }
  .emergency-widget {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
  }
  .emergency-widget:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: var(--primary-dark);
  }
  .nav-links.active {
    display: flex;
  }
  .nav-links li a {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .hero-slider-wrapper {
    height: 350px;
  }
  .slide-content h2 {
    font-size: 26px;
  }
  .slide-content p {
    font-size: 14px;
  }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 20px;
    overflow-x: auto;
  }
  .admin-profile {
    display: none;
  }
  .admin-sidebar-menu {
    display: flex;
    flex-direction: row;
    width: 100%;
  }
  .admin-sidebar-menu li {
    white-space: nowrap;
    border-left: none;
  }
  .admin-sidebar-menu li.active {
    border-bottom: 3px solid var(--secondary);
    border-left: none;
  }
}

/* --- Splash Overlay / Royal Greeting Screen --- */
.splash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.98); /* Very dark slate matching the site theme */
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  transition: opacity 0.5s ease;
}

.splash-content {
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.splash-image-wrapper {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 4px solid var(--secondary);
  overflow: hidden;
  line-height: 0;
}

.splash-image-wrapper img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.splash-btn-container {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-enter-site {
  background-color: var(--secondary);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 16px;
  padding: 12px 30px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-enter-site:hover {
  background-color: var(--secondary-light);
  color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.body-lock-scroll {
  overflow: hidden !important;
}

@keyframes scaleUp {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- Homepage Stat Section --- */
.stats-section {
  background: radial-gradient(circle at 10% 20%, rgba(11, 60, 93, 0.4) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(212, 175, 87, 0.2) 0%, transparent 40%),
              linear-gradient(135deg, var(--primary-dark) 0%, #051A33 100%);
  color: var(--text-light);
  padding: 60px 0;
  position: relative;
  border-top: 3px solid var(--secondary);
  border-bottom: 3px solid var(--secondary);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
}
.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  padding: 30px 20px;
  text-align: center;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--secondary), transparent);
  transform: scaleX(0);
  transition: var(--transition);
}
.stat-card:hover::before {
  transform: scaleX(1);
}
.stat-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 87, 0.2);
  box-shadow: 0 10px 25px rgba(212, 175, 87, 0.1);
}
.stat-icon {
  font-size: 36px;
  color: var(--secondary);
  margin-bottom: 15px;
  display: inline-block;
  text-shadow: 0 0 10px rgba(212, 175, 87, 0.3);
}
.stat-number {
  font-size: 40px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 5px;
  font-family: 'Sarabun', sans-serif;
  background: linear-gradient(to right, #FFFFFF, var(--secondary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

/* --- Radio Communications Dashboard --- */
.radio-dashboard-section {
  padding: 60px 0;
  background-color: var(--bg-white);
}
.radio-dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 768px) {
  .radio-dashboard-grid {
    grid-template-columns: 1fr;
  }
}
.radio-dashboard-info h3 {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 15px;
  position: relative;
  padding-bottom: 10px;
}
.radio-dashboard-info h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--secondary);
}
.radio-dashboard-info p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 25px;
}
.radio-channels-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.radio-channel-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--bg-light);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}
.radio-channel-item:hover {
  transform: translateX(5px);
  background: var(--bg-white);
  box-shadow: var(--shadow-md);
}
.radio-channel-item.active-channel {
  border-left-color: var(--secondary);
  background: var(--bg-white);
  box-shadow: var(--shadow-md);
}
.radio-channel-badge {
  background: var(--primary-light);
  color: var(--text-light);
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 13px;
  min-width: 80px;
  text-align: center;
}
.radio-channel-item.active-channel .radio-channel-badge {
  background: var(--secondary);
  color: var(--primary-dark);
}
.radio-channel-details h5 {
  font-size: 15px;
  margin: 0 0 3px 0;
  color: var(--text-dark);
}
.radio-channel-details span {
  font-size: 13px;
  color: var(--text-muted);
}

.radio-physical-widget {
  background: #1E293B;
  border: 4px solid #0F172A;
  border-radius: 12px;
  padding: 25px;
  color: #00FF66;
  font-family: monospace;
  box-shadow: var(--shadow-lg), inset 0 0 10px rgba(0,0,0,0.8);
  position: relative;
  margin-top: 20px;
}
.radio-antenna {
  position: absolute;
  top: -45px;
  right: 40px;
  width: 8px;
  height: 45px;
  background: #475569;
  border-radius: 4px 4px 0 0;
}
.radio-antenna::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -2px;
  width: 12px;
  height: 12px;
  background: #EF4444;
  border-radius: 50%;
  box-shadow: 0 0 8px #EF4444;
}
.radio-knob-container {
  display: flex;
  gap: 15px;
  position: absolute;
  top: -20px;
  left: 30px;
}
.radio-knob {
  width: 25px;
  height: 20px;
  background: #475569;
  border-radius: 3px 3px 0 0;
  border-bottom: 2px solid #0F172A;
}
.radio-screen {
  background: #022c22;
  border: 3px solid #0f172a;
  border-radius: 6px;
  padding: 20px;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.9);
  margin-bottom: 20px;
  text-shadow: 0 0 5px #00FF66;
}
.radio-screen-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(0,255,102,0.6);
  border-bottom: 1px solid rgba(0,255,102,0.3);
  padding-bottom: 5px;
  margin-bottom: 10px;
}
.radio-status-signal {
  display: flex;
  gap: 3px;
  align-items: flex-end;
}
.signal-bar {
  width: 3px;
  background: rgba(0,255,102,0.2);
  border-radius: 1px;
}
.signal-bar.active {
  background: #00FF66;
  box-shadow: 0 0 5px #00FF66;
}
.signal-bar:nth-child(1) { height: 4px; }
.signal-bar:nth-child(2) { height: 7px; }
.signal-bar:nth-child(3) { height: 10px; }
.signal-bar:nth-child(4) { height: 13px; }
.signal-bar:nth-child(5) { height: 16px; }

.radio-frequency-display {
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 1px;
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.radio-unit {
  font-size: 16px;
  color: rgba(0,255,102,0.7);
}
.radio-channel-name {
  font-size: 14px;
  color: #38BDF8;
  text-shadow: 0 0 5px #38BDF8;
  margin-bottom: 5px;
}
.radio-sub-status {
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  color: rgba(0,255,102,0.7);
}
.radio-speaker-grill {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 15px;
  padding: 0 10px;
}
.speaker-line {
  height: 2px;
  background: rgba(255,255,255,0.05);
  border-radius: 1px;
}
.radio-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.radio-btn {
  background: #334155;
  border: 1px solid #1E293B;
  color: #F8F9FA;
  padding: 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  text-align: center;
  font-weight: bold;
}
.radio-btn:hover {
  background: #475569;
}
.radio-btn.active {
  background: var(--secondary);
  color: var(--primary-dark);
  border-color: var(--secondary-dark);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

/* --- Testimonial Marquee Slider --- */
.testimonial-section {
  background-color: var(--bg-light);
  padding: 60px 0;
  overflow: hidden;
  position: relative;
  border-top: 1px solid #E2E8F0;
}
.testimonial-marquee-container {
  overflow: hidden;
  width: 100%;
  position: relative;
  display: flex;
}
.testimonial-marquee-container::before,
.testimonial-marquee-container::after {
  content: '';
  position: absolute;
  top: 0;
  width: 100px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
.testimonial-marquee-container::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-light) 0%, transparent 100%);
}
.testimonial-marquee-container::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg-light) 0%, transparent 100%);
}
.testimonial-wrapper {
  display: flex;
  gap: 25px;
  animation: marquee-scroll 45s linear infinite;
  width: max-content;
  padding: 10px 0;
}
.testimonial-wrapper:hover {
  animation-play-state: paused;
}
.testimonial-card {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 25px;
  width: 340px;
  flex-shrink: 0;
  transition: var(--transition);
  border-left: 4px solid var(--secondary);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-left-color: var(--primary);
}
.testimonial-quote {
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 15px;
}
.testimonial-user {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #F1F5F9;
  padding-top: 15px;
}
.testimonial-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  color: var(--text-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}
.testimonial-avatar-gold {
  background: var(--secondary);
  color: var(--primary-dark);
}
.testimonial-user-info h5 {
  font-size: 14px;
  margin: 0;
  color: var(--primary);
  font-weight: 600;
}
.testimonial-user-info span {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}
@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Quick Emergency Hotlines Directory --- */
.emergency-directory-section {
  padding: 60px 0;
  background-color: var(--bg-white);
  border-top: 1px solid #E2E8F0;
}
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
}
.directory-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--bg-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-bottom: 4px solid transparent;
  text-decoration: none;
}
.directory-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.directory-icon {
  font-size: 32px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #FFF;
  box-shadow: var(--shadow-sm);
}
.directory-info h4 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 2px 0;
  font-family: 'Sarabun', sans-serif;
}
.directory-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.directory-card.card-red {
  border-bottom-color: #EF4444;
}
.directory-card.card-red .directory-icon {
  color: #EF4444;
}
.directory-card.card-red .directory-info h4 {
  color: #EF4444;
}
.directory-card.card-orange {
  border-bottom-color: #F97316;
}
.directory-card.card-orange .directory-icon {
  color: #F97316;
}
.directory-card.card-orange .directory-info h4 {
  color: #F97316;
}
.directory-card.card-blue {
  border-bottom-color: var(--primary);
}
.directory-card.card-blue .directory-icon {
  color: var(--primary);
}
.directory-card.card-blue .directory-info h4 {
  color: var(--primary);
}
.directory-card.card-yellow {
  border-bottom-color: #EAB308;
}
.directory-card.card-yellow .directory-icon {
  color: #EAB308;
}
.directory-card.card-yellow .directory-info h4 {
  color: #EAB308;
}

/* --- Mission Photo Showcase Gallery --- */
.gallery-section {
  padding: 60px 0;
  background-color: var(--bg-light);
  border-top: 1px solid #E2E8F0;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
.gallery-item {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  height: 240px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 45, 98, 0.9) 100%);
  opacity: 0.9;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 20px;
}
.gallery-item:hover img {
  transform: scale(1.1);
}
.gallery-item:hover .gallery-overlay {
  background: linear-gradient(180deg, rgba(0, 45, 98, 0.2) 20%, rgba(0, 45, 98, 0.95) 100%);
}
.gallery-text {
  color: var(--text-light);
}
.gallery-text h5 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 5px 0;
  color: var(--secondary);
}
.gallery-text span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  display: block;
}

/* --- News Detail Gallery Overrides --- */
.news-gallery .gallery-item {
  height: auto;
}

/* --- FAQ Accordion Section --- */
.faq-section {
  padding: 60px 0;
  background-color: var(--bg-white);
  border-top: 1px solid #E2E8F0;
}
.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.faq-item {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid #E2E8F0;
  overflow: hidden;
  transition: var(--transition);
}
.faq-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.faq-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.faq-header h5 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
  padding-right: 15px;
  line-height: 1.5;
}
.faq-icon {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}
.faq-item.active {
  border-color: var(--secondary);
}
.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: var(--secondary);
}
.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.faq-content {
  padding: 0 20px 20px 20px;
  border-top: 1px solid #F1F5F9;
  padding-top: 15px;
}
.faq-content p {
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.8;
  margin: 0;
}

/* --- Dynamic Disaster Alert Banner --- */
.disaster-alert-section {
  background: linear-gradient(90deg, #7F1D1D 0%, #B91C1C 50%, #7F1D1D 100%);
  color: #FFFFFF;
  padding: 12px 0;
  border-bottom: 2px solid var(--secondary);
  font-family: 'Sarabun', sans-serif;
  overflow: hidden;
}
.alert-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
@media (max-width: 768px) {
  .alert-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
.alert-badge-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.alert-badge {
  background: #FEF2F2;
  color: #991B1B;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(254, 242, 242, 0.4);
}
.alert-pulse-dot {
  width: 8px;
  height: 8px;
  background: #F87171;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7);
  animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(248, 113, 113, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0);
  }
}
.alert-text-marquee {
  flex-grow: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  width: 100%;
}
.alert-text-content {
  display: inline-block;
  padding-left: 100%;
  animation: alert-marquee 30s linear infinite;
}
@keyframes alert-marquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}
.alert-action-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #FFFFFF;
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  align-self: center;
}
.alert-action-btn:hover {
  background: #FFFFFF;
  color: #991B1B;
  border-color: #FFFFFF;
}

/* --- Premium Interactive Bank Card --- */
.bank-card-container {
  margin: 25px 0;
  perspective: 1000px;
}
.bank-card {
  background: linear-gradient(135deg, #006F3D 0%, #004D2A 100%);
  color: #FFFFFF;
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 10px 25px rgba(0, 77, 42, 0.2);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  font-family: 'Sarabun', sans-serif;
}
.bank-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 77, 42, 0.4);
}
.bank-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(212, 175, 87, 0.1) 0%, transparent 70%);
  pointer-events: none;
}
.bank-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.bank-card-brand {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--secondary-light);
}
.bank-card-type {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
}
.bank-card-chip {
  width: 45px;
  height: 32px;
  background: linear-gradient(135deg, #FFE082 0%, #FFB300 100%);
  border-radius: 6px;
  position: relative;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.chip-line {
  position: absolute;
  background: rgba(0,0,0,0.2);
}
.chip-line:nth-child(1) { top: 30%; left: 0; width: 100%; height: 1px; }
.chip-line:nth-child(2) { top: 65%; left: 0; width: 100%; height: 1px; }
.chip-line:nth-child(3) { top: 0; left: 33%; width: 1px; height: 100%; }
.chip-line:nth-child(4) { top: 0; left: 66%; width: 1px; height: 100%; }

.bank-card-number {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  font-family: monospace;
  margin-bottom: 25px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.bank-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.bank-card-holder {
  display: flex;
  flex-direction: column;
}
.bank-card-holder .label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
  margin-bottom: 3px;
}
.bank-card-holder .value {
  font-size: 14px;
  font-weight: 600;
}
.bank-card-copy-btn {
  background: var(--secondary);
  border: none;
  color: var(--primary-dark);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(212, 175, 87, 0.2);
}
.bank-card-copy-btn:hover {
  background: var(--secondary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(212, 175, 87, 0.35);
}
.bank-card-copy-btn:active {
  transform: translateY(0);
}

/* --- Floating Back to Top Button --- */
.back-to-top-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 50px;
  height: 50px;
  background-color: var(--primary);
  color: var(--secondary);
  border: 2px solid var(--secondary);
  border-radius: 50%;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 15px rgba(0, 45, 98, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background-color: var(--secondary);
  color: var(--primary-dark);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

/* Radio waves pulse animation */
.back-to-top-btn .btn-pulse-wave,
.back-to-top-btn .btn-pulse-wave-2 {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--secondary);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.back-to-top-btn .btn-pulse-wave {
  animation: back-to-top-pulse 2.5s infinite;
}

.back-to-top-btn .btn-pulse-wave-2 {
  animation: back-to-top-pulse 2.5s infinite 1.25s;
}

@keyframes back-to-top-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* --- Founding Gallery Collage --- */
.founding-gallery-collage {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-top: 25px;
}

.founding-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  background: #0b0f19;
  transition: all 0.45s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.founding-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Glowing overlay effect */
.founding-gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.3) 50%, transparent 100%);
  opacity: 0.9;
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: #fff;
  z-index: 2;
}

.founding-gallery-overlay h5 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 5px 0;
  transform: translateY(5px);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  color: #fff;
  line-height: 1.4;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.founding-gallery-overlay span {
  font-size: 11px;
  color: var(--secondary-light);
  opacity: 0.95;
  transform: translateY(5px);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) 0.05s;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.founding-gallery-overlay span i {
  font-size: 9px;
}

/* Hover effects */
.founding-gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 35px rgba(0, 45, 98, 0.22), 0 0 15px rgba(0, 180, 216, 0.25);
  border-color: var(--secondary);
}

.founding-gallery-item:hover img {
  transform: scale(1.08) rotate(0.5deg);
}

.founding-gallery-item:hover .founding-gallery-overlay {
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.4) 50%, rgba(15, 23, 42, 0.15) 100%);
}

.founding-gallery-item:hover .founding-gallery-overlay h5,
.founding-gallery-item:hover .founding-gallery-overlay span {
  transform: translateY(0);
}

/* Collage Placement for Desktop (>= 1024px) */
@media (min-width: 1024px) {
  .founding-gallery-item.col-hero {
    grid-column: span 6;
    grid-row: span 2;
    aspect-ratio: 16/10;
  }
  .founding-gallery-item.col-hero .founding-gallery-overlay h5 {
    font-size: 18px;
  }
  .founding-gallery-item.col-standard {
    grid-column: span 3;
    aspect-ratio: 4/3;
  }
  .founding-gallery-item.col-wide {
    grid-column: span 12;
    aspect-ratio: 21/9;
  }
}

/* Tablet Layout (768px to 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
  .founding-gallery-collage {
    grid-template-columns: repeat(6, 1fr);
  }
  .founding-gallery-item.col-hero {
    grid-column: span 6;
    aspect-ratio: 16/9;
  }
  .founding-gallery-item.col-standard {
    grid-column: span 3;
    aspect-ratio: 4/3;
  }
  .founding-gallery-item.col-wide {
    grid-column: span 6;
    aspect-ratio: 16/7;
  }
}

/* Mobile Layout (< 768px) */
@media (max-width: 767px) {
  .founding-gallery-collage {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .founding-gallery-item {
    aspect-ratio: 4/3 !important;
  }
}
