/* ============================================================
   FIRE CALCULATOR STYLES (Financial Independence Retire Early)
   Tradesala ToolSpot | Emerald Green Color Theme
   ============================================================ */

.container {
  --tool-fire: #10b981;
  --tool-fire-soft: rgba(16, 185, 129, 0.12);
  --fire-c1: #10b981; /* Net Worth */
  --fire-c2: #059669; /* Target Corpus */
}

body.light .container {
  --tool-fire: #059669;
  --tool-fire-soft: rgba(5, 150, 105, 0.12);
  --fire-c1: #059669;
  --fire-c2: #047857;
}

/* ── Custom Range Slider Thumb ── */
.range-slider {
  --thumb-color: var(--tool-fire);
  --thumb-border: #ffffff;
  --thumb-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

body.light .range-slider {
  --thumb-border: #ffffff;
  --thumb-shadow: 0 0 8px rgba(5, 150, 105, 0.3);
}

/* ── FIRE Type Selector Buttons (Segmented Tabs Style) ── */
.fire-type-selector {
  display: flex;
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 24px;
  z-index: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.selector-highlight {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  background: rgba(16, 185, 129, 0.12); /* Glassy green */
  border: 1px solid rgba(16, 185, 129, 0.35); /* Subtle glowing border */
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 4px 12px rgba(16, 185, 129, 0.15);
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-sizing: border-box; /* Keep border inside calculations */
}

.fire-type-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 4px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.25s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
  z-index: 2;
}

.fire-type-btn:hover {
  color: var(--text-1);
}

.fire-type-btn.active {
  color: var(--tool-fire) !important; /* Elegant green text on glassy active state */
}

.fire-type-btn span.btn-desc {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.8;
  color: inherit;
}

body.light .fire-type-selector {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light .selector-highlight {
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.25);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 10px rgba(5, 150, 105, 0.1);
}

body.light .fire-type-btn {
  color: var(--text-2);
}

body.light .fire-type-btn:hover {
  color: var(--text-1);
}

body.light .fire-type-btn.active {
  color: var(--tool-fire) !important;
}

/* ── KPI Grid ── */
.fire-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-span-full {
  grid-column: 1 / -1;
}

.kpi-card.emerald::before {
  background: linear-gradient(90deg, #10b981, #34d399) !important;
}

.kpi-card.emerald-deep::before {
  background: linear-gradient(90deg, #059669, #10b981) !important;
}

.kpi-card.mint::before {
  background: linear-gradient(90deg, #6ee7b7, #10b981) !important;
}

/* ── Status Banner ── */
.status-banner {
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
}

.status-banner.achieved {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: #10b981;
}

.status-banner.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
}

body.light .status-banner.achieved {
  background: rgba(16, 185, 129, 0.06);
  color: #059669;
  border-color: rgba(5, 150, 105, 0.2);
}

body.light .status-banner.warning {
  background: rgba(245, 158, 11, 0.06);
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.2);
}

/* ── Coast FIRE target note inside KPI ── */
.coast-target-note {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
  line-height: 1.4;
}

/* ── Projection Table ── */
.projection-table-wrap {
  margin-top: 24px;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.01);
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.projection-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  color: var(--text-2);
}

.projection-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-1);
  font-weight: 600;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.light .projection-table th {
  background: rgba(0, 0, 0, 0.03);
}

.projection-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.light .projection-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.projection-table tr.fire-milestone-row {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10b981;
  font-weight: 700;
}

body.light .projection-table tr.fire-milestone-row {
  background: rgba(5, 150, 105, 0.1) !important;
  color: #059669;
}

.projection-table tr.fire-milestone-row td {
  border-bottom: 1px solid rgba(16, 185, 129, 0.3);
}

.projection-table tr:hover:not(.fire-milestone-row) {
  background: rgba(255, 255, 255, 0.02);
}

body.light .projection-table tr:hover:not(.fire-milestone-row) {
  background: rgba(0, 0, 0, 0.01);
}

/* ── Age Validation Warning ── */
.age-warning {
  display: none !important;
}

/* ── No-as-a-Service (NaaS) Error Styling ── */
.projections-error-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 8px;
  width: 100%;
  box-sizing: border-box;
}

.naas-error-card {
  text-align: center;
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 28px 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.naas-gif-container {
  width: 100%;
  max-width: 280px;
  height: 200px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

.naas-gif-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.naas-gif-container.loading::after {
  content: "";
  width: 32px;
  height: 32px;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: naas-spin 0.8s linear infinite;
  position: absolute;
}

@keyframes naas-spin {
  to { transform: rotate(360deg); }
}

.naas-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}

.naas-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0;
}

body.light .naas-error-card {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

body.light .naas-gif-container {
  border-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* ── Mobile Layout ── */
@media (max-width: 1024px) {
  .main-grid {
    display: block !important;
  }
  .left-col,
  .right-col {
    display: block;
    width: 100%;
    position: static;
  }
  .right-col {
    margin-top: 24px;
  }
}

@media (max-width: 640px) {
  .fire-type-btn {
    font-size: 11px;
    padding: 8px 2px;
  }
  .fire-type-btn span.btn-desc {
    font-size: 9px;
  }
  .fire-kpi-grid {
    grid-template-columns: 1fr;
  }
  .kpi-span-full {
    grid-column: 1 / -1;
  }
  .projection-table th, 
  .projection-table td {
    padding: 10px 12px;
  }
}

/* ── Override Range Slider & Badges for Emerald Theme ── */
.range-slider {
  background: linear-gradient(to right, var(--tool-fire) 0%, var(--tool-fire) var(--fill, 0%), 
    rgba(255, 255, 255, 0.1) var(--fill, 0%), rgba(255, 255, 255, 0.1) 100%) !important;
}

.range-slider::-webkit-slider-thumb {
  border-color: var(--tool-fire) !important;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.range-slider::-moz-range-thumb {
  border-color: var(--tool-fire) !important;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15) !important;
}

body.light .range-slider {
  background: linear-gradient(to right, var(--tool-fire) 0%, var(--tool-fire) var(--fill, 0%), 
    rgba(0, 0, 0, 0.08) var(--fill, 0%), rgba(0, 0, 0, 0.08) 100%) !important;
}

body.light .range-slider::-webkit-slider-thumb {
  border-color: var(--tool-fire) !important;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15), 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.light .range-slider::-moz-range-thumb {
  border-color: var(--tool-fire) !important;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15) !important;
}

.value-badge {
  background: var(--tool-fire-soft) !important;
  color: var(--tool-fire) !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

body.light .value-badge {
  background: var(--tool-fire-soft) !important;
  color: var(--tool-fire) !important;
  border-color: rgba(5, 150, 105, 0.2) !important;
}

.kpi-card.hero.emerald .kpi-val {
  color: var(--tool-fire) !important;
}
