/* ============================================================
   HHpoker全联盟俱乐部 - Main Stylesheet
   Primary: indigo-600 (#4f46e5)
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;
  --brand-950: #1e1b4b;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 30px rgba(79, 70, 229, 0.4);
}

/* ---------- Smooth Scroll ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

/* ---------- Selection ---------- */
::selection {
  background-color: var(--brand-600);
  color: #fff;
}

/* ============================================================
   NAVBAR
   ============================================================ */

/* Transparent by default (hero position) */
#navbar {
  background-color: transparent;
}

/* Scrolled state via JS (.scrolled class) */
#navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
}

#navbar.scrolled .logo-text {
  color: var(--brand-700);
}

#navbar.scrolled .nav-link {
  color: rgba(55, 65, 81, 0.85); /* gray-700 at 85% */
}

#navbar.scrolled .nav-link:hover {
  color: var(--brand-600);
}

#navbar.scrolled #menu-toggle {
  color: var(--brand-700);
}

/* ============================================================
   MOBILE OVERLAY MENU
   ============================================================ */

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background-color: rgba(49, 46, 129, 0.97); /* brand-900 at 97% */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-overlay-content {
  text-align: center;
  padding: 2rem;
}

.mobile-nav-link {
  display: block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.mobile-overlay.active .mobile-nav-link {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation delays for mobile nav links */
.mobile-overlay.active .mobile-nav-link:nth-child(1) { transition-delay: 0.05s; }
.mobile-overlay.active .mobile-nav-link:nth-child(2) { transition-delay: 0.10s; }
.mobile-overlay.active .mobile-nav-link:nth-child(3) { transition-delay: 0.15s; }
.mobile-overlay.active .mobile-nav-link:nth-child(4) { transition-delay: 0.20s; }
.mobile-overlay.active .mobile-nav-link:nth-child(5) { transition-delay: 0.25s; }
.mobile-overlay.active .mobile-nav-link:nth-child(6) { transition-delay: 0.30s; }

/* Prevent body scroll when overlay is open */
body.no-scroll {
  overflow: hidden;
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.hero-section {
  background: linear-gradient(135deg, #312e81 0%, #4338ca 30%, #4f46e5 60%, #6366f1 100%);
  position: relative;
}

/* Subtle animated gradient overlay */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(99, 102, 241, 0.3) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 20%, rgba(129, 140, 248, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */

/* Primary button in hero */
.btn-primary {
  background: #ffffff;
  color: var(--brand-700);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 10px -6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
}

/* Outline button in hero */
.btn-outline {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ============================================================
   GLOW/PULSE BUTTON (CTA Section)
   ============================================================ */

.btn-glow {
  position: relative;
  z-index: 1;
}

/* Pulsing glow ring */
.btn-glow::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600), var(--brand-400));
  z-index: -1;
  opacity: 0;
  filter: blur(12px);
  animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.04);
  }
}

/* ============================================================
   FEATURE CARDS
   ============================================================ */

.feature-card {
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.feature-card:hover {
  transform: translateY(-12px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--brand-200);
}

.feature-icon-wrapper {
  transition: background-color var(--transition-base), transform var(--transition-base);
}

.feature-card:hover .feature-icon-wrapper {
  transform: scale(1.1);
}

/* ============================================================
   STATS SECTION
   ============================================================ */

.stats-section {
  background: linear-gradient(135deg, #312e81 0%, #4338ca 40%, #4f46e5 100%);
  position: relative;
}

.stats-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='1.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.stat-card {
  transition: transform var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-6px);
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
}

.stat-number {
  display: inline;
  font-variant-numeric: tabular-nums;
}

.stat-suffix {
  display: inline;
  margin-left: 2px;
}

/* ============================================================
   TESTIMONIAL CARDS
   ============================================================ */

.testimonial-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

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

.faq-item {
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.faq-item:hover {
  background-color: #f3f4f6; /* gray-100 */
}

.faq-toggle {
  cursor: pointer;
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-body {
  max-height: 20rem;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  background-color: var(--brand-600);
}

.faq-item.active .faq-icon i {
  color: #ffffff;
}

/* ============================================================
   CTA SECTION
   ============================================================ */

.cta-section {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%);
  position: relative;
}

.cta-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-in-up.delay-200 {
  animation-delay: 0.2s;
}

.fade-in-up.delay-400 {
  animation-delay: 0.4s;
}

.fade-in-up.delay-600 {
  animation-delay: 0.6s;
}

/* Reveal on scroll via IntersectionObserver JS */
.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Float animation for decorative elements */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}

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

/* ============================================================
   COUNTER ANIMATION (JS-driven)
   ============================================================ */

.counter-animated {
  transition: none; /* Counting is handled by JS */
}

/* ============================================================
   ACTIVE NAV LINK HIGHLIGHT
   ============================================================ */

#navbar.scrolled .nav-link.active {
  color: var(--brand-600);
  font-weight: 600;
}

/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */

@media (max-width: 1023px) {
  /* Hero text alignment */
  .hero-section {
    text-align: center;
  }

  /* Reduce stat card padding */
  .stat-card {
    padding: 1.25rem;
  }

  .stat-number {
    font-size: 2rem;
  }
}

@media (max-width: 767px) {
  /* Smaller hero heading */
  .hero-section h1 {
    font-size: 1.75rem;
    line-height: 1.3;
  }

  /* Stack feature cards with full width */
  .feature-card {
    padding: 1.5rem;
    border-radius: 1.25rem;
  }

  .feature-card:hover {
    transform: translateY(-6px);
  }

  /* Testimonial card adjustments */
  .testimonial-card {
    padding: 1.25rem;
  }

  /* CTA heading size */
  .cta-section h2 {
    font-size: 1.5rem;
  }

  /* FAQ button text */
  .faq-toggle span:first-child {
    font-size: 0.9rem;
  }

  /* Footer columns stacking */
  footer .grid > div {
    margin-bottom: 1.5rem;
  }

  /* Reduce section padding */
  section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  /* Navbar height */
  #navbar nav > div {
    height: 3.5rem;
  }
}

@media (max-width: 639px) {
  /* Two-column stats on mobile */
  #stats .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  /* Hero buttons full width */
  .hero-section .flex.flex-col {
    width: 100%;
  }

  .hero-section .flex.flex-col a {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
  #navbar,
  .mobile-overlay,
  .btn-glow::after {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }
}
