/* ==========================================================================
   OCTAVE GLOBAL THEME & NAVIGATION SYSTEM (LIGHT / DARK / MOBILE)
   ========================================================================== */

/* 1. CSS VARIABLES FOR LIGHT & DARK MODES */
:root {
  /* Light Mode (Default) */
  --theme-bg: #f8fafd;
  --theme-bg-subtle: #f0f4f9;
  --theme-surface: #ffffff;
  --theme-surface-raised: #ffffff;
  --theme-text: #0f172a;
  --theme-text-muted: #475569;
  --theme-border: #e2e8f0;
  --theme-border-glow: rgba(2, 132, 199, 0.25);
  
  --theme-primary: #0284c7;
  --theme-primary-hover: #0369a1;
  --theme-accent: #2563eb;
  --theme-cyan: #00f0ff;
  --theme-green: #10b981;
  
  --theme-header-bg: rgba(255, 255, 255, 0.94);
  --theme-card-bg: #ffffff;
  --theme-card-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  --theme-footer-bg: #0f172a;
  --theme-footer-text: #94a3b8;
}

html {
  background-color: var(--theme-bg);
}
body {
  background-color: transparent !important;
}

/* Dark Mode Overrides */
html[data-theme="dark"] {
  background-color: var(--theme-bg) !important;
}
html[data-theme="dark"], body.dark-mode {
  --theme-bg: #090e17;
  --theme-bg-subtle: #0f172a;
  --theme-surface: rgba(15, 23, 42, 0.85);
  --theme-surface-raised: #1e293b;
  --theme-text: #f8fafc;
  --theme-text-muted: #94a3b8;
  --theme-border: rgba(56, 189, 248, 0.18);
  --theme-border-glow: rgba(0, 240, 255, 0.35);
  
  --theme-primary: #38bdf8;
  --theme-primary-hover: #0ea5e9;
  --theme-accent: #3b82f6;
  --theme-cyan: #00f0ff;
  --theme-green: #22c55e;
  
  --theme-header-bg: rgba(9, 14, 23, 0.94);
  --theme-card-bg: rgba(15, 23, 42, 0.82);
  --theme-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --theme-footer-bg: #040812;
  --theme-footer-text: #64748b;
}

/* Global Body & Card Bindings in Dark Mode */
html[data-theme="dark"] body {
  background-color: transparent !important;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] header,
html[data-theme="dark"] .site-header {
  background: var(--theme-header-bg) !important;
  border-bottom-color: var(--theme-border) !important;
}

html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .section-card,
html[data-theme="dark"] .trust-item,
html[data-theme="dark"] .trust-box,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .step-box,
html[data-theme="dark"] .how-it-works,
html[data-theme="dark"] .ecosystem-section,
html[data-theme="dark"] .ecosystem-ribbon {
  background-color: var(--theme-card-bg) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
  box-shadow: var(--theme-card-shadow) !important;
}

html[data-theme="dark"] h1, 
html[data-theme="dark"] h2, 
html[data-theme="dark"] h3, 
html[data-theme="dark"] h4,
html[data-theme="dark"] strong {
  color: #ffffff !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] span:not(.pill):not(.tech-pill):not(.badge),
html[data-theme="dark"] li {
  color: var(--theme-text-muted);
}

html[data-theme="dark"] .nav-link {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-link.active {
  color: var(--theme-cyan) !important;
  background: rgba(0, 240, 255, 0.12) !important;
}

/* 2. UNIFIED PROFESSIONAL HEADER & NAVBAR */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: var(--theme-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--theme-border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-area {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-logo {
  font-family: 'Orbitron', 'Assistant', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--theme-text);
  line-height: 1.1;
  transition: color 0.2s;
}
.brand-tagline {
  font-size: 11px;
  font-weight: 700;
  color: var(--theme-primary);
  letter-spacing: 0.3px;
}

/* Desktop Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--theme-text);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.nav-link:hover {
  background: rgba(2, 132, 199, 0.08);
  color: var(--theme-primary);
}
.nav-link.active {
  background: rgba(2, 132, 199, 0.12);
  color: var(--theme-primary);
  font-weight: 700;
}

/* Header Controls: Theme Toggle & Mobile Hamburger */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--theme-surface-raised, rgba(2, 132, 199, 0.08));
  border: 1px solid var(--theme-border);
  color: var(--theme-text);
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  user-select: none;
}
.theme-toggle-btn:hover {
  border-color: var(--theme-primary);
  transform: translateY(-1px);
}
.theme-toggle-icon {
  font-size: 15px;
  line-height: 1;
}

/* Mobile Hamburger Button */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--theme-text);
}
.mobile-menu-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
}

/* Mobile Drawer */
@media (max-width: 992px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .nav-menu {
    position: fixed;
    top: 60px;
    right: 0;
    width: 280px;
    height: calc(100vh - 60px);
    background: var(--theme-header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--theme-border);
    flex-direction: column;
    align-items: stretch;
    padding: 20px 16px;
    gap: 8px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.25);
    z-index: 999;
    overflow-y: auto;
  }
  .nav-menu.open {
    transform: translateX(0);
  }
  .nav-link {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 8px;
    width: 100%;
  }
  .header-actions .btn-primary {
    display: none; /* Keep header clean on small phones */
  }
}

/* Mobile Navigation Backdrop */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 998;
}
.nav-backdrop.active {
  display: block;
}

/* ==========================================================================
   GLOBAL VOICE AGENT (JARVIS 4.0) MODAL & FLOATING BUTTON
   ========================================================================== */
.voice-agent-fab {
  position: fixed !important;
  bottom: 20px !important;
  right: 86px !important;
  left: auto !important;
  top: auto !important;
  width: 54px !important;
  height: 54px !important;
  z-index: 9999;
  background: linear-gradient(135deg, #00f0ff 0%, #0090d0 100%) !important;
  color: #040711 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: 50% !important;
  padding: 0 !important;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.45);
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  user-select: none;
  text-decoration: none;
}
.voice-agent-fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.7);
}
.voice-agent-fab svg {
  width: 24px;
  height: 24px;
  stroke: #040711;
  fill: none;
  display: block;
}
.voice-agent-fab .fab-text {
  display: none !important;
}

.voice-agent-popup {
  position: fixed !important;
  bottom: 86px !important;
  right: 20px !important;
  left: auto !important;
  width: 420px !important;
  height: 600px !important;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  background: #090e17;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 240, 255, 0.35);
  z-index: 10000;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.voice-agent-popup.open {
  display: flex !important;
}
.voice-agent-popup iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}
.voice-agent-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10001;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.voice-agent-close:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: #ef4444;
}

@media (max-width: 600px) {
  .voice-agent-fab {
    bottom: 16px !important;
    right: 76px !important;
    width: 48px !important;
    height: 48px !important;
  }
  .voice-agent-fab svg {
    width: 20px;
    height: 20px;
  }
  .voice-agent-popup {
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
  }
}
