/* HelixAI Design System — theme.css
   Import after base styles. Overrides globals with design tokens. */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* ─── Design Tokens: Light Mode ─── */
:root {
  --purple: #7C3AED;
  --cyan:   #06B6D4;
  --teal:   #14B8A6;
  --light:  #F8F7FC;

  --bg:           #FFFFFF;
  --bg-secondary: #F8F7FC;
  --bg-tint:      #F3F0FF;
  --text-dark:    #1F2937;
  --text-body:    #4B5563;
  --text-muted:   #9CA3AF;
  --border:       rgba(124, 58, 237, 0.12);
  --border-light: rgba(124, 58, 237, 0.07);
  --card-shadow:  0 2px 16px rgba(124, 58, 237, 0.07);
  --nav-bg:       rgba(255, 255, 255, 0.95);
}

/* ─── Design Tokens: Dark Mode ─── */
html[data-theme="dark"] {
  --bg:           #080B18;
  --bg-secondary: #0E1228;
  --bg-tint:      #121830;
  --text-dark:    #F8F7FC;
  --text-body:    rgba(248, 247, 252, 0.75);
  --text-muted:   rgba(248, 247, 252, 0.45);
  --border:       rgba(124, 58, 237, 0.18);
  --border-light: rgba(124, 58, 237, 0.10);
  --card-shadow:  0 2px 20px rgba(0, 0, 0, 0.3);
  --nav-bg:       rgba(8, 11, 24, 0.96);
}

/* ─── Base ─── */
body {
  background:  var(--bg);
  color:       var(--text-dark);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size:   16px;
  line-height: 1.7;
}

/* ─── Navigation / Header ─── */
nav, .header {
  background:    var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
nav a, .header a {
  color: var(--text-body);
}
nav a:hover, .header a:hover {
  color: var(--purple);
}

/* Login / outlined button */
.btn-login, nav a.btn-secondary {
  border:        1.5px solid var(--purple);
  color:         var(--purple);
  background:    transparent;
  border-radius: 6px;
  padding:       6px 16px;
}
html[data-theme="dark"] .btn-login,
html[data-theme="dark"] nav a.btn-secondary {
  border-color: var(--cyan);
  color:        var(--cyan);
}

/* Get Started / gradient button */
.btn-primary, nav a.btn-primary, button[type="submit"] {
  background:    linear-gradient(135deg, #7C3AED, #06B6D4);
  color:         #ffffff;
  border:        none;
  border-radius: 7px;
  padding:       11px 24px;
  font-weight:   500;
  cursor:        pointer;
}

/* Ghost / secondary */
.btn-secondary, .btn-ghost {
  border:        1.5px solid var(--purple);
  color:         var(--purple);
  background:    transparent;
  border-radius: 7px;
  padding:       11px 24px;
  font-weight:   500;
  cursor:        pointer;
}
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-ghost {
  border-color: var(--cyan);
  color:        var(--cyan);
}

/* ─── Cards & Panels ─── */
.card, .panel, .feature-card, .pricing-card, .step,
.stat-card, .feature-section {
  background:   var(--bg);
  border:       1px solid var(--border-light);
  border-radius: 10px;
  box-shadow:   var(--card-shadow);
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .pricing-card,
html[data-theme="dark"] .step,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .feature-section {
  background: var(--bg-tint);
  border-color: var(--border);
}

/* ─── Section Backgrounds ─── */
.section-alt { background: var(--bg-secondary); }
section:nth-child(even) { background: var(--bg-secondary); }
section:nth-child(odd)  { background: var(--bg); }

/* ─── Form Inputs ─── */
input, textarea, select, .form-control {
  background:    var(--bg);
  border:        1px solid var(--border);
  color:         var(--text-dark);
  border-radius: 7px;
  padding:       10px 14px;
  font-family:   'Inter', sans-serif;
}
input:focus, textarea:focus, select:focus, .form-control:focus {
  border-color: var(--purple);
  box-shadow:   0 0 0 3px rgba(124, 58, 237, 0.15);
  outline:      none;
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .form-control {
  background:  var(--bg-tint);
  border-color: var(--border);
  color:       var(--text-dark);
}

/* ─── Labels ─── */
label, .form-group label {
  color: var(--text-body);
}

/* ─── Comparison Table ─── */
.compare-col-helix th, .table-helix-header {
  background: linear-gradient(135deg, #7C3AED, #06B6D4);
  color:      #ffffff;
}
.check, .feature-check { color: var(--teal); font-weight: 600; }
.cross, .feature-cross { color: var(--text-muted); }

/* ─── CTA Banners ─── */
.cta-section, .cta-banner {
  background: linear-gradient(135deg, #7C3AED, #06B6D4);
  color:      #ffffff;
}
.cta-section .btn-primary, .cta-banner .btn-primary {
  background: #ffffff;
  color:      var(--purple);
}
.cta-section .btn-secondary, .cta-banner .btn-secondary {
  border:     1.5px solid rgba(255, 255, 255, 0.4);
  color:      #ffffff;
  background: transparent;
}

/* ─── Footer ─── */
footer {
  background: #1F2937;
  color:      rgba(255, 255, 255, 0.4);
}
html[data-theme="dark"] footer {
  background: #040609;
  color:      rgba(255, 255, 255, 0.25);
}
footer img.logo {
  filter:  brightness(0) invert(1);
  opacity: 0.55;
}
footer a { color: rgba(255, 255, 255, 0.3); }
footer a:hover { color: rgba(255, 255, 255, 0.7); }

/* ─── Pricing Cards ─── */
.pricing-card.featured, .pricing-card.best-value {
  border: 2px solid var(--purple);
}
.pricing-card .price-amount {
  color:          var(--purple);
  font-weight:    200;
  font-size:      3rem;
  letter-spacing: -0.04em;
}
.pricing-card .feature-item::before { color: var(--teal); }

/* ─── Auth Pages ─── */
.auth-page {
  min-height:      100vh;
  background:      var(--bg-secondary);
  display:         flex;
  align-items:     center;
  justify-content: center;
}
.auth-card {
  background:    var(--bg);
  border:        1px solid var(--border-light);
  box-shadow:    var(--card-shadow);
  border-radius: 12px;
  padding:       2.5rem;
  max-width:     420px;
  width:         100%;
}

/* ─── Blog / Article ─── */
.article-body, .blog-content {
  color:       var(--text-body);
  line-height: 1.8;
}
.article-body a, .blog-content a { color: var(--purple); }
.article-body a:hover, .blog-content a:hover { color: var(--cyan); }
code, pre {
  background:    var(--bg-tint);
  border:        1px solid var(--border-light);
  border-radius: 6px;
}

/* ─── Alerts (dark mode adaptation) ─── */
html[data-theme="dark"] .alert-error {
  background: rgba(220, 38, 38, 0.15);
  color:      #fca5a5;
  border-left-color: #ef4444;
}
html[data-theme="dark"] .alert-success {
  background: rgba(16, 185, 129, 0.15);
  color:      #6ee7b7;
  border-left-color: #10b981;
}

/* ─── Badges (dark mode) ─── */
html[data-theme="dark"] .badge-success {
  background: rgba(16, 185, 129, 0.2);
  color:      #6ee7b7;
}
html[data-theme="dark"] .badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color:      #fcd34d;
}
html[data-theme="dark"] .badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color:      #fca5a5;
}
html[data-theme="dark"] .badge-info {
  background: rgba(59, 130, 246, 0.2);
  color:      #93c5fd;
}

/* ─── Quick Actions Bar (dark mode) ─── */
html[data-theme="dark"] .quick-actions-bar {
  background:   var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .quick-action.secondary {
  background: var(--bg-tint);
  color:      var(--text-body);
}

/* ─── Modal (dark mode) ─── */
html[data-theme="dark"] .helix-modal {
  background:   var(--bg-secondary);
  border:       1px solid var(--border);
}
html[data-theme="dark"] .helix-modal-header,
html[data-theme="dark"] .helix-modal-footer {
  border-color: var(--border);
}
html[data-theme="dark"] .helix-modal-title {
  color: var(--text-dark);
}
html[data-theme="dark"] .helix-modal-body {
  color: var(--text-body);
}
html[data-theme="dark"] .helix-modal-btn-cancel {
  background: var(--bg-tint);
  color:      var(--text-body);
}

/* ─── Items list (dark mode) ─── */
html[data-theme="dark"] .item:hover {
  background: var(--bg-tint);
}
html[data-theme="dark"] .item,
html[data-theme="dark"] .section-header {
  border-color: var(--border);
}
html[data-theme="dark"] .item-info h3,
html[data-theme="dark"] .section-header h2 {
  color: var(--text-dark);
}
html[data-theme="dark"] .item-meta {
  color: var(--text-muted);
}

/* ─── Stat card numbers (dark mode) ─── */
html[data-theme="dark"] .stat-card .number {
  -webkit-text-fill-color: transparent;
  background: linear-gradient(135deg, #7C3AED, #06B6D4);
  -webkit-background-clip: text;
  background-clip: text;
}
html[data-theme="dark"] .stat-card h3 {
  color: var(--text-muted);
}

/* ─── Theme Toggle Button ─── */
#theme-toggle {
  background:    transparent;
  border:        1px solid var(--border);
  border-radius: 8px;
  padding:       6px 10px;
  cursor:        pointer;
  font-size:     16px;
  margin-left:   12px;
  line-height:   1;
  color:         var(--text-body);
  transition:    border-color 0.2s, background 0.2s;
}
#theme-toggle:hover {
  border-color: var(--purple);
  background:   var(--bg-tint);
}

/* Icon visibility */
html[data-theme="dark"] .theme-icon-light { display: none; }
html[data-theme="dark"] .theme-icon-dark  { display: inline; }
html:not([data-theme="dark"]) .theme-icon-light { display: inline; }
html:not([data-theme="dark"]) .theme-icon-dark  { display: none; }

/* ─── z-index: canvas=0 (behind everything), content=1+ ─── */
body > *:not(canvas),
.header, nav, .nav, .quick-actions-bar,
main, section, footer, .container, .content-wrapper,
.hero, .features, .steps-section, .testimonials, .faq {
  position: relative;
  z-index:  1;
}

/* Nav and modals always on top */
nav, .nav, .quick-actions-bar, #theme-toggle,
.helix-modal-overlay, .helix-toast, #helix-modal-overlay {
  z-index: 9000;
}

/* ─── Issue 2: Nav background overrides (beats hardcoded bg-color) ─── */
html[data-theme="dark"] .nav,
html[data-theme="dark"] nav { background: rgba(8,11,24,0.96) !important; }
html:not([data-theme="dark"]) .nav,
html:not([data-theme="dark"]) nav { background: rgba(255,255,255,0.95) !important; }

/* ─── Issue 3: Cards — dark mode hardcoded white overrides ─── */
html[data-theme="dark"] [class*="card"],
html[data-theme="dark"] .step-card,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .feature-box,
html[data-theme="dark"] .pricing-card,
html[data-theme="dark"] .stat-card {
  background:   #121830 !important;
  border-color: rgba(124,58,237,0.18) !important;
  color:        #F8F7FC !important;
}
html[data-theme="dark"] [class*="card"] p,
html[data-theme="dark"] [class*="card"] h1,
html[data-theme="dark"] [class*="card"] h2,
html[data-theme="dark"] [class*="card"] h3,
html[data-theme="dark"] [class*="card"] h4,
html[data-theme="dark"] .step-card p,
html[data-theme="dark"] .step-card h3,
html[data-theme="dark"] .feature-card p,
html[data-theme="dark"] .feature-card h3 {
  color: #F8F7FC !important;
}

/* ─── Issue 5: Light mode body + card overrides ─── */
html:not([data-theme="dark"]) body {
  background: #FFFFFF !important;
  color:      #1F2937 !important;
}
html:not([data-theme="dark"]) [class*="card"],
html:not([data-theme="dark"]) .step-card,
html:not([data-theme="dark"]) .feature-card,
html:not([data-theme="dark"]) .feature-box {
  background: #FFFFFF !important;
  color:      #1F2937 !important;
}

/* ─── Section transparency — lets canvas helix show through ─── */
/* Light mode: sections slightly transparent so helix at z-index:0 bleeds through */
html:not([data-theme="dark"]) section,
html:not([data-theme="dark"]) .hero,
html:not([data-theme="dark"]) main,
html:not([data-theme="dark"]) .features-section,
html:not([data-theme="dark"]) .steps-section,
html:not([data-theme="dark"]) .testimonials,
html:not([data-theme="dark"]) .faq-section {
  background: rgba(255, 255, 255, 0.70) !important;
}
/* Dark mode: same approach */
html[data-theme="dark"] section,
html[data-theme="dark"] .hero,
html[data-theme="dark"] main,
html[data-theme="dark"] .features-section,
html[data-theme="dark"] .steps-section,
html[data-theme="dark"] .testimonials,
html[data-theme="dark"] .faq-section {
  background: rgba(8, 11, 24, 0.70) !important;
}

/* ─── Theme toggle inside nav ─── */
nav #theme-toggle,
.nav #theme-toggle {
  margin-left: 8px;
  position:    static;
}
