/* styles.css — Custom animations, print styles, slider styling */

/* Scroll progress bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #3b82f6);
  z-index: 100;
  transition: width 50ms linear;
}

/* Smooth reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Custom range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #334155;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #0f172a;
  cursor: pointer;
  transition: transform 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #0f172a;
  cursor: pointer;
}

/* Number input inline styling */
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

/* Provider card hover */
.provider-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.provider-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Tier badges */
.tier-1 { background: #166534; color: #bbf7d0; }
.tier-2 { background: #854d0e; color: #fef08a; }
.tier-3 { background: #1e3a5f; color: #93c5fd; }
.tier-4 { background: #7f1d1d; color: #fecaca; }

/* Severity badges */
.severity-high { background: #7f1d1d; color: #fecaca; }
.severity-medium { background: #854d0e; color: #fef08a; }
.severity-low { background: #1e3a5f; color: #bfdbfe; }

/* Checklist items */
.checklist-item {
  transition: opacity 0.2s ease;
}
.checklist-item.checked {
  opacity: 0.5;
}
.checklist-item.checked label {
  text-decoration: line-through;
}

/* Preset buttons */
.preset-btn {
  transition: all 0.15s ease;
}
.preset-btn:hover {
  transform: translateY(-1px);
}
.preset-btn.active {
  ring: 2px;
}

/* Scenario save slots */
.scenario-slot {
  transition: all 0.2s ease;
  border: 2px dashed #475569;
}
.scenario-slot.filled {
  border: 2px solid #f59e0b;
}

/* Sticky nav */
.nav-link {
  transition: color 0.15s ease;
  position: relative;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #f59e0b;
}

/* Urgency banner pulse */
@keyframes urgency-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}
.urgency-banner {
  animation: urgency-pulse 2s ease-in-out infinite;
}

/* Chart container responsive */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 280px;
}
.chart-container canvas {
  width: 100% !important;
}

/* Tooltip custom */
.info-tooltip {
  position: relative;
  cursor: help;
  text-decoration: none;
  border-bottom: 1.5px dashed #f59e0b;
  padding-bottom: 1px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 2px;
  padding-left: 2px;
  padding-right: 2px;
}
.info-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #e2e8f0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 250px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
  border: 1px solid #334155;
}
.info-tooltip:hover::after,
.info-tooltip.active::after {
  opacity: 1;
}

/* Expandable provider details */
.provider-details {
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}
.provider-details.open {
  max-height: 600px;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-top-width: 1px;
}

/* ─── LIGHT MODE ─────────────────────────────────────────────── */

/* Backgrounds */
.light.bg-slate-900 { background-color: #f8fafc !important; }
.light .bg-slate-900\/90 { background-color: rgba(248, 250, 252, 0.9) !important; }
.light .bg-slate-800 { background-color: #ffffff !important; }
.light .bg-slate-800\/30 { background-color: rgba(241, 245, 249, 0.5) !important; }
.light .bg-slate-800\/50 { background-color: rgba(241, 245, 249, 0.7) !important; }
.light .bg-slate-700 { background-color: #e2e8f0 !important; }
.light .bg-slate-700\/50 { background-color: rgba(226, 232, 240, 0.5) !important; }

/* Text */
.light.text-slate-200 { color: #1e293b !important; }
.light .text-white { color: #0f172a !important; }
.light .text-slate-200 { color: #1e293b !important; }
.light .text-slate-300 { color: #334155 !important; }
.light .text-slate-400 { color: #64748b !important; }
.light .text-slate-500 { color: #94a3b8 !important; }

/* Borders */
.light .border-slate-700 { border-color: #e2e8f0 !important; }
.light .border-slate-800 { border-color: #f1f5f9 !important; }
.light .border-slate-600 { border-color: #cbd5e1 !important; }
.light .border-green-800 { border-color: #86efac !important; }
.light .border-purple-800 { border-color: #c4b5fd !important; }
.light .border-red-800 { border-color: #fca5a5 !important; }

/* Urgency banner */
.light .bg-red-900\/40 { background-color: rgba(254, 226, 226, 0.6) !important; }
.light .border-red-700 { border-color: #fca5a5 !important; }
.light .text-red-300 { color: #dc2626 !important; }

/* Industry context badges */
.light .bg-red-900\/30 { background-color: rgba(254, 226, 226, 0.6) !important; }
.light .text-red-400 { color: #dc2626 !important; }

/* Tier badges — dark text on light bg */
.light .tier-1 { background: #bbf7d0; color: #166534; }
.light .tier-2 { background: #fef08a; color: #854d0e; }
.light .tier-3 { background: #bfdbfe; color: #1e3a5f; }
.light .tier-4 { background: #fecaca; color: #991b1b; }

/* Severity badges */
.light .severity-high { background: #fecaca; color: #991b1b; }
.light .severity-medium { background: #fef08a; color: #854d0e; }
.light .severity-low { background: #bfdbfe; color: #1e3a5f; }

/* Slider */
.light input[type="range"] { background: #cbd5e1; }
.light input[type="range"]::-webkit-slider-thumb { border-color: #f8fafc; }
.light input[type="range"]::-moz-range-thumb { border-color: #f8fafc; }

/* Number inputs */
.light input[type="number"] {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

/* Nav */
.light .nav-link { color: #64748b; }
.light .nav-link:hover { color: #0f172a; }
.light .nav-link.active { color: #0f172a !important; }

/* Tooltips */
.light .info-tooltip::after {
  background: #ffffff;
  color: #1e293b;
  border-color: #e2e8f0;
}

/* Provider card hover */
.light .provider-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Scenario slots */
.light .scenario-slot { border-color: #cbd5e1; }
.light .scenario-slot.filled { border-color: #f59e0b; }

/* Provider filter buttons */
.light .bg-solar-500 { background-color: #f59e0b !important; }
.light .bg-solar-500\/20 { background-color: rgba(245, 158, 11, 0.15) !important; }

/* Checklist progress bar track */
.light .bg-slate-700.rounded-full { background-color: #e2e8f0 !important; }

/* Provider details panel */
.light .provider-details { background-color: rgba(248, 250, 252, 0.7) !important; }

/* Footer */
.light .border-t.border-slate-800 { border-color: #e2e8f0 !important; }

/* Decision matrix */
.light .border-b.border-slate-700 { border-color: #e2e8f0 !important; }
.light .border-b.border-slate-800 { border-color: #f1f5f9 !important; }
.light .border-t.border-slate-700 { border-color: #e2e8f0 !important; }

/* Theme toggle + export buttons */
#theme-toggle,
#pdf-export {
  transition: color 0.15s ease;
}

/* ─── PRINT STYLES ───────────────────────────────────────────── */
@media print {
  /* Force light theme */
  body {
    background: #ffffff !important;
    color: #1e293b !important;
    font-size: 11pt !important;
  }

  /* Hide interactive elements */
  nav,
  #scroll-progress,
  .preset-btn,
  #provider-filters,
  #save-scenario,
  #theme-toggle,
  #pdf-export,
  input[type="range"],
  .no-print,
  .urgency-banner {
    display: none !important;
  }

  /* Reset backgrounds */
  .bg-slate-900, .bg-slate-800, .bg-slate-800\/30, .bg-slate-800\/50,
  .bg-slate-700, .bg-slate-700\/50 {
    background: #ffffff !important;
  }

  /* Text colors for readability */
  .text-white, .text-slate-200 { color: #0f172a !important; }
  .text-slate-300 { color: #334155 !important; }
  .text-slate-400, .text-slate-500 { color: #64748b !important; }

  /* Colored text stays colored */
  .text-green-400 { color: #16a34a !important; }
  .text-blue-400 { color: #2563eb !important; }
  .text-amber-400, .text-solar-500 { color: #d97706 !important; }
  .text-purple-400 { color: #9333ea !important; }
  .text-red-400 { color: #dc2626 !important; }

  /* Borders */
  .border-slate-700, .border-slate-800, .border-slate-600 {
    border-color: #e2e8f0 !important;
  }
  .border-green-800 { border-color: #86efac !important; }
  .border-purple-800 { border-color: #c4b5fd !important; }
  .border-red-800 { border-color: #fca5a5 !important; }

  /* Tier badges for print */
  .tier-1 { background: #dcfce7 !important; color: #166534 !important; }
  .tier-2 { background: #fef9c3 !important; color: #854d0e !important; }
  .tier-3 { background: #dbeafe !important; color: #1e3a5f !important; }
  .tier-4 { background: #fee2e2 !important; color: #991b1b !important; }

  /* Severity badges for print */
  .severity-high { background: #fee2e2 !important; color: #991b1b !important; }
  .severity-medium { background: #fef9c3 !important; color: #854d0e !important; }
  .severity-low { background: #dbeafe !important; color: #1e3a5f !important; }

  /* Disable animations */
  .reveal { opacity: 1 !important; transform: none !important; }

  /* Cards and layout */
  .provider-card, .card {
    break-inside: avoid;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
  }

  /* Charts */
  .chart-container {
    break-inside: avoid;
    max-height: 300px !important;
  }

  /* Provider details — force open for print */
  .provider-details {
    max-height: none !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    border-top-width: 1px !important;
    overflow: visible !important;
  }
  .provider-details button { display: none !important; }

  /* Checklist categories — force open */
  #checklist-container .hidden { display: block !important; }

  /* Page breaks */
  #providers { page-break-before: always; }
  #calculator { page-break-before: always; }
  #scenarios { page-break-before: always; }
  #checklist { page-break-before: always; }

  /* Reduce padding for print */
  section { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  main { padding-top: 0 !important; }

  /* Tooltip — hide */
  .info-tooltip::after { display: none !important; }

  /* Number inputs — show as text */
  input[type="number"] {
    border: none !important;
    background: transparent !important;
    color: #0f172a !important;
    -moz-appearance: textfield;
  }
  input[type="number"]::-webkit-inner-spin-button,
  input[type="number"]::-webkit-outer-spin-button {
    display: none !important;
  }
}
