/**
 * SEO Quartz - Dark Mode CSS
 * These overrides apply when .dark-mode class is on body
 */

body.dark-mode {

  /* Core colors */
  --sq-primary-light: rgba(99, 102, 241, 0.15);
  --sq-text:          #e2e8f0;
  --sq-text-muted:    #94a3b8;
  --sq-heading:       #f1f5f9;
  --sq-body-bg:       #0f172a;
  --sq-surface:       #1e293b;
  --sq-card-bg:       #1e293b;
  --sq-border:        #334155;

  /* Header */
  --sq-header-bg:     #1e293b;
  --sq-header-text:   #f1f5f9;
  --sq-nav-link:      #cbd5e1;
  --sq-nav-hover:     #a78bfa;

  /* Footer */
  --sq-footer-bg:     #0f172a;
  --sq-footer-text:   #94a3b8;

  /* Top bar */
  --sq-top-bar-bg:    #0f172a;
  --sq-top-bar-text:  #94a3b8;

  /* Inputs */
  --sq-input-bg:      #1e293b;
  --sq-input-border:  #334155;
  --sq-input-text:    #e2e8f0;
}

/* General dark mode rules */
body.dark-mode {
  color-scheme: dark;
}

body.dark-mode img { filter: brightness(0.92); }

body.dark-mode .wp-block-code,
body.dark-mode pre,
body.dark-mode code {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

body.dark-mode blockquote {
  background: #1e293b;
  border-color: var(--sq-primary);
  color: #cbd5e1;
}

body.dark-mode .alert-info    { background: rgba(59,130,246,0.15); color: #93c5fd; }
body.dark-mode .alert-success { background: rgba(34,197,94,0.15);  color: #86efac; }
body.dark-mode .alert-warning { background: rgba(245,158,11,0.15); color: #fcd34d; }
body.dark-mode .alert-danger  { background: rgba(239,68,68,0.15);  color: #fca5a5; }

body.dark-mode .skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #2d3f55 50%, #1e293b 75%);
}

body.dark-mode table thead th { background: #1e293b; }
body.dark-mode table tr:nth-child(even) { background: rgba(255,255,255,0.03); }
body.dark-mode table td, body.dark-mode table th { border-color: #334155; }

/* WooCommerce dark mode adjustments */
body.dark-mode .woocommerce-product-gallery,
body.dark-mode .product_meta,
body.dark-mode .cart_totals,
body.dark-mode .order_details { border-color: #334155; }

body.dark-mode .woocommerce .quantity input { background: #1e293b; color: #e2e8f0; border-color: #334155; }

/* Dark mode toggle button appearance */
.dark-mode-toggle { 
  background: transparent; border: none; cursor: pointer;
  color: var(--sq-header-text); padding: 0.4rem;
  border-radius: var(--sq-radius); display: inline-flex; align-items: center;
  transition: color var(--sq-transition);
}
.dark-mode-toggle:hover { color: var(--sq-primary); }
.dark-mode-toggle .icon-sun  { display: none; }
.dark-mode-toggle .icon-moon { display: block; }
body.dark-mode .dark-mode-toggle .icon-sun  { display: block; }
body.dark-mode .dark-mode-toggle .icon-moon { display: none; }

/* System dark mode */
@media (prefers-color-scheme: dark) {
  body:not(.light-mode) {
    --sq-primary-light: rgba(99, 102, 241, 0.15);
    --sq-text:          #e2e8f0;
    --sq-text-muted:    #94a3b8;
    --sq-heading:       #f1f5f9;
    --sq-body-bg:       #0f172a;
    --sq-surface:       #1e293b;
    --sq-card-bg:       #1e293b;
    --sq-border:        #334155;
    --sq-header-bg:     #1e293b;
    --sq-header-text:   #f1f5f9;
    --sq-nav-link:      #cbd5e1;
    --sq-footer-bg:     #0f172a;
    --sq-footer-text:   #94a3b8;
    --sq-input-bg:      #1e293b;
    --sq-input-border:  #334155;
    --sq-input-text:    #e2e8f0;
  }
}
