/* ==========================================================================
   DASHBOARD CLUSTER · MODERN AUTOMOTIVE SPEEDOMETER HUD
   ========================================================================== */

:root {
  --c-cyan: #00d9e6;
  --c-blue: #3399ff;
  --c-green: #1ad966;
  --c-red: #ff3326;
  --c-orange: #ff8c00;
  --c-dim: #666b80;
  --c-dark-glass: rgba(13, 15, 20, 0.88);
  --hud-scale: 1;
  --hud-width: 350px;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent !important;
  background-color: transparent !important;
  font-family: 'Rajdhani', 'Orbitron', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-drag: none;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}


/* ==========================================================================
   SPEEDOMETER CLUSTER HUD CONTAINER (Fixed Bottom-Right, Scaled & Compact)
   ========================================================================== */
.dashboard-hud-wrapper {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: var(--hud-width);
  max-width: calc(100vw - 40px);
  z-index: 9999;
  pointer-events: auto;
  user-select: none;
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 18px rgba(0, 217, 230, 0.12));
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease, opacity 0.25s ease;
  will-change: transform;
}

.dashboard-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Make artboard background transparent so HUD blends with screen */
.dashboard-artboard-bg {
  fill: transparent !important;
}

/* ==========================================================================
   SPEEDOMETER NEEDLE ANIMATION
   ========================================================================== */
#Needle {
  transform-origin: 222.526px 248.658px;
  transition: transform 0.08s cubic-bezier(0.1, 0.85, 0.2, 1);
  will-change: transform;
  filter: url(#filter3_d_0_1);
}

/* Redline danger pulse across the main gauge */
.dashboard-hud-wrapper.redline-active #Speedometer {
  animation: redline-glow 0.8s infinite alternate ease-in-out;
}

@keyframes redline-glow {
  0% {
    filter: drop-shadow(0 0 15px rgba(255, 51, 38, 0.4));
  }
  100% {
    filter: drop-shadow(0 0 30px rgba(255, 51, 38, 0.85));
  }
}

/* ==========================================================================
   DYNAMIC ARCS (Speed Arc, Engine Arc, Fuel Arc)
   ========================================================================== */
#Speed-Arc-Active {
  transition: stroke-dashoffset 0.08s cubic-bezier(0.1, 0.85, 0.2, 1);
  will-change: stroke-dashoffset;
}

#engine-arc-fill-path,
#fuel-arc-fill-path {
  transition: stroke-dashoffset 0.3s ease, stroke 0.3s ease;
  will-change: stroke-dashoffset;
}

/* ==========================================================================
   INTERACTIVE INDICATORS (Sein L, Sein R, Lock, Lampu, Seatbelt)
   ========================================================================== */
.clickable-indicator {
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, filter 0.2s ease;
}

.clickable-indicator:hover {
  filter: brightness(1.25);
  transform: scale(1.03);
}

.clickable-indicator:active {
  transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   INDICATOR STATES: UNLIT / OFF (Mati saat Dimatikan)
   -------------------------------------------------------------------------- */
.indicator-off,
.indicator-inactive {
  opacity: 0.28 !important;
  filter: none !important;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.indicator-off circle:first-of-type,
.indicator-inactive circle:first-of-type {
  fill: #141722 !important;
}

.indicator-off circle:last-of-type,
.indicator-inactive circle:last-of-type {
  stroke: #2e3444 !important;
  stroke-opacity: 0.35 !important;
}

.indicator-off [id$="Icon"] path,
.indicator-inactive [id$="Icon"] path {
  fill: #4c5366 !important;
  filter: none !important;
}

.indicator-off > path:first-child,
.indicator-inactive > path:first-child {
  fill: #555d72 !important;
}

/* --------------------------------------------------------------------------
   INDICATOR STATES: ACTIVE / ON (Hidup saat Dihidupkan)
   -------------------------------------------------------------------------- */
.indicator-active,
.indicator-on {
  opacity: 1 !important;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

/* HEADLIGHTS: Low Beam (On) */
#group-lampu.lampu-on {
  opacity: 1 !important;
  filter: drop-shadow(0 0 10px rgba(51, 153, 255, 0.75)) !important;
}
#group-lampu.lampu-on #LAMPU {
  fill: #3399FF !important;
}
#group-lampu.lampu-on [id$="BG"] circle:first-of-type {
  fill: url(#paint8_radial_0_1) !important;
}
#group-lampu.lampu-on [id$="BG"] circle:last-of-type {
  stroke: #3399FF !important;
  stroke-opacity: 0.9 !important;
}
#group-lampu.lampu-on [id$="Icon"] path {
  fill: #FFFFFF !important;
  filter: drop-shadow(0 0 4px rgba(51, 153, 255, 0.95)) !important;
}

/* HEADLIGHTS: High Beam */
#group-lampu.lampu-high {
  opacity: 1 !important;
  filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.9)) !important;
}
#group-lampu.lampu-high #LAMPU {
  fill: #00E5FF !important;
}
#group-lampu.lampu-high [id$="BG"] circle:first-of-type {
  fill: url(#paint7_radial_0_1) !important;
}
#group-lampu.lampu-high [id$="BG"] circle:last-of-type {
  stroke: #00E5FF !important;
  stroke-opacity: 1 !important;
}
#group-lampu.lampu-high [id$="Icon"] path {
  fill: #FFFFFF !important;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 1)) !important;
}

/* SEATBELT: Fastened / ON (Hidup saat ON / Terpasang) */
#group-seatbelt.seatbelt-on {
  opacity: 1 !important;
  filter: drop-shadow(0 0 10px rgba(26, 217, 102, 0.75)) !important;
}
#group-seatbelt.seatbelt-on #SEATBELT {
  fill: #1AD966 !important;
}
#group-seatbelt.seatbelt-on [id$="BG"] circle:first-of-type {
  fill: url(#paint6_radial_0_1) !important;
}
#group-seatbelt.seatbelt-on [id$="BG"] circle:last-of-type {
  stroke: #1AD966 !important;
  stroke-opacity: 0.9 !important;
}
#group-seatbelt.seatbelt-on [id$="Icon"] path {
  fill: #FFFFFF !important;
  filter: drop-shadow(0 0 4px rgba(26, 217, 102, 0.95)) !important;
}

/* SEATBELT: Warning Pulse (Peringatan saat belum pasang sabuk) */
@keyframes seatbelt-pulse {
  0%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 14px rgba(255, 51, 38, 0.95));
  }
  50% {
    opacity: 0.35;
    filter: drop-shadow(0 0 4px rgba(255, 51, 38, 0.3));
  }
}

#group-seatbelt.seatbelt-warning {
  opacity: 1 !important;
  animation: seatbelt-pulse 0.85s infinite ease-in-out !important;
}
#group-seatbelt.seatbelt-warning #SEATBELT {
  fill: #FF3326 !important;
}
#group-seatbelt.seatbelt-warning [id$="BG"] circle:first-of-type {
  fill: url(#paint9_radial_0_1) !important;
}
#group-seatbelt.seatbelt-warning [id$="BG"] circle:last-of-type {
  stroke: #FF3326 !important;
  stroke-opacity: 0.9 !important;
}
#group-seatbelt.seatbelt-warning [id$="Icon"] path {
  fill: #FFFFFF !important;
  filter: drop-shadow(0 0 5px rgba(255, 51, 38, 0.9)) !important;
}

/* DOOR LOCK: ON (Terkunci) */
#group-lock.lock-on {
  opacity: 1 !important;
  filter: drop-shadow(0 0 10px rgba(0, 217, 230, 0.75)) !important;
}
#group-lock.lock-on #LOCK {
  fill: #00D9E6 !important;
}
#group-lock.lock-on [id$="BG"] circle:first-of-type {
  fill: url(#paint7_radial_0_1) !important;
}
#group-lock.lock-on [id$="BG"] circle:last-of-type {
  stroke: #00D9E6 !important;
  stroke-opacity: 0.85 !important;
}
#group-lock.lock-on [id$="Icon"] path {
  fill: #FFFFFF !important;
  filter: drop-shadow(0 0 4px rgba(0, 217, 230, 0.9)) !important;
}

/* TURN SIGNALS: Left / Right Blinking */
@keyframes blinker-pulse {
  0%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 14px rgba(26, 217, 102, 0.9));
  }
  50% {
    opacity: 0.18;
    filter: none;
  }
}

.blinker-flashing {
  opacity: 1 !important;
  animation: blinker-pulse 0.74s infinite ease-in-out !important;
}
.blinker-flashing [id$="BG"] circle:first-of-type {
  fill: url(#paint6_radial_0_1) !important;
}
.blinker-flashing [id$="BG"] circle:last-of-type {
  stroke: #1AD966 !important;
  stroke-opacity: 0.95 !important;
}
.blinker-flashing [id$="Icon"] path {
  fill: #FFFFFF !important;
  filter: drop-shadow(0 0 5px rgba(26, 217, 102, 0.95)) !important;
}
.blinker-flashing > path:first-child {
  fill: #1AD966 !important;
}

/* Low Fuel Warning Pulse */
@keyframes fuel-warning-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(255, 51, 38, 0.8));
    stroke: #ff3326;
  }
  50% {
    filter: none;
    stroke: #ff7700;
  }
}

.fuel-critical #fuel-arc-fill-path {
  animation: fuel-warning-pulse 1s infinite alternate;
}

.fuel-critical #val-fuel-pct,
.fuel-critical #FUEL-PERCENT {
  fill: #ff3326 !important;
}

/* Engine Overheat Warning */
@keyframes engine-overheat-pulse {
  0%, 100% {
    stroke: #ff1e38;
    filter: drop-shadow(0 0 12px rgba(255, 30, 56, 0.9));
  }
  50% {
    stroke: #ff8c00;
    filter: drop-shadow(0 0 4px rgba(255, 140, 0, 0.4));
  }
}

.engine-overheat #engine-arc-fill-path {
  animation: engine-overheat-pulse 0.8s infinite alternate;
}

.engine-overheat #val-engine-temp,
.engine-overheat #ENGINE-UNIT {
  fill: #ff1e38 !important;
}

/* Digital Speed Typography & Glow */
#val-speed {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  fill: #ffffff;
  text-shadow: 0 0 10px rgba(0, 217, 230, 0.45);
  transition: fill 0.2s ease;
}

.dashboard-hud-wrapper.redline-active #val-speed {
  fill: #ff3326;
  text-shadow: 0 0 14px rgba(255, 51, 38, 0.8);
}


