/* ========================================================
   TỬ VI ĐẨU SỐ TRUNG CHÂU TAM HỢP — DESIGN SYSTEM
   Modern Dark Metaphysical UI & Mobile-First Responsive Framework
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&family=Cinzel:wght@600;700;800;900&display=swap');

:root {
  /* Color Palette - Celestial Imperial Dark */
  --bg-dark: #070B14;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: #0F172A;
  
  /* Metallic Gold & Celestial Accents */
  --gold-primary: #F59E0B;
  --gold-glow: #FBBF24;
  --gold-dark: #B45309;
  --gold-light: #FEF3C7;
  --border-gold: rgba(245, 158, 11, 0.3);
  --border-subtle: rgba(255, 255, 255, 0.08);
  
  /* Mystical Cyan / Blue */
  --cyan-accent: #06B6D4;
  --blue-accent: #3B82F6;
  --purple-accent: #8B5CF6;
  --red-cinnabar: #EF4444;
  
  /* Text */
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  /* Shadows & Glass */
  --glass-blur: blur(16px);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.25);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(245, 158, 11, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(6, 182, 212, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================================
   HEADER & NAVIGATION
   ======================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 20, 0.82);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.brand-text h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #FFF;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  padding: 6px 0;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: #FFF;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold-primary);
  border-radius: 2px;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #000;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  text-decoration: none;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
}

.header-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.45);
}

/* Mobile Toggle Button */
.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px;
  cursor: pointer;
  font-size: 1.4rem;
}

/* Mobile Nav Drawer */
.mobile-nav {
  display: none;
  background: rgba(11, 17, 30, 0.98);
  border-bottom: 1px solid var(--border-gold);
  padding: 16px 20px 24px 20px;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 12px 0;
  color: var(--text-main);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav a:last-child {
  border-bottom: none;
  margin-top: 10px;
}

/* ========================================================
   HERO SECTION
   ======================================================== */
.hero-section {
  padding: 60px 0 40px 0;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--border-gold);
  color: var(--gold-glow);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.25;
  color: #FFF;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.hero-title .highlight {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 50%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 680px;
  margin: 0 auto 36px auto;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 50px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.stat-item b {
  color: var(--gold-primary);
  font-size: 1.1rem;
}

/* ========================================================
   FORM SECTION — LẬP LÁ SỐ TRỰC TUYẾN
   ======================================================== */
.form-wrapper {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.form-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.form-header {
  text-align: center;
  margin-bottom: 28px;
}

.form-header h2 {
  font-size: 1.5rem;
  color: #FFF;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Form Tabs & Switchers */
.calendar-switch {
  display: flex;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.calendar-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.calendar-tab.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.1));
  color: var(--gold-glow);
  border: 1px solid var(--border-gold);
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #CBD5E1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFF;
  padding: 13px 16px;
  font-size: 1rem;
  font-family: inherit;
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

/* Date Selector Grid */
.date-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr;
  gap: 10px;
}

/* Gender Toggle Buttons */
.gender-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gender-btn {
  padding: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.gender-btn.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--blue-accent);
  color: #93C5FD;
}

.gender-btn.female.active {
  background: rgba(236, 72, 153, 0.18);
  border-color: #EC4899;
  color: #F472B6;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #000;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
  transition: var(--transition);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.5);
}

.btn-submit:active {
  transform: translateY(0);
}

/* ========================================================
   FEATURED CHARTS (KHO LÁ SỐ MẪU)
   ======================================================== */
.section-featured {
  padding: 80px 0;
}

.section-head {
  text-align: center;
  margin-bottom: 40px;
}

.section-head h2 {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: #FFF;
  margin-bottom: 10px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 600px;
  margin: 0 auto;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chart-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-card), 0 0 20px rgba(245, 158, 11, 0.15);
}

.chart-card-badge {
  display: inline-block;
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan-accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.chart-card h3 {
  font-size: 1.25rem;
  color: #FFF;
  margin-bottom: 8px;
}

.chart-card-meta {
  font-size: 0.85rem;
  color: var(--gold-glow);
  margin-bottom: 14px;
  font-weight: 600;
}

.chart-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.chart-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFF;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
}

.chart-card-btn:hover {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-primary);
}

/* ========================================================
   FOUR PILLARS OF METAPHYSICS
   ======================================================== */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: left;
  transition: var(--transition);
}

.pillar-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.pillar-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.pillar-card h3 {
  font-size: 1.15rem;
  color: #FFF;
  margin-bottom: 8px;
}

.pillar-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========================================================
   MODAL LOADING OVERLAY
   ======================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 11, 20, 0.9);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--shadow-glow);
}

.spinner-ring {
  width: 64px;
  height: 64px;
  border: 4px solid rgba(245, 158, 11, 0.15);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-step {
  font-size: 0.92rem;
  color: var(--gold-glow);
  font-weight: 600;
  margin-top: 12px;
}

/* ========================================================
   FOOTER
   ======================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: #05080E;
  padding: 60px 0 30px 0;
  margin-top: 100px;
}

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

.footer-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: 14px;
  max-width: 440px;
}

.footer-col h4 {
  color: #FFF;
  font-size: 0.95rem;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--gold-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 12px;
}

/* ========================================================
   MOBILE RESPONSIVE (BREAKPOINTS)
   ======================================================== */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.3rem;
  }
  .form-wrapper {
    padding: 30px 24px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .nav-links, .header-cta {
    display: none;
  }
  .mobile-toggle {
    display: block;
  }
  .hero-title {
    font-size: 1.95rem;
  }
  .hero-desc {
    font-size: 0.95rem;
  }
  .stats-bar {
    gap: 16px;
  }
  .stat-item {
    font-size: 0.82rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .date-selector-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }
  .date-selector-grid select {
    padding: 12px 8px;
    font-size: 0.9rem;
  }
  .section-head h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  .hero-title {
    font-size: 1.65rem;
  }
  .form-wrapper {
    padding: 24px 16px;
  }
  .calendar-switch {
    width: 100%;
  }
  .gender-btn {
    padding: 10px;
    font-size: 0.85rem;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
