/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Base Layout */
.dashboard {
  width: 100%;
  max-width: 480px;
  height: 480px;
  background: theme('colors.gray.900');
  color: theme('colors.white');
  border-radius: theme('borderRadius.lg');
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  position: relative;
}

/* Component Positioning */
.dashboard .status-bar,
.dashboard .warning-indicators,
.dashboard .speedometer,
.dashboard .stats {
  position: absolute;
  width: 480px;
}

.dashboard .warning-indicators {
  top: 48px;
}

.dashboard .stats {
  bottom: 0;
}

/* Status Bar */
.status-bar {
  height: 40px;
  padding: 0 1rem;
  border-bottom: 1px solid theme('colors.gray.700');
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.battery-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.battery-icon {
  color: theme('colors.emerald.500');
  font-size: 1.25rem;
}

.time {
  font-size: 1.5rem;
  font-weight: bold;
}

/* Warning Indicators */
.warning-indicators {
  height: 60px;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.indicator {
  transition: opacity 0.3s;
}

.indicator svg {
  width: 48px;
  height: 48px;
}

.indicator.active .blinker {
  fill: theme('colors.emerald.400');
}

.indicator.inactive .blinker {
  fill: theme('colors.gray.700');
}

.indicator.parking.inactive path {
  stroke: theme('colors.gray.700');
  fill: theme('colors.gray.700');
}

/* Speedometer */
.speedometer {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 480px;
  top: 32px;
}

svg.gauges {
  position: absolute;
  height: 480px;
  width: 480px;
  top: 32px;
}

svg.gauges .background {
  fill: none;
  stroke: theme('colors.gray.800');
}

.power-arc {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  height: 300px;
}

.battery-arc {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1;
}

.speed-ring {
  width: 300px;
  height: 300px;
  z-index: 2;
}

.speed-ring circle {
  fill: none;
  stroke-linecap: butt;
  transition: stroke-dashoffset 0.3s ease;
}

.speed-ring .background {
  stroke: theme('colors.gray.700');
}

.speed-ring .indicator {
  stroke: theme('colors.emerald.400');
}

.speed-ring .power-regen {
  stroke: theme('colors.red.900');
}

.speed-label {
  font-size: 1rem;
  color: theme('colors.gray.500');
  margin-top: 0.5rem;
  text-transform: uppercase;
}

.speed-value {
  position: absolute;
  text-align: center;
}

.speed-number {
  font-size: 5rem;
  font-weight: bold;
  line-height: 1;
}

.speed-unit {
  font-size: 1.25rem;
  color: theme('colors.gray.400');
}

/* Stats */
.stats {
  height: 64px;
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: center;
}

.stat {
  display: flex;
  flex-direction: column;
  margin: 0 8px;
  padding: 2px;
}

.stat-label {
  text-align: center;
  font-size: 0.875rem;
  line-height: 0.9;
  color: theme('colors.gray.400');
}

.stat-value {
  font-size: 1.25rem;
  font-weight: bold;
}

.stat-unit {
  font-size: 0.75rem;
  font-weight: normal;
}

/* Online status pulse animation */
@keyframes online-pulse {
  0%, 100% { 
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% { 
    opacity: 0.8;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
  }
}

.online-pulse {
  animation: online-pulse 4s infinite;
}
