@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ========================================================= */
/* THEME VARIABLES (Default: Light Theme, Optional: Dark)    */
/* ========================================================= */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #10b981;

  /* LIGHT THEME (Default Opening Theme) */
  --bg-app: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --panel-bg: rgba(255, 255, 255, 0.95);
  --panel-border: #e2e8f0;
  --panel-subtle-bg: #f1f5f9;
  --panel-subtle-border: #e2e8f0;
  --header-bg: rgba(255, 255, 255, 0.92);
  --header-border: #e2e8f0;
  --card-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.06);
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-text: #0f172a;
  --input-placeholder: #94a3b8;
  --modal-backdrop-bg: rgba(15, 23, 42, 0.45);
  --modal-bg: #ffffff;
  --modal-border: #e2e8f0;
  --modal-header-bg: #f8fafc;
  --modal-footer-bg: #f8fafc;
  --range-track: #e2e8f0;
  --scrollbar-track: #f1f5f9;
  --scrollbar-thumb: #cbd5e1;
}

html.dark {
  /* DARK THEME */
  --bg-app: #0b0f19;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --panel-bg: rgba(17, 24, 39, 0.75);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-subtle-bg: rgba(31, 41, 55, 0.5);
  --panel-subtle-border: rgba(255, 255, 255, 0.05);
  --header-bg: rgba(11, 15, 25, 0.85);
  --header-border: rgba(255, 255, 255, 0.08);
  --card-shadow: none;
  --input-bg: rgba(15, 23, 42, 0.85);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-text: #f1f5f9;
  --input-placeholder: #64748b;
  --modal-backdrop-bg: rgba(4, 7, 15, 0.85);
  --modal-bg: #0d1322;
  --modal-border: rgba(51, 65, 85, 0.8);
  --modal-header-bg: rgba(15, 23, 42, 0.9);
  --modal-footer-bg: #0f172a;
  --range-track: #374151;
  --scrollbar-track: #0b0f19;
  --scrollbar-thumb: #2d3748;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.font-mono-numbers {
  font-family: 'JetBrains Mono', monospace;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* Glassmorphism styling */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  box-shadow: var(--card-shadow);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.glass-panel-subtle {
  background: var(--panel-subtle-bg);
  border: 1px solid var(--panel-subtle-border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.glass-header {
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--header-border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Range input styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--range-track);
  border-radius: 9999px;
  outline: none;
  transition: background 0.2s ease;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  transition: all 0.15s ease-in-out;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #60a5fa;
}

/* Smooth Tab transitions */
.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}
.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card hover glow */
.hover-glow {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-glow:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 12px 24px -10px rgba(37, 99, 235, 0.25);
}

/* Wizard Modal & Form Styling */
.modal-backdrop {
  background: var(--modal-backdrop-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.25s ease;
}

.modal-box {
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  color: var(--text-main);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}

.modal-header-bar {
  background: var(--modal-header-bg);
  border-color: var(--modal-border);
}

.modal-footer-bar {
  background: var(--modal-footer-bg);
  border-color: var(--modal-border);
}

.wizard-step {
  display: none;
  animation: stepFade 0.25s ease-out;
}
.wizard-step.active {
  display: block;
}

@keyframes stepFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-input {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--input-text);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: all 0.15s ease-in-out;
  outline: none;
}
.form-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.form-input::placeholder {
  color: var(--input-placeholder);
}

select.form-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.25rem;
  -webkit-appearance: none;
  appearance: none;
}

.stepper-pill {
  transition: all 0.2s ease-in-out;
}
.stepper-pill.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: #3b82f6;
  color: #2563eb;
}
.stepper-pill.completed {
  border-color: #10b981;
  color: #059669;
}

/* ========================================================= */
/* LIGHT MODE HIGH-CONTRAST OVERRIDES                        */
/* ========================================================= */
html:not(.dark) .text-white {
  color: #0f172a !important;
}
html:not(.dark) .text-slate-200,
html:not(.dark) .text-slate-300,
html:not(.dark) .text-gray-200,
html:not(.dark) .text-gray-300 {
  color: #334155 !important;
}
html:not(.dark) .text-slate-400,
html:not(.dark) .text-gray-400 {
  color: #64748b !important;
}
html:not(.dark) .text-slate-500,
html:not(.dark) .text-gray-500 {
  color: #94a3b8 !important;
}
html:not(.dark) .border-slate-800,
html:not(.dark) .border-slate-700,
html:not(.dark) .border-gray-800,
html:not(.dark) .border-slate-800\/60,
html:not(.dark) .border-slate-800\/80 {
  border-color: #e2e8f0 !important;
}
html:not(.dark) .bg-slate-900,
html:not(.dark) .bg-slate-900\/90,
html:not(.dark) .bg-slate-900\/80,
html:not(.dark) .bg-slate-900\/60,
html:not(.dark) .bg-slate-900\/50 {
  background-color: #f1f5f9 !important;
}
html:not(.dark) .bg-slate-800,
html:not(.dark) .bg-slate-800\/80,
html:not(.dark) .bg-gray-800 {
  background-color: #e2e8f0 !important;
  color: #1e293b !important;
}
html:not(.dark) .hover\:bg-gray-800:hover,
html:not(.dark) .hover\:bg-slate-700:hover,
html:not(.dark) .hover\:bg-gray-800\/40:hover {
  background-color: #e2e8f0 !important;
}
html:not(.dark) .bg-blue-950\/30,
html:not(.dark) .bg-blue-950\/40,
html:not(.dark) .bg-blue-950\/60 {
  background-color: #eff6ff !important;
}
html:not(.dark) .bg-purple-950\/30,
html:not(.dark) .bg-purple-950\/40 {
  background-color: #faf5ff !important;
}
html:not(.dark) .bg-emerald-950\/20,
html:not(.dark) .bg-emerald-950\/30,
html:not(.dark) .bg-emerald-950\/40 {
  background-color: #ecfdf5 !important;
}
html:not(.dark) .bg-amber-950\/40,
html:not(.dark) .bg-amber-950\/80 {
  background-color: #fffbeb !important;
}

/* Print styles for Financial Proposal Export */
@media print {
  body {
    background: #ffffff !important;
    color: #111827 !important;
  }
  .no-print, nav, header, button, .profile-selector, #wizard-modal {
    display: none !important;
  }
  .glass-panel, .glass-panel-subtle {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    color: #111827 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .text-white, .text-gray-100, .text-gray-200, .text-gray-300 {
    color: #1f2937 !important;
  }
  .text-gray-400, .text-gray-500 {
    color: #4b5563 !important;
  }
  .tab-content {
    display: block !important;
    page-break-after: always;
  }
}
