/*
 * Premium dark global theme overrides
 * Applies homepage-grade styling across all pages.
 */

:root {
  --premium-bg: #0b1220;
  --premium-surface: #0f172a;
  --premium-surface-2: #111827;
  --premium-surface-3: #1e293b;
  --premium-border: rgba(148, 163, 184, 0.2);
  --premium-border-strong: rgba(148, 163, 184, 0.35);
  --premium-text: #eeeaea;
  --premium-text-muted: #94a3b8;
  --premium-text-faint: #64748b;
  --premium-gold: #f4b942;
  --premium-gold-dark: #d39e00;

  /* Enterprise palette overrides */
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: var(--premium-gold);
  --accent-light: #f8d26b;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #60a5fa;
  --gray-50: #0b1220;
  --gray-100: #0f172a;
  --gray-200: #111827;
  --gray-300: #1f2937;
  --gray-400: #334155;
  --gray-500: #475569;
  --gray-600: #94a3b8;
  --gray-700: #cbd5e1;
  --gray-800: #e2e8f0;
  --gray-900: #f8fafc;

  /* Main theme token overrides */
  --color-background: var(--premium-bg);
  --color-surface: var(--premium-surface);
  --color-surface-stronger: var(--premium-surface-2);
  --color-surface-hover: var(--premium-surface-3);
  --color-border: var(--premium-border);
  --color-border-light: var(--premium-border-strong);
  --color-text-primary: var(--premium-text);
  --color-text-secondary: var(--premium-text-muted);
  --color-text-muted: var(--premium-text-faint);
  --color-accent: var(--premium-gold);
  --color-accent-light: #f8d26b;
  --color-accent-dark: var(--premium-gold-dark);
  --color-accent-glow: rgba(244, 185, 66, 0.35);
  --color-primary: #0f172a;
  --color-primary-light: #1e293b;
  --color-primary-dark: #f8fafc;
  --color-highlight: var(--premium-gold);
  --color-highlight-subtle: rgba(244, 185, 66, 0.2);

  /* Typography */
  --font-primary: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Merriweather', 'Georgia', serif;
}

body {
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
}

h1, h2, h3, h4, h5, h6 {
  color: #f8fafc;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

p {
  color: var(--color-text-secondary);
}

a {
  color: var(--color-accent);
}

a:hover {
  color: var(--color-accent-light);
}

/* Header + navigation */
.site-header {
  position: relative;
  z-index: var(--z-sticky);
  background: transparent;
}

.navbar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
  border-bottom: 1px solid rgba(244, 185, 66, 0.25) !important;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.6) !important;
}

.navbar::after {
  height: 2px;
  background: linear-gradient(to right, transparent 0%, var(--premium-gold) 50%, transparent 100%);
  box-shadow: 0 0 10px rgba(244, 185, 66, 0.5);
}

.logo {
  color: #f8fafc !important;
}

.logo:hover {
  color: var(--premium-gold) !important;
}

.logo-beta {
  background: linear-gradient(135deg, var(--premium-gold) 0%, var(--premium-gold-dark) 100%) !important;
  color: #0f172a !important;
}

.nav-link {
  color: rgba(248, 250, 252, 0.85) !important;
}

.nav-link:hover {
  color: var(--premium-gold) !important;
  background: rgba(244, 185, 66, 0.12);
}

.nav-link[aria-current="page"] {
  color: var(--premium-gold) !important;
  background: rgba(244, 185, 66, 0.2);
}

@media (min-width: 769px) {
  .navbar-nav {
    gap: clamp(0.45rem, 0.8vw, 1.05rem);
    row-gap: 0.6rem;
  }

  .nav-link {
    font-size: clamp(0.95rem, 0.7vw + 0.45rem, 1.1rem);
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.01em;
    padding: clamp(0.55rem, 0.7vw, 0.7rem) clamp(0.8rem, 0.9vw, 1rem);
    white-space: nowrap;
  }

  .nav-icon {
    font-size: clamp(1.1rem, 0.9vw, 1.3rem);
    line-height: 1;
  }

  .nav-item {
    font-size: clamp(0.9rem, 0.7vw, 1rem);
  }

  .usage-badge {
    font-size: clamp(0.8rem, 0.6vw, 0.9rem);
    padding: clamp(0.45rem, 0.6vw, 0.6rem) clamp(0.85rem, 0.9vw, 1.1rem);
  }

  .usage-text {
    font-size: clamp(0.8rem, 0.6vw, 0.9rem);
    font-weight: 600;
  }

  .usage-bar {
    width: clamp(120px, 12vw, 170px);
  }

  .badge-pro {
    font-size: clamp(0.75rem, 0.55vw, 0.85rem);
    letter-spacing: 0.05em;
  }

  .dropdown-toggle {
    font-size: clamp(0.9rem, 0.65vw, 1rem);
  }
}

.navbar-toggle span {
  background: #f8fafc !important;
}

.navbar-toggle:hover span {
  background: var(--premium-gold) !important;
}

.usage-badge {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(244, 185, 66, 0.35) !important;
}

.usage-text {
  color: #e2e8f0 !important;
}

.badge-pro {
  background: linear-gradient(135deg, var(--premium-gold) 0%, var(--premium-gold-dark) 100%) !important;
  color: #0f172a !important;
}

.dropdown-toggle {
  background: rgba(15, 23, 42, 0.5) !important;
  border: 1px solid rgba(244, 185, 66, 0.25) !important;
  color: #e2e8f0 !important;
}

.dropdown-toggle:hover {
  background: rgba(244, 185, 66, 0.15) !important;
  border-color: var(--premium-gold) !important;
}

.dropdown-menu {
  background: #0f172a !important;
  border: 1px solid var(--premium-border) !important;
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.6);
  min-width: min(280px, 92vw);
  max-width: min(360px, 94vw);
}

.dropdown-header {
  border-bottom: 1px solid var(--premium-border) !important;
}

.dropdown-divider {
  border-color: var(--premium-border) !important;
}

.dropdown-item {
  color: #e2e8f0 !important;
  font-size: clamp(0.95rem, 0.7vw + 0.5rem, 1.05rem);
  padding: clamp(0.7rem, 0.9vw, 0.95rem) clamp(1rem, 1.1vw, 1.25rem);
  gap: clamp(0.55rem, 0.7vw, 0.8rem);
  white-space: normal;
}

.dropdown-item .item-icon {
  font-size: clamp(1.2rem, 1vw, 1.5rem);
  min-width: clamp(1.6rem, 2vw, 2rem);
}

.dropdown-item:hover {
  background: rgba(244, 185, 66, 0.15) !important;
  color: #f8fafc !important;
}

/* Quick tools bar */
.quick-tools-bar {
  background: linear-gradient(135deg, #0b1220 0%, #1e293b 100%) !important;
  border-bottom: 1px solid rgba(244, 185, 66, 0.2) !important;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.5) !important;
}

.quick-tool {
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  border: 1px solid var(--premium-border);
}

.quick-tool:hover {
  background: rgba(244, 185, 66, 0.2);
  color: #f8fafc;
}

/* Alerts */
.alert-success,
.alert-danger,
.alert-error,
.alert-warning,
.alert-info {
  color: #e2e8f0;
}

.alert-success {
  background: rgba(34, 197, 94, 0.15);
  border-left-color: #22c55e;
}

.alert-danger,
.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border-left-color: #ef4444;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.15);
  border-left-color: #f59e0b;
}

.alert-info {
  background: rgba(96, 165, 250, 0.15);
  border-left-color: #60a5fa;
}

/* Toasts */
.toast {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: 1px solid var(--premium-border) !important;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.6) !important;
}

/* Cookie consent */
.cookie-consent {
  background: #0f172a !important;
  border: 1px solid var(--premium-border) !important;
  color: #e2e8f0;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.6);
}

.cookie-actions button {
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  border: 1px solid var(--premium-border);
}

.cookie-actions button:hover {
  background: rgba(244, 185, 66, 0.15);
  border-color: var(--premium-gold);
}

.cookie-actions button.accept {
  background: var(--premium-gold);
  color: #0f172a;
  border-color: var(--premium-gold);
}

.btn-link {
  color: var(--premium-gold);
}

/* Footer */
.footer {
  background: #0b1220 !important;
  color: #e2e8f0;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.footer a {
  color: rgba(226, 232, 240, 0.8);
}

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

/* Profile pages autoscale */
.profile-page .container {
  width: min(1400px, 94vw);
  margin: 0 auto;
}

.profile-page .dashboard-container {
  width: min(1400px, 94vw);
  margin: 0 auto;
}

/* Pricing page readability */
#pricing-page .pricing-hero {
  background: radial-gradient(circle at top, rgba(244, 185, 66, 0.12), transparent 55%),
    linear-gradient(135deg, #0b1220 0%, #111827 55%, #1e293b 100%) !important;
}

#pricing-page .pricing-hero h1 {
  color: #f8fafc !important;
  text-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
}

#pricing-page .pricing-hero p {
  color: #cbd5e1 !important;
}

#pricing-page .pricing-toggle span {
  color: #cbd5e1 !important;
}

#pricing-page:not(.is-yearly) #monthly-label,
#pricing-page.is-yearly #yearly-label {
  color: #f8fafc !important;
  font-weight: 600 !important;
}

#pricing-page.is-yearly #monthly-label,
#pricing-page:not(.is-yearly) #yearly-label {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

#pricing-page .savings-badge {
  background: linear-gradient(135deg, var(--premium-gold) 0%, var(--premium-gold-dark) 100%) !important;
  color: #000000 !important;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid rgba(244, 185, 66, 0.6);
  box-shadow: 0 8px 18px rgba(244, 185, 66, 0.35);
}

#pricing-page .pricing-toggle .savings-badge,
#pricing-page #yearly-label .savings-badge {
  color: #000000 !important;
  text-shadow: none !important;
  filter: none !important;
  mix-blend-mode: normal;
}

#pricing-page #billing-toggle {
  background: rgba(148, 163, 184, 0.2) !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

#pricing-page #billing-toggle.active {
  background: linear-gradient(135deg, var(--premium-gold) 0%, var(--premium-gold-dark) 100%) !important;
}

#pricing-page #billing-toggle .toggle-slider {
  background: #f8fafc !important;
  box-shadow: 0 4px 10px rgba(2, 6, 23, 0.4);
}

#pricing-page .pricing-card,
#pricing-page .pricing-card[style] {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(11, 18, 32, 0.98) 100%) !important;
  background-color: #0f172a !important;
  border: 1px solid rgba(244, 185, 66, 0.35) !important;
  box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.18) inset,
    0 18px 40px rgba(2, 6, 23, 0.6) !important;
}

#pricing-page .pricing-card .pricing-tier,
#pricing-page .pricing-card .pricing-tier[style] {
  color: #f8fafc !important;
  text-shadow: 0 6px 18px rgba(2, 6, 23, 0.55);
}

#pricing-page .pricing-card .pricing-price {
  color: var(--premium-gold) !important;
  text-shadow: 0 8px 20px rgba(244, 185, 66, 0.25);
}

#pricing-page .pricing-card .pricing-price small {
  color: #94a3b8 !important;
}

#pricing-page .pricing-card .btn {
  border-color: rgba(244, 185, 66, 0.6) !important;
}

#pricing-page .pricing-card .btn-primary {
  background: var(--premium-gold) !important;
  color: #000000 !important;
  border-color: var(--premium-gold) !important;
}

#pricing-page .pricing-card .btn-primary:hover:not(:disabled) {
  background: var(--premium-gold-dark) !important;
  border-color: var(--premium-gold-dark) !important;
}

#pricing-page .pricing-card .btn-outline {
  background: transparent !important;
  color: #f8fafc !important;
  border-color: rgba(244, 185, 66, 0.7) !important;
}

#pricing-page .pricing-card .btn-outline:hover:not(:disabled) {
  background: rgba(244, 185, 66, 0.18) !important;
  color: #f8fafc !important;
  border-color: var(--premium-gold) !important;
}

#pricing-page .pricing-card.featured {
  border-color: rgba(244, 185, 66, 0.9) !important;
  box-shadow: 0 20px 50px rgba(244, 185, 66, 0.2) !important;
}

#pricing-page .pricing-tier,
#pricing-page .pricing-price,
#pricing-page .pricing-price small,
#pricing-page .pricing-period {
  color: #f8fafc !important;
}

#pricing-page .pricing-price small,
#pricing-page .pricing-period {
  color: #94a3b8 !important;
}

#pricing-page .pricing-features li {
  border-bottom-color: rgba(148, 163, 184, 0.2) !important;
  color: #cbd5e1 !important;
}

#pricing-page .pricing-features li strong {
  color: #f8fafc !important;
}

#pricing-page .feature-icon.check {
  color: #34d399 !important;
}

#pricing-page .feature-icon.cross {
  color: #64748b !important;
}

#pricing-page .pricing-badge {
  background: linear-gradient(135deg, var(--premium-gold) 0%, var(--premium-gold-dark) 100%) !important;
  color: #0f172a !important;
  box-shadow: 0 8px 20px rgba(244, 185, 66, 0.35) !important;
}

#pricing-page .pricing-card .btn-outline {
  color: #e2e8f0 !important;
  border-color: rgba(244, 185, 66, 0.55) !important;
}

#pricing-page .pricing-card .btn-outline:hover:not(:disabled) {
  background: rgba(244, 185, 66, 0.15) !important;
  border-color: var(--premium-gold) !important;
  color: #f8fafc !important;
}

/* Comparison table */
#pricing-page .pricing-comparison {
  background: #0b1220 !important;
}

#pricing-page .pricing-comparison h2 {
  color: #f8fafc !important;
}

#pricing-page .pricing-comparison p {
  color: #94a3b8 !important;
}

#pricing-page .pricing-comparison-table {
  background: #0f172a !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.6) !important;
}

#pricing-page .pricing-comparison table th {
  background: rgba(15, 23, 42, 0.95) !important;
  color: #e2e8f0 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3) !important;
}

#pricing-page .pricing-comparison table th:nth-child(3) {
  color: var(--premium-gold) !important;
  background: rgba(244, 185, 66, 0.12) !important;
}

#pricing-page .pricing-comparison table th:nth-child(4) {
  color: #93c5fd !important;
  background: rgba(96, 165, 250, 0.1) !important;
}

#pricing-page .pricing-comparison table td {
  background: transparent !important;
  color: #cbd5e1 !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
}

#pricing-page .pricing-comparison table td strong {
  color: #f8fafc !important;
}

#pricing-page .pricing-comparison table td[colspan] {
  background: rgba(15, 23, 42, 0.75) !important;
  color: #f8fafc !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3) !important;
}

#pricing-page .pricing-comparison table td:nth-child(3) {
  background: rgba(244, 185, 66, 0.08) !important;
}

#pricing-page .pricing-comparison table td:nth-child(4) {
  background: rgba(96, 165, 250, 0.06) !important;
}

#pricing-page .pricing-comparison .container {
  max-width: min(1200px, 94vw);
  padding-left: clamp(1rem, 2vw, 2rem);
  padding-right: clamp(1rem, 2vw, 2rem);
}

#pricing-page .pricing-comparison-table {
  max-width: min(1200px, 94vw);
  margin: 0 auto;
}

#pricing-page .pricing-comparison table {
  width: 100% !important;
}

#pricing-page .pricing-comparison table th,
#pricing-page .pricing-comparison table td {
  padding: clamp(0.85rem, 1vw, 1.25rem) !important;
}

/* Trust badges */
#pricing-page .pricing-trust {
  background: radial-gradient(circle at top, rgba(244, 185, 66, 0.12), transparent 55%),
    linear-gradient(135deg, #0b1220 0%, #111827 55%, #1e293b 100%) !important;
}

#pricing-page .pricing-trust-title {
  color: #e2e8f0 !important;
  letter-spacing: 0.02em;
}

#pricing-page .pricing-trust .trust-badges {
  gap: 1.5rem;
}

#pricing-page .pricing-trust .trust-badge {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  color: #cbd5e1;
  min-width: 150px;
}

#pricing-page .pricing-trust .trust-badge strong {
  color: #f8fafc;
}

#pricing-page .pricing-trust .trust-badge-icon {
  color: var(--premium-gold);
  text-shadow: 0 6px 18px rgba(244, 185, 66, 0.35);
}

#pricing-page .pricing-trust-note {
  color: #94a3b8 !important;
}

/* FAQ */
#pricing-page .faq-item {
  border-bottom-color: rgba(148, 163, 184, 0.25) !important;
}

#pricing-page .faq-question {
  color: #f8fafc !important;
}

#pricing-page .faq-answer {
  color: #94a3b8 !important;
}

/* CTA */
#pricing-page .pricing-cta {
  background: linear-gradient(135deg, #0b1220 0%, #111827 55%, #1f2937 100%) !important;
  border-top: 1px solid rgba(244, 185, 66, 0.25);
}

#pricing-page .pricing-cta h2 {
  color: #f8fafc !important;
}

#pricing-page .pricing-cta p {
  color: #cbd5e1 !important;
}

#pricing-page .pricing-cta .btn {
  border-color: rgba(244, 185, 66, 0.55) !important;
}

#pricing-page .pricing-cta .btn.monthly-btn,
#pricing-page .pricing-cta .btn.yearly-btn {
  background: transparent !important;
  color: #f8fafc !important;
  border-color: rgba(244, 185, 66, 0.55) !important;
}

#pricing-page .pricing-cta .btn.monthly-btn:hover,
#pricing-page .pricing-cta .btn.yearly-btn:hover {
  background: rgba(244, 185, 66, 0.15) !important;
}

#pricing-page .pricing-cta .btn:not(.monthly-btn):not(.yearly-btn) {
  background: var(--premium-gold) !important;
  color: #0f172a !important;
  border-color: var(--premium-gold) !important;
}

#pricing-page .pricing-cta .btn:not(.monthly-btn):not(.yearly-btn):hover {
  background: var(--premium-gold-dark) !important;
  border-color: var(--premium-gold-dark) !important;
}

/* Upgrade required (org gating) */
.upgrade-hero {
  background: linear-gradient(135deg, #0b1220 0%, #1e293b 100%) !important;
  border-bottom: 1px solid rgba(244, 185, 66, 0.25);
}

.upgrade-hero h1 {
  color: #f8fafc;
  text-shadow: 0 12px 30px rgba(2, 6, 23, 0.6);
}

.upgrade-hero p {
  color: #cbd5e1;
}

.feature-locked {
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(244, 185, 66, 0.45) !important;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.6);
}

.feature-locked h2 {
  color: #f8fafc !important;
}

.feature-locked p {
  color: #cbd5e1 !important;
}

.tier-comparison {
  gap: 1.5rem;
}

.tier-card {
  background: #0f172a !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.6) !important;
}

.tier-card.current {
  opacity: 1 !important;
}

.tier-card.recommended {
  transform: none !important;
  border-color: rgba(244, 185, 66, 0.85) !important;
  box-shadow: 0 20px 50px rgba(244, 185, 66, 0.25) !important;
}

.tier-card h3 {
  color: #f8fafc !important;
}

.tier-card .price {
  color: var(--premium-gold) !important;
}

.tier-card .price small {
  color: #94a3b8 !important;
}

.tier-card li {
  color: #cbd5e1 !important;
}

.tier-card li::before {
  color: #34d399 !important;
}

.btn-upgrade {
  background: var(--premium-gold) !important;
  color: #0f172a !important;
  border: 1px solid var(--premium-gold) !important;
}

.btn-upgrade:hover {
  background: var(--premium-gold-dark) !important;
  border-color: var(--premium-gold-dark) !important;
}

.upgrade-hero ~ .section .btn-secondary {
  background: transparent !important;
  color: #e2e8f0 !important;
  border-color: rgba(244, 185, 66, 0.6) !important;
}

.upgrade-hero ~ .section .btn-secondary:hover {
  background: rgba(244, 185, 66, 0.15) !important;
  color: #f8fafc !important;
}
