/* 
   AI Demand Conversion ROI Calculator - Legible, Glow-Fixed CSS with Live Bar Chart
*/

:root {
  --dcc-primary: #33D2FF; /* Cyan-300 */
  --dcc-primary-rgb: 51, 210, 255;
  --dcc-accent-red: #F43F5E; /* Rose-500 */
  --dcc-accent-green: #00E5A0; /* Green-400 */
  --dcc-bg-dark: #050505;
  --dcc-card-bg: rgba(8, 12, 20, 0.85);
  --dcc-grid-border: rgba(51, 210, 255, 0.12);
  --dcc-text-muted: rgba(255, 255, 255, 0.4);
}

/* Base Wrapper */
.dcc-v4-wrapper {
  background: var(--dcc-card-bg);
  border: 1px solid rgba(51, 210, 255, 0.2);
  border-radius: 28px;
  padding: 32px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.85),
              inset 0 0 40px rgba(51, 210, 255, 0.04);
  width: 100%;
  position: relative;
  font-family: "Saira", "Arial", sans-serif;
}

/* Title and Subtitle */
.dcc-v4-title {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  font-family: "Saira", sans-serif;
  margin-bottom: 6px;
}

.dcc-v4-subtitle {
  font-size: 13px;
  color: var(--dcc-text-muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* 2x2 Matrix Layout */
.dcc-matrix-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .dcc-matrix-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

/* Quadrants */
.dcc-quadrant {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--dcc-grid-border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.dcc-quadrant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.dcc-quadrant-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Inputs Deck */
.dcc-v4-control {
  margin-bottom: 16px;
}
.dcc-v4-control:last-child {
  margin-bottom: 0;
}

.dcc-v4-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.dcc-v4-val-readout {
  font-size: 14px;
  color: var(--dcc-primary);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(51, 210, 255, 0.25);
}

/* Range sliders */
.dcc-v4-slider-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  outline: none;
  transition: background 0.3s;
}

.dcc-v4-slider-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dcc-primary);
  box-shadow: 0 0 12px var(--dcc-primary);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.dcc-v4-slider-bar::-webkit-slider-thumb:hover {
  transform: scale(1.3);
  background: #ffffff;
}

/* Quadrant 2: Live Bar Chart styling to fill space */
.dcc-bar-chart {
  margin: 14px 0 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dcc-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dcc-bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.dcc-bar-meta .val {
  font-weight: 700;
}

.dcc-bar-meta .val.red {
  color: var(--dcc-accent-red);
}

.dcc-bar-meta .val.cyan {
  color: var(--dcc-primary);
}

.dcc-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.dcc-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dcc-bar-fill.red {
  background: var(--dcc-accent-red);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
}

.dcc-bar-fill.cyan {
  background: var(--dcc-primary);
  box-shadow: 0 0 8px rgba(51, 210, 255, 0.6);
}

/* Threat display & Terminal */
.dcc-threat-display {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.dcc-threat-large-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--dcc-accent-red);
  text-shadow: 0 0 12px rgba(244, 63, 94, 0.3);
}

.dcc-terminal-feed {
  background: rgba(4, 6, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  font-size: 11px;
  line-height: 1.5;
  height: 138px;
  overflow-y: auto;
  color: rgba(255, 255, 255, 0.5);
}

.dcc-terminal-line {
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  padding-bottom: 4px;
}

.dcc-terminal-line.red {
  color: var(--dcc-accent-red);
  font-weight: 500;
}

.dcc-terminal-line.yellow {
  color: #F59E0B;
  font-weight: 500;
}

.dcc-terminal-line.green {
  color: var(--dcc-accent-green);
  font-weight: 500;
}

.dcc-terminal-feed::-webkit-scrollbar {
  width: 4px;
}
.dcc-terminal-feed::-webkit-scrollbar-track {
  background: transparent;
}
.dcc-terminal-feed::-webkit-scrollbar-thumb {
  background: rgba(51, 210, 255, 0.25);
  border-radius: 2px;
}

/* Quadrant 3: Compass Dial Optimization */
.dcc-caching-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
}

.dcc-compass-container {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dcc-compass-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.dcc-compass-bg {
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 4;
  fill: none;
}

/* Transparent outer glow circle replacing drop-shadow */
.dcc-compass-glow {
  stroke: rgba(51, 210, 255, 0.16);
  stroke-width: 8;
  fill: none;
  stroke-dasharray: 126;
  stroke-dashoffset: 50.4;
  transition: stroke-dashoffset 0.4s ease;
}

.dcc-compass-fill {
  stroke: var(--dcc-primary);
  stroke-width: 4;
  fill: none;
  stroke-dasharray: 126;
  stroke-dashoffset: 50.4;
  transition: stroke-dashoffset 0.4s ease;
}

.dcc-compass-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dcc-compass-val {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.dcc-compass-sub {
  font-size: 7px;
  color: var(--dcc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dcc-optimization-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 11px;
}

.dcc-stat-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 4px;
}

/* Quadrant 4: Receipt Ledger */
.dcc-receipt-ledger {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 11.5px;
}

.dcc-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
}

.dcc-receipt-row.highlight {
  border-bottom: 1px solid rgba(51, 210, 255, 0.25);
  padding-bottom: 8px;
  margin-top: 2px;
}

.dcc-receipt-row.highlight .val {
  color: var(--dcc-primary);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(51, 210, 255, 0.4);
}

.dcc-receipt-row.equity {
  border-top: 1px solid rgba(51, 210, 255, 0.2);
  border-bottom: 1px solid rgba(51, 210, 255, 0.2);
  background: rgba(51, 210, 255, 0.03);
  padding: 8px 6px;
  margin-top: 4px;
}

.dcc-receipt-row.equity .val {
  color: var(--dcc-accent-green);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 229, 160, 0.4);
}

/* LEDs */
.dcc-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.dcc-led.green {
  background: var(--dcc-accent-green);
  box-shadow: 0 0 8px var(--dcc-accent-green);
  animation: dcc-blink 1.5s infinite;
}

.dcc-led.red {
  background: var(--dcc-accent-red);
  box-shadow: 0 0 8px var(--dcc-accent-red);
  animation: dcc-blink 1.2s infinite;
}

@keyframes dcc-blink {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Tooltip */
.dcc-v4-tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.dcc-v4-tooltip .tooltiptext {
  visibility: hidden;
  width: 180px;
  background: #09090b;
  color: #fff;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 10px;
  position: absolute;
  z-index: 120;
  bottom: 125%;
  left: 50%;
  margin-left: -90px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
}

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