/* 
   Visibility + Authority Cost Calculator Styling V2 (Orthogonal & Space-Optimized)
*/

:root {
  /* Colors */
  --acc-bg-card: rgba(10, 15, 30, 0.7);
  --acc-bg-panel: rgba(16, 22, 42, 0.9);
  --acc-border-color: rgba(255, 255, 255, 0.08);
  --acc-border-focus: rgba(0, 229, 160, 0.4);
  
  --acc-color-primary: #00E5A0;    /* Core action & accent (Green/Emerald) */
  --acc-color-danger: #f43f5e;     /* Loss highlighting (Rose/Red) */
  --acc-color-success: #00E5A0;    /* Savings/Recovery highlighting (Green/Emerald) */
  --acc-color-warning: #f59e0b;    /* Warning/Caution alerts (Amber) */
  
  --acc-text-main: #f8fafc;
  --acc-text-muted: #94a3b8;
  --acc-text-inverse: #020617;

  /* Typography */
  --acc-font-family: 'Saira', 'Arial', sans-serif;
  
  /* Layout & Decor */
  --acc-border-radius: 16px;
  --acc-border-radius-inner: 8px;
  --acc-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 50px rgba(0, 229, 160, 0.05);
  --acc-glow-blur: 20px;
  --acc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.acc-wrapper {
  font-family: var(--acc-font-family);
  color: var(--acc-text-main);
  background: var(--acc-bg-card);
  border: 1px solid var(--acc-border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--acc-border-radius);
  box-shadow: var(--acc-shadow);
  padding: 1.75rem;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  transition: var(--acc-transition);
  position: relative;
  overflow: hidden;
}

.acc-wrapper::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: var(--acc-color-primary);
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
}

/* Typography & Layout Elements */
.acc-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.acc-subtitle {
  font-size: 0.875rem;
  color: var(--acc-text-muted);
  margin-bottom: 1.5rem;
}

/* Mode Tabs */
.acc-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--acc-border-color);
  padding: 3px;
  border-radius: var(--acc-border-radius-inner);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
}

.acc-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--acc-text-muted);
  padding: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: calc(var(--acc-border-radius-inner) - 2px);
  transition: var(--acc-transition);
}

.acc-tab-btn.active {
  background: rgba(0, 229, 160, 0.08) !important;
  color: #00E5A0 !important;
  font-weight: 600;
  box-shadow: inset 0 0 8px rgba(0, 229, 160, 0.05);
}

/* Slider Controls */
.acc-control-group {
  margin-bottom: 1.25rem;
}

.acc-control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.acc-control-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--acc-text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.acc-control-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--acc-color-primary);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--acc-border-color);
  min-width: 60px;
  text-align: right;
}

/* Premium Range Input Styling */
.acc-range-input {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  transition: background 0.3s;
}

.acc-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--acc-color-primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--acc-color-primary);
  transition: transform 0.1s;
}

.acc-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.acc-range-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--acc-color-primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--acc-color-primary);
  transition: transform 0.1s;
}

.acc-range-input::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Preset Picker */
.acc-presets-wrapper {
  margin-bottom: 1.5rem;
}
.acc-presets-label {
  font-size: 0.8125rem;
  color: var(--acc-text-muted);
  margin-bottom: 0.5rem;
}
.acc-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.5rem;
}
.acc-preset-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--acc-border-color);
  border-radius: 6px;
  padding: 0.4rem;
  font-size: 0.75rem;
  color: var(--acc-text-muted);
  cursor: pointer;
  transition: var(--acc-transition);
}
.acc-preset-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--acc-text-main);
}
.acc-preset-btn.active {
  background: rgba(0, 229, 160, 0.05);
  border-color: var(--acc-color-primary);
  color: var(--acc-color-primary);
}

/* Results Display Panel */
.acc-results-panel {
  background: var(--acc-bg-panel);
  border: 1px solid var(--acc-border-color);
  border-radius: var(--acc-border-radius-inner);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 380px; /* Force minimum height to match Column 3 */
}

.acc-loss-metric {
  text-align: center;
}

.acc-loss-label {
  font-size: 0.875rem;
  color: var(--acc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.acc-loss-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--acc-color-danger);
  text-shadow: 0 0 15px rgba(244, 63, 94, 0.2);
  line-height: 1;
}

/* Recoverable Metric Summary Card */
.acc-recovery-card {
  background: rgba(0, 229, 160, 0.06);
  border: 1px dashed rgba(0, 229, 160, 0.25);
  padding: 0.85rem;
  border-radius: 8px;
  text-align: center;
}
.acc-recovery-label {
  font-size: 0.75rem;
  color: var(--acc-color-success);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}
.acc-recovery-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--acc-color-success);
}

/* Chart Container styling */
.acc-chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 110px;
  position: relative;
}

.acc-chart-label {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.acc-chart-label .val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--acc-text-main);
  display: block;
}

.acc-chart-label .lbl {
  font-size: 0.75rem;
  color: var(--acc-text-muted);
}

/* SVG Chart paths styles */
.acc-chart-dial {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.acc-dial-bg {
  stroke: rgba(255, 255, 255, 0.05);
}

.acc-dial-val {
  stroke: var(--acc-color-primary);
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.5s ease-out;
}

/* Comparison Bars */
.acc-comparison-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.acc-bar-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.acc-bar-label {
  font-size: 9px;
  color: var(--acc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.acc-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  overflow: hidden;
}

.acc-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

.acc-bar-shared .acc-bar-fill { background: var(--acc-color-danger); }
.acc-bar-owned .acc-bar-fill { background: var(--acc-color-primary); }

/* Advanced Info Grid */
.acc-advanced-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  border-top: 1px solid var(--acc-border-color);
  padding-top: 0.75rem;
  width: 100%;
}

.acc-adv-item {
  text-align: left;
}
.acc-adv-lbl {
  font-size: 0.75rem;
  color: var(--acc-text-muted);
}
.acc-adv-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--acc-text-main);
}

/* CSS Tooltip */
.acc-tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
  color: var(--acc-text-muted);
  font-size: 0.8125rem;
  margin-left: 0.25rem;
}

.acc-tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #0c1016;
  color: #fff;
  text-align: center;
  border: 1px solid var(--acc-border-color);
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.75rem;
  font-weight: normal;
  line-height: 1.4;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.acc-tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Compounding 5-Year Equity Ledger Terminal */
.acc-ledger-card {
  background: rgba(0, 229, 160, 0.02);
  border: 1px solid rgba(0, 229, 160, 0.12);
  border-radius: var(--acc-border-radius-inner);
  padding: 1.25rem;
  font-family: var(--acc-font-family);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}
.acc-ledger-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--acc-color-primary), transparent);
}
.acc-ledger-title {
  font-size: 0.75rem;
  color: var(--acc-color-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 229, 160, 0.08);
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
  text-align: left;
}
.acc-ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.03);
  padding-bottom: 0.35rem;
}
.acc-ledger-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.acc-ledger-year {
  color: var(--acc-text-muted);
}
.acc-ledger-val {
  font-weight: 600;
  color: var(--acc-text-main);
  font-family: monospace;
}
.acc-ledger-val.highlight {
  color: var(--acc-color-primary);
  text-shadow: 0 0 8px rgba(0, 229, 160, 0.3);
}

/* Stacked Dashboard Grid Rules */
.acc-console-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid var(--acc-border-color);
  border-radius: var(--acc-border-radius-inner);
}
@media (min-width: 640px) {
  .acc-console-inputs {
    grid-template-columns: repeat(2, 1fr);
  }
}

.acc-dashboard-outputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .acc-dashboard-outputs {
    grid-template-columns: 1fr 1fr 1.2fr;
  }
}

/* ==========================================
   V2 ADVANCED VISUAL CHARTS (SPACE OPTIMIZATION)
   ========================================== */

/* Mini line graph for decay curve (Column 1) */
.acc-decay-chart-box {
  width: 100%;
  height: 80px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.acc-chart-gridline {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.acc-decay-curve-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.acc-decay-curve-line {
  stroke: var(--acc-color-danger);
  stroke-width: 2px;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(244, 63, 94, 0.4));
}

.acc-decay-curve-fill {
  fill: url(#decay-gradient);
  opacity: 0.15;
}

.acc-decay-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  color: var(--acc-text-muted);
  font-family: monospace;
  margin-top: 2px;
}

/* Mini budget bar chart (Column 2) */
.acc-broker-chart-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acc-broker-chart-header {
  font-size: 8px;
  color: var(--acc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 4px;
}

.acc-broker-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acc-broker-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.acc-broker-lbl {
  font-size: 8px;
  color: var(--acc-text-muted);
  display: flex;
  justify-content: space-between;
}

.acc-broker-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}

/* Custom stack distribution colors */
.acc-broker-bar-middleman {
  height: 100%;
  background: var(--acc-color-danger);
  transition: width 0.3s ease;
}

.acc-broker-bar-adspend {
  height: 100%;
  background: var(--acc-color-warning);
  transition: width 0.3s ease;
}

.acc-broker-bar-equity {
  height: 100%;
  background: var(--acc-color-primary);
  transition: width 0.3s ease;
}

.acc-broker-bar-platform {
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: width 0.3s ease;
}

/* Mini stat highlight card (Column 2 bottom) */
.acc-multiple-card {
  background: rgba(0, 229, 160, 0.04);
  border: 1px solid rgba(0, 229, 160, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.acc-multiple-lbl {
  font-size: 9px;
  color: var(--acc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
}

.acc-multiple-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--acc-color-primary);
  text-shadow: 0 0 10px rgba(0, 229, 160, 0.3);
  font-family: monospace;
}
