/* ============================================================
   DEPRECIATION CALCULATOR STYLES (SLM & WDV Methods)
   Tradesala ToolSpot | Cyan & Teal Premium Valuation Theme
   ============================================================ */

.container {
  --tool-fire: #06b6d4; /* Vibrant Cyan standard */
  --tool-fire-soft: rgba(6, 182, 212, 0.12);
  --tool-danger: #ef4444;
  --tool-danger-soft: rgba(239, 68, 68, 0.12);
  --tool-red: #06b6d4;
  --tool-red-soft: rgba(6, 182, 212, 0.12);
}

body.light .container {
  --tool-fire: #0891b2; /* Deep Cyan for light mode contrast */
  --tool-fire-soft: rgba(8, 145, 178, 0.08);
  --tool-red: #0891b2;
  --tool-red-soft: rgba(8, 145, 178, 0.08);
}

/* Collapsible / Expandable Custom Rate Section transition */
.rate-section {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}

.rate-section.show {
  max-height: 200px;
  opacity: 1;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

body.light .rate-section.show {
  border-top-color: rgba(0, 0, 0, 0.06);
}

/* Modern Slide Switch Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 20px;
  margin-bottom: 8px;
  transition: all 0.25s ease;
}

.toggle-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(6, 182, 212, 0.20);
}

body.light .toggle-row {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light .toggle-row:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(8, 145, 178, 0.15);
}

.toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-label span:first-child {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.toggle-label span:last-child {
  font-size: 11px;
  color: var(--text-3);
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 34px;
  border: 1px solid var(--glass-border);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .switch-slider {
  background-color: var(--tool-fire);
}

input:checked + .switch-slider:before {
  transform: translateX(22px);
}

body.light .switch-slider {
  background-color: rgba(0, 0, 0, 0.1);
}

body.light input:checked + .switch-slider {
  background-color: var(--tool-fire);
}

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

@media (max-width: 640px) {
  .dep-kpi-grid {
    grid-template-columns: 1fr;
  }
}

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

/* ── WACC Cyan Hero Card ── */
.kpi-card.hero.cyan {
  box-shadow: 0 8px 32px rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.3);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(6, 182, 212, 0.02) 100%);
  transition: all 0.3s ease;
}

.kpi-card.hero.cyan .kpi-val {
  color: var(--tool-fire) !important;
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.kpi-card.hero.cyan .kpi-label {
  color: rgba(165, 243, 252, 0.8) !important; /* Soft cyan text for dark mode */
}

body.light .kpi-card.hero.cyan {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(6, 182, 212, 0.02) 100%);
  border-color: rgba(6, 182, 212, 0.2);
}

body.light .kpi-card.hero.cyan .kpi-val {
  color: var(--tool-fire) !important;
  text-shadow: none;
}

body.light .kpi-card.hero.cyan .kpi-label {
  color: #164e63 !important; /* Deep cyan for light mode */
}

/* ── Tab Controls (Chart toggles & Schedule Toggles) ── */
.chart-toggle, .table-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 4px;
  width: fit-content;
}

body.light .chart-toggle, body.light .table-toggle {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

.chart-toggle-btn, .table-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-toggle-btn.active, .table-toggle-btn.active {
  background: var(--tool-fire);
  color: #ffffff !important;
}

/* ── Tables ── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.015);
  margin-top: 16px;
  -webkit-overflow-scrolling: touch;
}

body.light .table-wrap {
  background: rgba(0, 0, 0, 0.005);
  border-color: rgba(0, 0, 0, 0.08);
}

.projection-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: right;
}

.projection-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 8px;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 2px solid rgba(6, 182, 212, 0.15);
}

body.light .projection-table th {
  background: rgba(0, 0, 0, 0.02);
  color: #444;
  border-bottom-color: rgba(6, 182, 212, 0.12);
}

.projection-table td {
  padding: 10px 8px;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

body.light .projection-table td {
  color: #333;
  border-bottom-color: rgba(0, 0, 0, 0.035);
}

.projection-table tr:last-child td {
  border-bottom: none;
}

.projection-table th:first-child,
.projection-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.projection-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.008);
}

body.light .projection-table tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.01);
}

.projection-table tr:hover td {
  background: rgba(6, 182, 212, 0.07) !important;
}

body.light .projection-table tr:hover td {
  background: rgba(6, 182, 212, 0.04) !important;
}

.text-success {
  color: #10b981 !important;
}

body.light .text-success {
  color: #059669 !important;
}

.text-danger {
  color: #f87171 !important;
}

body.light .text-danger {
  color: #dc2626 !important;
}

/* ── Status Banner Viability Modes ── */
.status-banner {
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.status-banner.achieved {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.25);
  color: #c7d2fe;
  color: #a5f3fc;
}

.status-banner.warning {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

body.light .status-banner.achieved {
  background: rgba(6, 182, 212, 0.06);
  border-color: rgba(6, 182, 212, 0.2);
  color: #164e63;
}

body.light .status-banner.warning {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.15);
  color: #7f1d1d;
}

/* ── Glassmorphic Chart Wrapper & Glows ── */
.chart-container-relative {
  position: relative;
  width: 100%;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 16px;
}

.chart-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  filter: blur(25px);
  opacity: 0.35;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-glow.orb-cyan {
  background: radial-gradient(circle, rgba(6, 182, 212, 0.45) 0%, rgba(6, 182, 212, 0) 70%);
  top: -40px;
  left: -40px;
}

.chart-glow.orb-purple {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, rgba(168, 85, 247, 0) 70%);
  bottom: -40px;
  right: -40px;
}

body.light .chart-glow {
  opacity: 0.28;
}

/* Sibling Hover Effect: Hovering the wrap enlarges & brightens the glowing orbs behind it */
.chart-wrap:hover ~ .chart-glow {
  opacity: 0.5;
  transform: scale(1.2);
}

body.light .chart-wrap:hover ~ .chart-glow {
  opacity: 0.4;
}

.chart-wrap {
  position: relative;
  z-index: 2; /* Sits above glowing orbs */
  height: 320px;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 20px 16px 14px 10px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 8px 32px -4px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.chart-wrap:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.12), 0 12px 40px -4px rgba(0, 0, 0, 0.25);
}

body.light .chart-wrap {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.2) 100%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1.5px 0 0 rgba(255, 255, 255, 0.75), 0 8px 24px -4px rgba(0, 0, 0, 0.04);
}

body.light .chart-wrap:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.3) 100%);
  border-color: rgba(8, 145, 178, 0.3);
  box-shadow: inset 0 1.5px 0 0 rgba(255, 255, 255, 0.9), 0 12px 32px -4px rgba(0, 0, 0, 0.06);
}

@media (max-width: 520px) {
  .hide-mobile {
    display: none !important;
  }
}

/* ── Mobile Layout Adjustments (Width <= 768px) ── */
@media (max-width: 768px) {
  .container {
    padding: 0 12px 60px !important;
  }

  .panel {
    padding: 16px 12px !important;
    border-radius: 16px !important;
  }

  .input-header label {
    font-size: 13px !important;
  }
  
  .value-badge {
    font-size: 12px !important;
    padding: 3px 8px !important;
  }

  .projection-table th, 
  .projection-table td {
    padding: 8px 6px !important;
    font-size: 11.5px !important;
  }
}

/* ── Scoped Glassmorphic Panel Overrides ── */
.panel {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
}

body.light .panel {
  background: rgba(255, 255, 255, 0.65) !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.04) !important;
}
