/* BalanceBrain - Custom Styles */

:root {
  --color-primary: #f59e0b;
  --color-primary-hover: #d97706;
  --color-primary-light: #fbbf24;
  --color-primary-bg: #fffbeb;
  --color-primary-100: #fef3c7;
  --color-text: #374151;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;
  --color-border: #f3f4f6;
  --color-border-hover: #fbbf24;
  --shadow-card: 0 10px 30px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 20px 40px rgba(0,0,0,0.1);
  --radius-card: 1rem;
  --radius-button: 0.75rem;
  --transition-default: all 0.3s ease;
  --max-width: 80rem;
}

* {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Navigation */
.nav-link {
  position: relative;
  font-weight: 500;
  color: #374151;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s;
}

.nav-link:hover::after {
  width: 100%;
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 200px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 50;
}

.group:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #4b5563;
  border-radius: 8px;
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: #fffbeb;
  color: #d97706;
}

/* Mobile Nav */
.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: #374151;
  border-radius: 8px;
  transition: background 0.15s;
}

.mobile-nav-link:hover {
  background: #f9fafb;
}

/* Service Cards */
.service-card {
  display: block;
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  background: white;
  border: 1px solid #f3f4f6;
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  border-color: #fbbf24;
}

/* Program Cards */
.program-card {
  display: block;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #f3f4f6;
  transition: all 0.3s ease;
}

.program-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Header scroll effect */
.header-scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.08);
}

/* Page header (for subpages) */
.page-header {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  padding: 8rem 0 4rem;
}

/* Info cards */
.info-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid #f3f4f6;
  transition: all 0.3s ease;
}

.info-card:hover {
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

/* FAQ accordion */
.faq-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.2s;
}

.faq-item:hover {
  border-color: #fbbf24;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  background: white;
}

.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: #6b7280;
  line-height: 1.8;
  display: none;
}

.faq-item.active .faq-answer {
  display: block;
}

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

/* Scroll to top button */
#scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(245,158,11,0.3);
  z-index: 40;
}

#scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

#scroll-top:hover {
  background: #d97706;
  transform: translateY(-2px);
}

/* Review cards */
.review-card {
  transition: all 0.3s ease;
}

.review-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.review-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-card {
  cursor: pointer;
}

.review-card .review-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: #f59e0b;
  font-weight: 500;
}

.review-card.expanded .review-excerpt {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.review-card.expanded .review-more {
  color: #9ca3af;
}

/* Counter animation */
.counter-value {
  display: inline-block;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: white;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
}

/* Consultation form */
.consult-form input,
.consult-form select,
.consult-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: white;
}

.consult-form input:focus,
.consult-form select:focus,
.consult-form textarea:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.1);
}

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

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }
.delay-7 { transition-delay: 0.7s; }
.delay-8 { transition-delay: 0.8s; }

/* Gallery image hover */
.gallery-img {
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-img:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Center card v2 - enhanced visual design */
.center-card-v2 {
  display: block;
  border-radius: 1rem;
  overflow: hidden;
  background: white;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.center-card-v2:hover {
  box-shadow: 0 12px 40px rgba(225,29,72,0.15);
  transform: translateY(-4px);
  border-color: rgba(225,29,72,0.3);
}

.center-card-v2-header {
  position: relative;
  padding: 1.25rem 1.5rem;
  overflow: hidden;
}

.center-card-v2-region {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  letter-spacing: 0.05em;
}

.center-card-v2-body {
  padding: 1.25rem 1.5rem;
}

/* Video review cards */
.video-card {
  transition: all 0.3s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Research citation block */
.research-citation {
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
  padding: 1rem 1.25rem;
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 0.875rem;
  color: #92400e;
  line-height: 1.6;
}

.research-citation strong {
  color: #78350f;
}

.research-citation.dark {
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
  border-left-color: #f59e0b;
}

.research-citation.dark strong {
  color: #fbbf24;
}

/* Disclaimer text */
.disclaimer-text {
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.5;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  border: 1px solid #f3f4f6;
}

.disclaimer-text.dark {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #6b7280;
}

/* Research evidence badge (for condition cards) */
.research-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.research-badge svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Footer disclaimer */
.footer-disclaimer {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.6;
  padding: 1rem 0;
  border-top: 1px solid #374151;
  margin-top: 1.5rem;
}

/* ============================
   UI/UX 2025 Modernization
   ============================ */

/* Skip to content (Accessibility) */
.skip-to-content {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: white;
  font-weight: 600;
  border-radius: var(--radius-button);
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 1rem;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animate-on-scroll { opacity: 1; transform: none; transition: none; }
  .service-card, .program-card, .info-card, .review-card, .center-card-v2, .video-card {
    transition: none;
  }
  .service-card:hover, .program-card:hover, .info-card:hover, .review-card:hover,
  .center-card-v2:hover, .video-card:hover {
    transform: none;
  }
  .dropdown { transition: none; }
  .nav-link::after { transition: none; }
  .hero-bg-shape { animation: none; }
  .hero-float { animation: none; }
  #floating-cta { transition: none; }
  /* Phase 2+ reduced motion */
  .bb-wave-path { animation: none; stroke-dashoffset: 0; }
  .bb-wave-dot { animation: none; opacity: 1; }
  .bb-stat-bar { transition: none; }
  .wave-divider::before { animation: none; }
  .bb-ring-circle { transition: none; }
  .section-heading-accent::after { transition: none; width: 60px; }
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Floating CTA Bar */
#floating-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

#floating-cta.visible {
  transform: translateY(0);
}

/* Push scroll-top button up when floating CTA is visible */
#floating-cta.visible ~ #scroll-top,
body:has(#floating-cta.visible) #scroll-top {
  bottom: 5.5rem;
}

/* Mobile accordion nav */
.mobile-accordion button svg {
  transition: transform 0.2s ease;
}

.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-submenu.open {
  max-height: 500px;
}

/* Micro-interactions */
.btn-press:active {
  transform: translateY(1px) !important;
  box-shadow: none !important;
}

.service-card img,
.program-card img {
  transition: transform 0.3s ease;
}

.service-card:hover img {
  transform: scale(1.08);
}

/* Section heading accent */
.section-heading-accent {
  position: relative;
  display: inline-block;
}

.section-heading-accent::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 2px;
  margin: 0.75rem auto 0;
}

/* Wave divider */
.wave-divider {
  position: relative;
  height: 48px;
  overflow: hidden;
  margin-top: -1px;
}

.wave-divider svg {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
}

/* Hero background animation */
.hero-bg-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
  animation: hero-float 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hero-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Hero image float */
.hero-image-float {
  animation: hero-img-float 6s ease-in-out infinite;
}

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

/* How It Works connecting line */
.steps-line {
  position: absolute;
  top: 1.75rem;
  left: 16.67%;
  right: 16.67%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary-100), var(--color-primary), var(--color-primary-100));
}

/* Symptom checker quiz */
.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: var(--transition-default);
  user-select: none;
}

.quiz-option:hover {
  border-color: var(--color-primary-light);
  background: var(--color-primary-bg);
}

.quiz-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.quiz-option .quiz-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-default);
}

.quiz-option.selected .quiz-check {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* Soft gradient section */
.section-gradient-warm {
  background: linear-gradient(180deg, #fff 0%, #fef3c7 50%, #fff 100%);
}

/* Trust badge inline */
.trust-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* Photo strip - hide scrollbar */
.photo-strip {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.photo-strip::-webkit-scrollbar {
  display: none;
}

/* ============================
   Phase 1: Enhanced Animations
   ============================ */

/* Directional scroll reveal variants */
.animate-on-scroll.from-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.from-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-on-scroll.from-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.from-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-on-scroll.zoom-in {
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.28, 0.64, 1);
}
.animate-on-scroll.zoom-in.visible {
  opacity: 1;
  transform: scale(1);
}

.animate-on-scroll.flip-up {
  opacity: 0;
  transform: perspective(600px) rotateX(18deg) translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.animate-on-scroll.flip-up.visible {
  opacity: 1;
  transform: perspective(600px) rotateX(0deg) translateY(0);
}

/* Section heading animated underline */
.section-heading-accent::after {
  width: 0;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}
.section-heading-accent.visible::after,
.animate-on-scroll.visible .section-heading-accent::after,
.text-center.visible .section-heading-accent::after {
  width: 60px;
}

/* Why BalanceBrain card hover with animated left border */
.bb-why-card {
  border-left: 3px solid transparent;
  transition: all 0.3s ease, border-left-color 0.3s ease;
}
.bb-why-card:hover {
  border-left-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(245,158,11,0.12);
}
.bb-why-card .bb-why-icon {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bb-why-card:hover .bb-why-icon {
  transform: translateY(-4px) scale(1.08);
}

/* Service card icon animated on hover */
.service-card .service-icon {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.service-card:hover .service-icon {
  transform: translateY(-6px) scale(1.05);
}

/* Program card image zoom + shimmer */
.program-card .program-img-wrap {
  overflow: hidden;
  position: relative;
}
.program-card .program-img-wrap img {
  transition: transform 0.5s ease;
}
.program-card:hover .program-img-wrap img {
  transform: scale(1.08);
}
.program-card .program-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}
.program-card:hover .program-img-wrap::after {
  opacity: 1;
}

/* Stat progress bar (dark Research section) */
.bb-stat-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.75rem;
}
.bb-stat-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  border-radius: 2px;
  transition: width 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================
   Phase 2: Data Visualization
   ============================ */

/* Circular ring cards */
.bb-ring-card {
  position: relative;
}
.bb-ring-svg {
  transform: rotate(-90deg);
}
.bb-ring-circle {
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.bb-ring-circle.animated {
  /* stroke-dashoffset set by JS */
}

/* Chart containers */
.bb-chart-container {
  position: relative;
  height: 260px;
}

/* Data section badge */
.bb-data-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid #bfdbfe;
}

/* ============================
   Phase 3: Hero EEG + Parallax
   ============================ */

/* EEG wave SVG draw-on animation */
.bb-eeg-path {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: bb-eeg-draw 2.2s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards;
}
.bb-eeg-path-2 {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: bb-eeg-draw 2.4s cubic-bezier(0.22, 1, 0.36, 1) 1s forwards;
}

@keyframes bb-eeg-draw {
  to { stroke-dashoffset: 0; }
}

.bb-eeg-dot {
  opacity: 0;
  animation: bb-dot-pulse 0.5s ease 2.6s forwards;
}

@keyframes bb-dot-pulse {
  0% { opacity: 0; transform: scale(0); }
  70% { opacity: 1; transform: scale(1.4); }
  100% { opacity: 0.8; transform: scale(1); }
}

/* Shimmer on wave dividers */
.wave-shimmer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(245,158,11,0.08) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: bb-shimmer 3.5s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes bb-shimmer {
  0%, 100% { background-position: 200% center; }
  50% { background-position: -200% center; }
}

/* Hero floating stats card pulse */
.hero-stat-card {
  animation: hero-card-float 4s ease-in-out infinite;
}
.hero-stat-card-2 {
  animation: hero-card-float 4s ease-in-out 2s infinite;
}

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