/* ============================================= */
/* STYLE.CSS – Nha Khoa Việt Bỉ Landing Page     */
/* Glassmorphism | Animations | Micro-interactions */
/* ============================================= */

/* ---- Design Tokens / CSS Variables ---- */
:root {
  /* ── Brand Colors ── */
  --primary-color: #0A7C8C;
  --primary-dark: #086373;
  --primary-light: #0d9aad;
  --primary-50: #e6f5f7;
  --primary-100: #b3e0e6;

  --cta-color: #F97316;
  --cta-dark: #EA580C;
  --cta-light: #FB923C;

  --accent-color: #E63946;
  --accent-dark: #C62828;

  /* ── Text Colors ── */
  --text-primary: #1F2937;       /* gray-800 – body text */
  --text-secondary: #4B5563;     /* gray-600 – descriptions */
  --text-muted: #6B7280;         /* gray-500 – captions */
  --text-white: #FFFFFF;
  --text-inside: #FFFFFF;        /* text on colored backgrounds */
  --text-link: var(--primary-color);

  /* ── Surfaces ── */
  --bg-body: #FFFFFF;
  --bg-section-alt: #F9FAFB;     /* gray-50 – alternating sections */
  --bg-dark: #111827;            /* gray-900 – footer */

  /* ── Glassmorphism ── */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-bg-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(10, 124, 140, 0.1);
  --glass-blur: 12px;
  --glass-blur-strong: 20px;

  /* ── Spacing & Radii ── */
  --radius-sm: 0.5rem;           /* 8px */
  --radius-md: 0.75rem;          /* 12px */
  --radius-lg: 1rem;             /* 16px */
  --radius-xl: 1.25rem;          /* 20px */
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.1);
  --shadow-cta: 0 8px 20px rgba(249,115,22,0.3);

  /* ── Transitions ── */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* ── Backward-compat aliases (used in existing rules) ── */
  --color-primary: var(--primary-color);
  --color-primary-dark: var(--primary-dark);
  --color-primary-light: var(--primary-light);
  --color-primary-50: var(--primary-50);
  --color-cta: var(--cta-color);
  --color-cta-dark: var(--cta-dark);
  --color-accent: var(--accent-color);
}

/* ---- Smooth Scrolling ---- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Offset for fixed header */
html {
  scroll-padding-top: 80px;
}

/* ---- Selection Color ---- */
::selection {
  background: var(--primary-color);
  color: var(--text-inside);
}

/* ============================================= */
/* GLASSMORPHISM                                  */
/* ============================================= */

/* Header glass effect */
.header-glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.header-glass.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
}

/* Generic glass card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* Form glass effect */
.glass-form {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur-strong));
  -webkit-backdrop-filter: blur(var(--glass-blur-strong));
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Pricing table rows – mobile stack */
.pricing-row {
  transition: background-color 0.2s ease;
}
@media (max-width: 1023px) {
  .pricing-row {
    display: flex;
    flex-wrap: wrap;
    padding: 1rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
  }
}

/* Pricing card hover glass (legacy – kept for backwards compat) */
.pricing-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(10, 124, 140, 0.12);
}

/* ============================================= */
/* PARALLAX                                       */
/* ============================================= */

.parallax-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  will-change: transform;
}

.parallax-bg img {
  width: 100%;
  height: 120%;
  object-fit: cover;
  object-position: center;
}

/* Extra layer to improve hero text contrast on top of photo backgrounds */
.hero-layered::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.45) 38%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(92deg, rgba(255, 255, 255, 0.86) 6%, rgba(255, 255, 255, 0.55) 44%, rgba(255, 255, 255, 0.15) 72%, rgba(255, 255, 255, 0.02) 100%);
  pointer-events: none;
}

.hero-layered > .relative,
.hero-layered .scroll-indicator {
  position: relative;
  z-index: 2;
}

.hero-play-button {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.hero-video-trigger:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.7);
  outline-offset: 4px;
}

/* ============================================= */
/* ANIMATIONS – Fade In / Slide Up                */
/* ============================================= */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(249, 115, 22, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in {
  animation: fadeIn 1s ease-out forwards;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* ============================================= */
/* MICRO-INTERACTIONS                             */
/* ============================================= */

/* CTA Pulse effect */
.btn-cta-pulse {
  position: relative;
  animation: pulse-ring 2s ease-out infinite;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-cta-pulse:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-cta);
  animation: none;
}

.btn-cta-pulse:active {
  transform: translateY(0) scale(0.98);
}

/* Shimmer effect on hover for cards */
.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.pricing-card:hover::before {
  opacity: 1;
  animation: shimmer 1.5s ease-in-out;
}

/* ============================================= */
/* SCROLL REVEAL                                  */
/* ============================================= */

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.3s; }

/* ============================================= */
/* FAQ ACCORDION                                  */
/* ============================================= */

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
}

.faq-item.active .faq-content {
  max-height: 500px;
  transition: max-height 0.45s ease-in;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-item.active .faq-trigger {
  color: var(--primary-color);
}

.faq-item:hover {
  border-color: var(--primary-color);
  transition: border-color var(--transition-fast);
}

/* ============================================= */
/* MOBILE STICKY CTA                              */
/* ============================================= */

#mobileCta.visible {
  transform: translateY(0);
}

/* Add safe area for notch devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #mobileCta {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* ============================================= */
/* FORM STYLES                                    */
/* ============================================= */

input:focus,
select:focus {
  outline: none;
}

select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 20px;
}

/* Loading state for submit button */
#submitBtn.loading {
  pointer-events: none;
  opacity: 0.7;
}

#submitBtn.loading span {
  display: none;
}

#submitBtn.loading::after {
  content: 'Đang gửi...';
  display: inline;
}

/* ============================================= */
/* CLS PREVENTION                                 */
/* ============================================= */

/* Reserve space for images to prevent layout shift */
img {
  max-width: 100%;
  height: auto;
}

/* ============================================= */
/* RESPONSIVE ADJUSTMENTS                         */
/* ============================================= */

/* Mobile: prioritize call button, form is secondary */
@media (max-width: 1023px) {
  /* Reduce parallax on mobile for performance */
  .parallax-bg img {
    height: 100%;
  }

  /* Reduce animation intensity on mobile */
  .scroll-reveal {
    transform: translateY(20px);
  }

  /* Add bottom padding for sticky CTA */
  main {
    padding-bottom: 80px;
  }
}

/* Desktop: Form is primary CTA */
@media (min-width: 1024px) {
  .glass-form {
    position: relative;
  }

  .glass-form::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary-color), var(--cta-color));
    z-index: -1;
    opacity: 0.3;
  }
}

/* ---- Clinic Gallery Marquee ---- */
.marquee-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
}

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

.marquee-track[data-direction="reverse"] {
  animation-name: marquee-scroll-reverse;
}

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

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

.marquee-track img {
  height: 220px;
  width: auto;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .marquee-track img {
    height: 160px;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn-cta-pulse {
    animation: none;
  }

  .animate-float {
    animation: none;
  }

  .animate-fade-in-up,
  .animate-fade-in {
    animation: none;
    opacity: 1;
  }

  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .parallax-bg img {
    transform: none !important;
  }

  .marquee-track {
    animation: none;
  }
}

/* Print styles */
@media print {
  .header-glass,
  #mobileCta,
  .btn-cta-pulse {
    display: none !important;
  }

  .scroll-reveal {
    opacity: 1;
    transform: none;
  }
}
