/* Custom Theme & Thai Typography Styles */
@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,600&display=swap');

:root {
  --color-cream: #FAF9F6;
  --color-cream-light: #FFFFFF;
  --color-cream-dark: #EEF2F7;
  --color-navy: #004F98;
  --color-navy-light: #0284C7;
  --color-navy-dark: #002D59;
  --color-brown: #004F98;
  --color-brown-light: #0284C7;
  --color-brown-dark: #002D59;
  --color-gold: #0284C7;
  --color-gold-light: #38BDF8;
  --color-gold-dark: #004F98;
  --color-cyan: #0284C7;
  --color-cyan-light: #38BDF8;
  --color-cyan-dark: #0369A1;
  --color-green: #059669;
  --color-green-dark: #047857;
}

html {
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Prompt', sans-serif;
  background-color: var(--color-cream);
  color: var(--color-navy-dark);
  scroll-behavior: smooth;
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  position: relative;
  margin: 0;
  padding: 0;
}

/* Scroll Progress Bar at the top of the window */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #004F98 0%, #0284C7 50%, #38BDF8 100%);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.6);
}

/* Sticky Glassmorphism Navigation Bar */
.glass-nav {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  background-color: rgba(250, 249, 246, 0.94) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid rgba(2, 132, 199, 0.2) !important;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
  margin: 0 !important;
  transform: none !important;
}

.glass-nav.nav-scrolled {
  background-color: rgba(250, 249, 246, 0.98) !important;
  box-shadow: 0 6px 20px -4px rgba(0, 79, 152, 0.12) !important;
  border-bottom: 1px solid rgba(2, 132, 199, 0.35) !important;
}

.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(238, 242, 247, 0.9);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.glass-card h3, .glass-card p, .glass-card span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.line-clamp-1 {
  display: -webkit-box !important;
  -webkit-line-clamp: 1 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.line-clamp-2 {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.line-clamp-3 {
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.wellness-gradient {
  background: linear-gradient(135deg, #FAF9F6 0%, #EEF2F7 50%, #FAF9F6 100%);
}

.hero-gradient {
  background: radial-gradient(circle at top right, rgba(2, 132, 199, 0.18), transparent 55%),
              radial-gradient(circle at bottom left, rgba(0, 79, 152, 0.08), transparent 50%),
              #FAF9F6;
}

.gold-gradient, .ocean-gradient {
  background: linear-gradient(135deg, #004F98 0%, #0284C7 50%, #38BDF8 100%);
}

.gold-badge, .cyan-badge {
  background: linear-gradient(135deg, #0284C7 0%, #38BDF8 100%);
}

.navy-badge {
  background: linear-gradient(135deg, #004F98 0%, #0284C7 100%);
}

.green-badge {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
}

/* Floating Animations */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(1.5deg); }
}

@keyframes floatReverse {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(12px) rotate(-1.5deg); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.08); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes highlightFlash {
  0% { box-shadow: 0 0 0 0 rgba(0, 102, 192, 0.7); }
  50% { box-shadow: 0 0 35px 8px rgba(0, 102, 192, 0.85); transform: scale(1.01); }
  100% { box-shadow: 0 0 0 0 rgba(0, 102, 192, 0); transform: scale(1); }
}

.animate-float-slow {
  animation: floatSlow 6s ease-in-out infinite;
}

.animate-float-reverse {
  animation: floatReverse 7s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 4s ease-in-out infinite;
}

.shimmer-btn {
  position: relative;
  overflow: hidden;
}

.shimmer-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: rotate(30deg);
  animation: shimmer 3.5s infinite;
}

.form-highlight-active {
  animation: highlightFlash 1.2s ease-out;
}

/* Reveal on scroll styling - ensure content is 100% visible by default */
.reveal-init {
  opacity: 1 !important;
  transform: none !important;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* Hover & Animation effects */
.hover-lift {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, border-color 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 38px -12px rgba(69, 50, 31, 0.16);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(0, 102, 192, 0.45);
}

/* Infinite Marquee Ticker */
.marquee-ribbon {
  overflow: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
}

@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.marquee-track {
  display: flex;
  width: max-content !important;
  animation: marquee 28s linear infinite;
  white-space: nowrap;
}

.marquee-track:hover {
  animation-play-state: paused;
}

/* Floating Quick Action Widget */
.floating-action-menu {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.floating-action-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(20px) scale(0.9);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-action-menu.active .floating-action-items {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

.floating-main-btn {
  width: 54px;
  height: 54px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #004F98, #0066C0);
  color: #0066C0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 79, 152, 0.35);
  transition: all 0.3s ease;
  border: 2px solid #0066C0;
}

.floating-main-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 15px 30px rgba(0, 79, 152, 0.45);
}

.floating-action-menu.active .floating-main-btn i {
  transform: rotate(45deg);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #EEF2F7;
}
::-webkit-scrollbar-thumb {
  background: #0066C0;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #004F98;
}

/* Lightbox styles */
.lightbox-modal {
  display: none;
  position: fixed !important;
  z-index: 999999 !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: auto;
  background-color: rgba(0, 45, 89, 0.95);
  backdrop-filter: blur(8px);
}

.lightbox-modal.active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  animation: fadeIn 0.25s ease-out forwards;
}

/* Floating Quick Contact Speed-Dial */
#floating-contact-menu {
  z-index: 99990 !important;
}

#floating-contact-menu.active #floating-contact-items {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

#floating-contact-menu.active #floating-contact-toggle {
  background: #002D59 !important;
  transform: rotate(90deg) scale(1.05) !important;
}

#floating-contact-menu.active #floating-icon-open {
  display: none !important;
}

#floating-contact-menu.active #floating-icon-close {
  display: block !important;
}

/* FAQ Accordion Active Styles */
.faq-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active {
  border-color: #0284C7 !important;
  box-shadow: 0 4px 20px -2px rgba(0, 79, 152, 0.12) !important;
}

.faq-item.active .faq-trigger {
  background-color: #FAF9F6 !important;
}

.faq-item.active .faq-icon-wrapper {
  transform: rotate(180deg) !important;
  background-color: #004F98 !important;
  color: #ffffff !important;
}

.faq-item:not(.active) .faq-icon-wrapper {
  transform: rotate(0deg) !important;
  background-color: #FAF9F6 !important;
  color: #0066C0 !important;
}

.faq-item.active .faq-content {
  display: block !important;
}

.faq-item:not(.active) .faq-content {
  display: none !important;
}

/* Modal FAQ Accordion */
.faq-modal-item {
  transition: all 0.25s ease-in-out;
}

.faq-modal-item.active {
  border-color: #0284C7 !important;
  box-shadow: 0 4px 15px -2px rgba(0, 79, 152, 0.12) !important;
}

.faq-modal-item.active .faq-modal-content {
  display: block !important;
}

.faq-modal-item:not(.active) .faq-modal-content {
  display: none !important;
}

.faq-modal-item.active .fa-chevron-down {
  transform: rotate(180deg) !important;
  color: #004F98 !important;
}

.faq-modal-item:not(.active) .fa-chevron-down {
  transform: rotate(0deg) !important;
  color: #0066C0 !important;
}

/* Mobile Nav Drawer & Backdrop Guaranteed Styling */
#mobile-drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 82% !important;
  max-width: 320px !important;
  height: 100% !important;
  height: 100dvh !important;
  background-color: #FAF9F6 !important;
  z-index: 99999 !important;
  transform: translateX(100%) !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: -5px 0 25px rgba(0, 79, 152, 0.25) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

#mobile-drawer.active {
  transform: translateX(0) !important;
}

#mobile-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99990 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

#mobile-backdrop.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  display: block !important;
}

/* ==============================================================================
   RESPONSIVE & MOBILE OPTIMIZATIONS
   ============================================================================== */

/* 1. Prevent iOS Auto-Zoom on Form Inputs */
@media (max-width: 768px) {
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  }
}

/* 2. Small Screen Adjustments (< 480px: iPhone SE, Androids) */
@media (max-width: 480px) {
  .hero-gradient {
    padding-top: 2rem !important;
    padding-bottom: 2.5rem !important;
  }

  /* Keep floating badges within screen bounds */
  .animate-float-slow,
  .animate-float-reverse {
    animation-duration: 8s !important;
  }

  /* Floating contact speed dial sizing on small screens */
  #floating-contact-menu {
    bottom: 16px !important;
    left: 16px !important;
  }
  #floating-contact-toggle {
    width: 48px !important;
    height: 48px !important;
  }
  #floating-contact-items a {
    font-size: 12px !important;
    padding: 8px 14px !important;
  }

  /* Back to Top button on small screens */
  #back-to-top {
    bottom: 16px !important;
    right: 16px !important;
    width: 44px !important;
    height: 44px !important;
  }

  /* Touch-friendly touch targets */
  button, 
  a.inline-flex,
  a.flex {
    min-height: 42px;
  }

  /* Lightbox max height */
  .lightbox-modal .relative {
    max-height: 90vh;
    padding: 12px !important;
  }
  #lightbox-image {
    max-height: 60vh !important;
  }
}

/* 3. Tablet & iPad Screen Adjustments (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .hero-gradient {
    padding-top: 3.5rem !important;
  }
}

/* 4. Smooth Safe-Area insets for modern notched phones (iPhone 12/13/14/15/16) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  footer {
    padding-bottom: calc(3rem + env(safe-area-inset-bottom)) !important;
  }
  #floating-contact-menu,
  #back-to-top {
    bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  }
}

/* 5. Fluid Responsive Images & Video Embeds */
img, video {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

/* Responsive Table Wrapper for Mobile Views */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
