@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Cormorant+Garamond:wght@400;500;600&display=swap');

.layout-wrapper {
  --gold-primary: #D4AF37;
  --gold-light: #F4E4BA;
  --gold-dark: #B8860B;
  --gold-muted: #A08540;
  --black-deep: #0A0A0A;
  --cream: #FAF3E0;
  --content-bg: #0A0A0A;
  --content-text: #faf3e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* ═══ HEADER (Always Dark) ═══ */
.premium-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 70px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  background: var(--theme-bg-header, rgba(10, 10, 10, 0.95));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  transition: all 0.3s ease;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-symbol { width: 45px; height: 45px; }
.logo-symbol img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 8px rgba(212,175,55,0.25)); }

.logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--cream);
  letter-spacing: 1px;
}
.logo-text .highlight { color: var(--gold-primary); }

.header-nav {
  display: flex;
  gap: 24px;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.header-nav a {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(250, 243, 224, 0.6);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.2s;
  text-transform: uppercase;
}
.header-nav a:hover,
.header-nav a.active {
  color: var(--gold-primary);
}

/* ═══ READINGS DROPDOWN ═══ */
.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-dropdown-trigger {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(250, 243, 224, 0.6);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}
.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown:focus-within .nav-dropdown-trigger,
.nav-dropdown-trigger.active { color: var(--gold-primary); }
.nav-dropdown-trigger .caret { font-size: 10px; transition: transform 0.2s; }
.nav-dropdown:hover .nav-dropdown-trigger .caret,
.nav-dropdown:focus-within .nav-dropdown-trigger .caret { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  margin-top: 14px;
  min-width: 210px;
  /* The header is always dark, so keep this menu dark in both themes.
     (In light mode the theme vars flip to white/dark-text, which made the
     cream menu links unreadable on a white panel.) */
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 1001;
}
/* invisible bridge so the menu doesn't close in the gap under the trigger */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -16px; left: 0; right: 0; height: 16px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  padding: 10px 14px;
  border-radius: 8px;
  white-space: nowrap;
  text-transform: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: rgba(250, 243, 224, 0.78);
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ═══ THEME TOGGLE BUTTON ═══ */
.theme-toggle-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(212, 175, 55, 0.5);
  transform: scale(1.08);
}
[data-theme="light"] .theme-toggle-btn {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.3);
}
[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(212, 175, 55, 0.25);
}

/* ═══ HAMBURGER ═══ */
.hamburger-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1002;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold-primary);
  transition: all 0.3s ease;
  border-radius: 2px;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══ MOBILE MENU OVERLAY ═══ */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 70px; left: 0; right: 0; bottom: 0;
  background: #0A0A0A;
  backdrop-filter: blur(16px);
  z-index: 999;
  flex-direction: column;
  padding: 32px 24px;
  gap: 20px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.mobile-menu-overlay.open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.mobile-menu-overlay a,
.mobile-menu-overlay button.mob-profile-btn {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: rgba(250, 243, 224, 0.8);
  text-decoration: none;
  padding: 8px 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}
.mobile-menu-overlay a:hover,
.mobile-menu-overlay a.active {
  color: var(--gold-primary);
}
.mob-group {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.55);
  margin: 16px 0 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.12);
}
.mob-group:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* Mobile profile sub-menu */
.mob-profile-section { display: flex; flex-direction: column; }
.mob-profile-btn { display: flex; align-items: center; gap: 6px; }
.mob-profile-arrow {
  font-size: 10px;
  transition: transform 0.2s;
  color: var(--gold-muted);
}
.mob-profile-arrow.expanded { transform: rotate(180deg); }
.mob-profile-sub {
  display: none;
  flex-direction: column;
  padding-left: 16px;
  gap: 8px;
  margin-top: 8px;
}
.mob-profile-sub.open { display: flex; }
.mob-sub-count {
  font-size: 12px;
  color: rgba(250, 243, 224, 0.4);
  font-family: 'Inter', sans-serif;
}
.mob-sub-link {
  font-size: 14px !important;
  color: rgba(250, 243, 224, 0.7) !important;
}
.mob-sub-logout {
  font-size: 14px !important;
  color: rgba(212, 175, 55, 0.7) !important;
  font-family: 'Inter', sans-serif;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 4px 0;
}

/* ═══ CONTENT AREA (Theme-aware) ═══ */
.consumer-content-area {
  flex: 1;
  background: var(--content-bg);
  color: var(--content-text);
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: calc(100vh - 140px);
  padding-top: 70px; /* account for fixed header */
}

/* ═══ FOOTER (Always Dark) ═══ */
.premium-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--theme-bg-header, rgba(10, 10, 10, 0.95));
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  font-family: 'Inter', sans-serif;
  position: relative;
}
.footer-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.footer-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  color: var(--gold-primary);
  font-weight: 500;
}
.footer-copyright {
  font-size: 10px;
  color: rgba(250, 243, 224, 0.35);
}
.footer-links {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.footer-links a {
  font-size: 10px;
  color: rgba(250, 243, 224, 0.45);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--gold-primary); }
.footer-version {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: rgba(250, 243, 224, 0.15);
}
.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.footer-powered {
  font-size: 10px;
  color: rgba(250, 243, 224, 0.35);
}
.footer-right a {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 600;
}
.footer-thai {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  opacity: 0.35;
  margin-top: 2px;
  color: var(--cream);
}

/* ═══════════════════════════════════════════ */
/* LIGHT MODE - Content Area Overrides         */
/* Header & Footer stay dark (outside scope)   */
/* ═══════════════════════════════════════════ */

[data-theme="light"] .layout-wrapper {
  --content-bg: #f7f4ef;
  --content-text: #2c2417;
}

[data-theme="light"] .consumer-content-area .section-card,
[data-theme="light"] .consumer-content-area .result-section {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(160, 131, 48, 0.15) !important;
  box-shadow: 0 2px 12px rgba(44, 36, 23, 0.06) !important;
}

[data-theme="light"] .consumer-content-area h2,
[data-theme="light"] .consumer-content-area h3,
[data-theme="light"] .consumer-content-area .section-title {
  color: #1e1810 !important;
}

[data-theme="light"] .consumer-content-area p,
[data-theme="light"] .consumer-content-area .section-subtitle {
  color: rgba(44, 36, 23, 0.72) !important;
}

[data-theme="light"] .consumer-content-area .pillar-card {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(160, 131, 48, 0.2) !important;
  box-shadow: 0 2px 8px rgba(44, 36, 23, 0.06) !important;
}

[data-theme="light"] .consumer-content-area .cycle-card {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(160, 131, 48, 0.15) !important;
}
[data-theme="light"] .consumer-content-area .cycle-card.active {
  background: rgba(160, 131, 48, 0.08) !important;
  border-color: rgba(160, 131, 48, 0.4) !important;
}

[data-theme="light"] .consumer-content-area .amulet-card,
[data-theme="light"] .consumer-content-area .the-one-card {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(160, 131, 48, 0.18) !important;
  box-shadow: 0 4px 16px rgba(44, 36, 23, 0.06) !important;
}

[data-theme="light"] .consumer-content-area .forecast-card {
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(160, 131, 48, 0.15) !important;
}

[data-theme="light"] .consumer-content-area .concern-modal-overlay {
  background: rgba(247, 244, 239, 0.92) !important;
}
[data-theme="light"] .consumer-content-area .concern-modal {
  background: #ffffff !important;
  border-color: rgba(160, 131, 48, 0.2) !important;
  box-shadow: 0 8px 40px rgba(44, 36, 23, 0.12) !important;
}
[data-theme="light"] .consumer-content-area .concern-card {
  background: rgba(248, 245, 240, 0.8) !important;
  border-color: rgba(160, 131, 48, 0.12) !important;
}
[data-theme="light"] .consumer-content-area .concern-card:hover {
  background: rgba(160, 131, 48, 0.06) !important;
  border-color: rgba(160, 131, 48, 0.3) !important;
}

[data-theme="light"] .consumer-content-area .wheel-container {
  background: rgba(255, 255, 255, 0.5) !important;
}

[data-theme="light"] .consumer-content-area .profile-card {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(160, 131, 48, 0.18) !important;
}

[data-theme="light"] .consumer-content-area .consultation-section {
  background: rgba(248, 245, 240, 0.85) !important;
  border-color: rgba(160, 131, 48, 0.15) !important;
}

[data-theme="light"] .consumer-content-area .remedy-section {
  background: rgba(255, 255, 255, 0.88) !important;
}

[data-theme="light"] .consumer-content-area .quote-section {
  background: rgba(248, 245, 240, 0.9) !important;
  border-color: rgba(160, 131, 48, 0.15) !important;
}

[data-theme="light"] .consumer-content-area input,
[data-theme="light"] .consumer-content-area select,
[data-theme="light"] .consumer-content-area textarea {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(160, 131, 48, 0.2) !important;
  color: #2c2417 !important;
}

[data-theme="light"] .consumer-content-area .theme-btn,
[data-theme="light"] .consumer-content-area .action-btn {
  background: rgba(160, 131, 48, 0.08) !important;
  border-color: rgba(160, 131, 48, 0.25) !important;
  color: #8b7024 !important;
}
[data-theme="light"] .consumer-content-area .theme-btn:hover,
[data-theme="light"] .consumer-content-area .action-btn:hover {
  background: rgba(160, 131, 48, 0.15) !important;
}

/* Always dark elements */
.loading-overlay { background: var(--theme-bg-primary, #05080c) !important; }
[data-theme="light"] .consumer-content-area .destiny-id-card {
  background: linear-gradient(135deg, #0a0f14, #0c1318) !important;
  color: #faf3e0 !important;
}

/* ═══ RESPONSIVE ═══ */
/* Collapse the desktop nav to the hamburger earlier (≤1024px) so it never cramps. */
@media (max-width: 1024px) {
  .header-nav { display: none; }
  .hamburger-btn { display: flex; }
}
@media (max-width: 768px) {
  .logo-symbol { width: 40px; height: 40px; }
  .logo-text { font-size: 12px; }
  .premium-footer {
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
  }
  .footer-left { text-align: left; }
  .footer-right { text-align: right; }
  .footer-brand { font-size: 11px; }
  .footer-copyright { font-size: 9px; }
  .footer-links { gap: 10px; margin-top: 2px; }
  .footer-links a { font-size: 9px; }
  .footer-powered { font-size: 9px; }
  .footer-right a { font-size: 10px; }
  .footer-thai { font-size: 8px; }
}

/* ═══ SEO LOGIN LINK ═══ */
.seo-login-link {
  padding: 8px 20px;
  background: transparent;
  color: #D4AF37;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}
.seo-login-link:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: #D4AF37;
}
