/* WFM Labs — powerofone | Light/Dark toggle
   Visual style matched to Minimal Interval Variance tool */

/* Font: match MIV system font stack (NOT Montserrat) */
*, body, html {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* ═══════════════════════════════════════════════════
   DEFAULT (DARK MODE)
   Page: #030712 | Cards: #111827 | Insets: #1f2937
   ═══════════════════════════════════════════════════ */

body { background-color: #030712 !important; color: #f3f4f6 !important; }

/* Page wrapper */
.bg-navy-950, [class*="bg-navy-950"]:not([class*="bg-navy-950/"]) {
  background-color: #030712 !important;
}

/* ── Cards: match MIV's rounded-xl shadow-md p-6 ── */
.rounded-lg {
  background-color: #111827 !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2) !important;
  border-color: #1f2937 !important;
  border-radius: 0.75rem !important; /* rounded-xl */
  padding: 1.5rem !important; /* p-6 */
}
/* Active/highlighted card state */
[class*="bg-amber-950"] { background-color: rgba(217,119,6,0.08) !important; }
/* Gold accent card state */
[class*="bg-navy-900/50"]:not(input):not(select):not(textarea) { background-color: #1f2937 !important; }
/* Default card state */
[class*="bg-navy-950/50"]:not(input):not(select):not(textarea) { background-color: #111827 !important; }

/* Deeper inset panels */
[class*="bg-navy-900/30"] { background-color: #0f172a !important; }

/* Dropdown/tooltip */
.bg-gray-800 { background-color: #1f2937 !important; }

/* ── Input fields: add inset container feel ── */
/* Inputs get a subtle inset background like MIV's bg-gray-50 border-l-4 boxes */
input:not([type="range"]), select, textarea {
  background-color: #0f172a !important;
  border: 1px solid #374151 !important;
  border-left: 4px solid #f97316 !important;
  color: #f3f4f6 !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
}

/* ── Labels: match MIV's text-sm font-semibold ── */
.text-xs.text-gray-500,
[class*="text-xs"][class*="text-gray-500"] {
  font-size: 0.875rem !important; /* text-sm */
  font-weight: 600 !important; /* font-semibold */
  color: #d1d5db !important;
}

/* Gradient panel (insights/alerts) */
.bg-gradient-to-r { background-image: none !important; }
[class*="from-red-950"] { background-color: rgba(127,29,29,0.15) !important; }

/* Accent backgrounds */
[class*="bg-gold-500"] { background-color: rgba(255,109,0,0.08) !important; }
[class*="bg-red-950"] { background-color: rgba(239,68,68,0.06) !important; }

/* ── Text: high contrast ── */
.text-white { color: #ffffff !important; }
.text-gray-300 { color: #e5e7eb !important; }
.text-gray-400 { color: #d1d5db !important; }
.text-gray-500 { color: #9CA3AF !important; }
.text-gray-600 { color: #9CA3AF !important; }
[class*="text-gold"] { color: #fb923c !important; }
[class*="text-amber"] { color: #fb923c !important; }
[class*="text-emerald"] { color: #34d399 !important; }
[class*="text-red-3"] { color: #fca5a5 !important; }
[class*="text-red-4"] { color: #f87171 !important; }
p, span, li, h1, h2, h3, h4, h5, h6 { color: inherit; }
label { color: #e5e7eb !important; }

/* ── Borders ── */
[class*="border-gray-700"] { border-color: #374151 !important; }
[class*="border-gray-800"] { border-color: #1f2937 !important; }
[class*="border-gray-600"] { border-color: #4b5563 !important; }
[class*="border-gray-500"] { border-color: #4b5563 !important; }
[class*="border-gold"] { border-color: rgba(251,146,60,0.35) !important; }
[class*="border-amber"] { border-color: rgba(251,146,60,0.3) !important; }
[class*="border-red-700"] { border-color: rgba(239,68,68,0.25) !important; }
.border-blue-500 { border-color: #f97316 !important; }

/* ── Input focus & placeholder ── */
input::placeholder, textarea::placeholder { color: #6B7280 !important; opacity: 1 !important; }
input:focus, select:focus, textarea:focus {
  border-color: #f97316 !important;
  border-left: 4px solid #f97316 !important;
  box-shadow: 0 0 0 2px rgba(249,115,22,0.25) !important;
  outline: none !important;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* Range sliders */
input[type="range"] {
  -webkit-appearance: none !important; appearance: none !important;
  height: 6px !important; border-radius: 3px !important;
  background: #4b5563 !important; border: none !important;
  padding: 0 !important; outline: none !important;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: 18px !important; height: 18px !important; border-radius: 50% !important;
  background: #f97316 !important; cursor: pointer !important;
  border: 2px solid #fff !important;
  box-shadow: 0 0 6px rgba(249,115,22,0.5) !important;
}
input[type="range"]::-moz-range-thumb {
  width: 18px !important; height: 18px !important; border-radius: 50% !important;
  background: #f97316 !important; cursor: pointer !important; border: 2px solid #fff !important;
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px !important; border-radius: 3px !important; background: #4b5563 !important; }
input[type="range"]::-moz-range-track { height: 6px !important; border-radius: 3px !important; background: #4b5563 !important; }

/* ── Tables ── */
table { border-color: #1f2937 !important; }
thead { background-color: #0f172a !important; }
th { color: #d1d5db !important; border-color: #374151 !important; font-weight: 600 !important; }
td { color: #e5e7eb !important; border-color: #1f2937 !important; }
tbody tr { border-color: #1f2937 !important; }
tr:hover { background-color: rgba(249,115,22,0.06) !important; }

/* ── Buttons ── */
[class*="bg-blue-5"], [class*="bg-blue-6"], [class*="bg-blue-7"] {
  background-color: #f97316 !important; color: #fff !important;
}
button[class*="text-blue"] { color: #fb923c !important; }
button[class*="border-blue"] { border-color: #f97316 !important; }

/* Focus */
[class*="ring-blue"], [class*="focus\\:border-blue"] {
  --tw-ring-color: rgba(249,115,22,0.5) !important;
  border-color: #f97316 !important;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #030712; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* Misc */
hr { border-color: #374151 !important; }
[class*="divide-gray"] > * + * { border-color: #374151 !important; }


/* ── FLOATING TOOLBAR ── */
#wfm-toolbar {
  position: fixed; top: 12px; right: 16px; z-index: 1000;
  display: flex; align-items: center; gap: 8px;
}
#wfm-about-btn {
  background: rgba(17,24,39,0.9); backdrop-filter: blur(8px);
  border: 1px solid #374151; color: #9CA3AF;
  width: 36px; height: 36px; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; transition: all 0.2s; flex-shrink: 0;
}
#wfm-about-btn:hover { border-color: #f97316; color: #fb923c; }
#wfm-theme-toggle {
  background: rgba(17,24,39,0.9); backdrop-filter: blur(8px);
  border: 1px solid #374151; color: #9CA3AF;
  width: 36px; height: 36px; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: all 0.2s; flex-shrink: 0;
}
#wfm-theme-toggle:hover { border-color: #f97316; color: #fb923c; }

/* About overlay */
#wfm-about-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 10000; align-items: center; justify-content: center; padding: 24px;
}
#wfm-about-overlay.active { display: flex; }
#wfm-about-box {
  background: #111827; border: 1px solid #374151; border-radius: 12px;
  padding: 24px; max-width: 560px; width: 100%; max-height: 80vh; overflow-y: auto;
}
#wfm-about-box h3 { color: #fff; font-size: 18px; font-weight: 700; margin: 0 0 4px 0; }
#wfm-about-box .about-sub { color: #fb923c; font-size: 12px; margin: 0 0 16px 0; }
#wfm-about-box .about-text { color: #d1d5db; font-size: 14px; line-height: 1.7; margin: 0; }
#wfm-about-box .about-close {
  margin-top: 16px; background: #f97316; color: #fff; border: none;
  padding: 8px 20px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
}
#wfm-about-box .about-close:hover { background: #ea580c; }

/* Footer */
#wfm-footer {
  background-color: #111827; border-top: 1px solid #374151;
  padding: 16px 24px;
}
#wfm-footer .footer-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
#wfm-footer .footer-copyright { font-size: 13px; color: #9CA3AF; }
#wfm-footer .footer-copyright a { color: #f97316; text-decoration: none; }
#wfm-footer .footer-links { display: flex; gap: 20px; }
#wfm-footer .footer-links a { font-size: 13px; color: #9CA3AF; text-decoration: none; transition: color 0.2s; }
#wfm-footer .footer-links a:hover { color: #f97316; }
#wfm-footer .footer-disclaimer { font-size: 11px; color: #6B7280; text-align: center; max-width: 800px; margin: 0 auto; line-height: 1.5; }


/* ═══════════════════════════════════════════════════
   LIGHT MODE — matches MIV light:
   Page: #f3f4f6 | Cards: #ffffff (with shadow-md)
   Insets: #f9fafb | Text: high-contrast dark
   ═══════════════════════════════════════════════════ */

html.light body { background-color: #f3f4f6 !important; color: #1f2937 !important; }

/* Page wrapper → gray-100 */
.light .bg-navy-950, .light [class*="bg-navy-950"]:not([class*="bg-navy-950/"]) {
  background-color: #f3f4f6 !important;
}
.light [class*="min-h-screen"] { background-color: #f3f4f6 !important; }

/* Cards → white with shadow, rounded-xl, p-6 (MIV style) */
.light .rounded-lg {
  background-color: #ffffff !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1) !important;
  border-color: #e5e7eb !important;
}
/* Active/highlighted card */
.light [class*="bg-amber-950"] { background-color: rgba(59,130,246,0.04) !important; }
/* Gold accent card */
.light [class*="bg-navy-900/50"]:not(input):not(select):not(textarea) { background-color: #f9fafb !important; }
/* Default card */
.light [class*="bg-navy-950/50"]:not(input):not(select):not(textarea) { background-color: #ffffff !important; }

/* Info panel */
.light [class*="bg-navy-900/30"] { background-color: #f9fafb !important; }

/* Dropdown */
.light .bg-gray-800 { background-color: #ffffff !important; }

/* Gradient panel → soft blue tint (like MIV's insight panel) */
.light [class*="from-red-950"] {
  background-color: #eff6ff !important;
}
.light .bg-gradient-to-r { background-image: none !important; }

/* Accent backgrounds */
.light [class*="bg-gold-500"] { background-color: rgba(59,130,246,0.05) !important; }
.light [class*="bg-red-950"] { background-color: #fef2f2 !important; }

/* ── Text: dark and crisp (matching MIV) ── */
.light .text-white { color: #111827 !important; }
.light .text-gray-300 { color: #1f2937 !important; }
.light .text-gray-400 { color: #374151 !important; }
.light .text-gray-500 { color: #6B7280 !important; }
.light .text-gray-600 { color: #6B7280 !important; }
.light [class*="text-gold"] { color: #2563eb !important; }
.light [class*="text-amber"] { color: #d97706 !important; }
.light [class*="text-emerald"] { color: #059669 !important; }
.light [class*="text-red-3"] { color: #dc2626 !important; }
.light [class*="text-red-4"] { color: #dc2626 !important; }
.light p, .light span, .light li,
.light h1, .light h2, .light h3, .light h4, .light h5, .light h6 { color: inherit; }
.light label { color: #1f2937 !important; }

/* ── Borders: visible but not heavy ── */
.light [class*="border-gray-700"] { border-color: #e5e7eb !important; }
.light [class*="border-gray-800"] { border-color: #f3f4f6 !important; }
.light [class*="border-gray-600"] { border-color: #d1d5db !important; }
.light [class*="border-gray-500"] { border-color: #d1d5db !important; }
.light [class*="border-gold"] { border-color: rgba(37,99,235,0.25) !important; }
.light [class*="border-amber"] { border-color: rgba(217,119,6,0.25) !important; }
.light [class*="border-red-700"] { border-color: rgba(220,38,38,0.2) !important; }
.light .border-blue-500 { border-color: #3b82f6 !important; }

/* ── Inputs: inset container style like MIV's bg-gray-50 border-l-4 ── */
.light input:not([type="range"]), .light select, .light textarea {
  background-color: #f9fafb !important;
  border: 1px solid #d1d5db !important;
  border-left: 4px solid #3b82f6 !important;
  color: #111827 !important;
  padding: 8px 12px !important;
}
.light input::placeholder, .light textarea::placeholder { color: #9CA3AF !important; }
.light input:focus, .light select:focus, .light textarea:focus {
  border-color: #3b82f6 !important;
  border-left: 4px solid #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.25) !important;
}

/* Labels → match MIV's text-sm font-semibold text-gray-700 */
.light .text-xs.text-gray-500,
.light [class*="text-xs"][class*="text-gray-500"] {
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #374151 !important;
}

/* Range sliders */
.light input[type="range"] { background: #d1d5db !important; }
.light input[type="range"]::-webkit-slider-thumb {
  background: #2563eb !important; border: 2px solid #fff !important;
  box-shadow: 0 0 6px rgba(37,99,235,0.4) !important;
}
.light input[type="range"]::-moz-range-thumb {
  background: #2563eb !important; border: 2px solid #fff !important;
}
.light input[type="range"]::-webkit-slider-runnable-track { background: #d1d5db !important; }
.light input[type="range"]::-moz-range-track { background: #d1d5db !important; }

/* ── Tables ── */
.light table { border-color: #e5e7eb !important; }
.light thead { background-color: #f9fafb !important; }
.light th { color: #374151 !important; border-color: #e5e7eb !important; font-weight: 600 !important; }
.light td { color: #1f2937 !important; border-color: #f3f4f6 !important; }
.light tbody tr { border-color: #f3f4f6 !important; }
.light tr:hover { background-color: rgba(59,130,246,0.04) !important; }

/* ── Buttons ── */
.light [class*="bg-blue-5"], .light [class*="bg-blue-6"], .light [class*="bg-blue-7"] {
  background-color: #2563eb !important; color: #fff !important;
}
.light button[class*="text-blue"] { color: #2563eb !important; }
.light button[class*="border-blue"] { border-color: #3b82f6 !important; }

/* Focus */
.light [class*="ring-blue"], .light [class*="focus\\:border-blue"] {
  --tw-ring-color: rgba(59,130,246,0.5) !important;
  border-color: #3b82f6 !important;
}

/* Scrollbar */
.light ::-webkit-scrollbar-track { background: #f3f4f6; }
.light ::-webkit-scrollbar-thumb { background: #d1d5db; }
.light ::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Misc */
.light hr { border-color: #e5e7eb !important; }
.light [class*="divide-gray"] > * + * { border-color: #e5e7eb !important; }

/* ── LIGHT Toolbar ── */
.light #wfm-about-btn, .light #wfm-theme-toggle {
  background: rgba(255,255,255,0.9); backdrop-filter: blur(8px);
  border-color: #d1d5db; color: #6B7280;
}
.light #wfm-about-btn:hover, .light #wfm-theme-toggle:hover {
  border-color: #2563eb; color: #2563eb;
}

/* ── LIGHT Footer ── */
.light #wfm-footer { background-color: #ffffff; border-top-color: #e5e7eb; }
.light #wfm-footer .footer-copyright { color: #6B7280; }
.light #wfm-footer .footer-copyright a { color: #2563eb; }
.light #wfm-footer .footer-links a { color: #6B7280; }
.light #wfm-footer .footer-links a:hover { color: #2563eb; }
.light #wfm-footer .footer-disclaimer { color: #9CA3AF; }

/* ── LIGHT About popup ── */
.light #wfm-about-overlay { background: rgba(0,0,0,0.3); }
.light #wfm-about-box { background: #ffffff; border-color: #e5e7eb; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1) !important; }
.light #wfm-about-box h3 { color: #111827; }
.light #wfm-about-box .about-sub { color: #2563eb; }
.light #wfm-about-box .about-text { color: #374151; }
.light #wfm-about-box .about-close { background: #2563eb; }
.light #wfm-about-box .about-close:hover { background: #1d4ed8; }
