:root {
    --bg-color: #1a1a1a;
    --screen-bg: #0d1117;
    --hud-color: #00ff41; /* Classic Terminal Green */
    --hud-dim: #005f18;
    --hud-alert: #ffab00;
    --glass-reflection: rgba(255, 255, 255, 0.05);
    --font-mono: 'Share Tech Mono', monospace;
    --font-ui: 'Rajdhani', sans-serif;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #000;
    color: var(--hud-color);
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: var(--font-ui);
}

#device-frame {
    width: 100%;
    height: 100%;
    max-width: 480px; /* Mobile width cap */
    max-height: 900px;
    background: #222;
    padding: 10px;
    border-radius: 30px;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.1);
    position: relative;
}

.device-casing {
    width: 100%;
    height: 100%;
    background: #111;
    border-radius: 20px;
    border: 4px solid #333;
    position: relative;
    overflow: hidden;
}

.screen-container {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a222c 0%, #000000 100%);
    position: relative;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

/* BOOT SCREEN */
#boot-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.boot-logo {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    letter-spacing: 4px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--hud-color);
}

.boot-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--hud-dim);
}

.progress-bar {
    width: 200px;
    height: 4px;
    background: #111;
    margin-top: 15px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--hud-color);
    animation: loadBar 2s ease-out forwards;
}

@keyframes loadBar {
    0% { width: 0%; }
    40% { width: 30%; }
    70% { width: 70%; }
    100% { width: 100%; }
}

.blink {
    animation: blinking 1s infinite;
}

@keyframes blinking {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.hidden {
    display: none !important;
}

/* HUD ELEMENTS */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--hud-dim);
    padding-bottom: 8px;
    margin-bottom: 15px;
    height: 30px;
}

.signal-bars {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 16px;
}

.bar {
    width: 4px;
    background: var(--hud-dim);
    border-radius: 1px;
}

.bar.b1 { height: 4px; }
.bar.b2 { height: 8px; }
.bar.b3 { height: 12px; }
.bar.b4 { height: 16px; }

.bar.active { background: var(--hud-color); box-shadow: 0 0 5px var(--hud-color); }

.gps-status {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.battery-icon {
    width: 24px;
    height: 12px;
    border: 1px solid var(--hud-dim);
    padding: 1px;
    position: relative;
    border-radius: 2px;
}

.battery-icon::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 2px;
    width: 2px;
    height: 6px;
    background: var(--hud-dim);
    border-radius: 0 1px 1px 0;
}

.bat-level {
    width: 80%; /* simulated */
    height: 100%;
    background: var(--hud-color);
}

/* DASHBOARD PRIMARY */
.dashboard-primary {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.compass-ring {
    width: 220px;
    height: 220px;
    border: 2px dashed var(--hud-dim);
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    transition: transform 0.3s ease-out;
}

.arrow {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 40px solid var(--hud-color);
    filter: drop-shadow(0 0 8px var(--hud-color));
}

.cardinal {
    position: absolute;
    font-weight: bold;
    color: var(--hud-dim);
    font-size: 1.2rem;
}
.cardinal.N { top: 10px; color: var(--hud-alert); }
.cardinal.E { right: 15px; }
.cardinal.S { bottom: 10px; }
.cardinal.W { left: 15px; }

.speed-box {
    text-align: center;
}

#speed-val {
    font-family: var(--font-mono);
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 0 0 15px var(--hud-dim);
    line-height: 1;
}

.unit {
    font-size: 1rem;
    color: var(--hud-dim);
    text-transform: uppercase;
}

/* MAP INTERFACE */
#map-interface {
    flex-grow: 1;
    width: 100%;
    margin-bottom: 15px;
    border: 1px solid var(--hud-dim);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    min-height: 250px; 
}

#map-frame {
    width: 100%;
    height: 100%;
    background: #000;
}

/* Dark Mode Map Filter */
.leaflet-layer,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control-attribution {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}


/* DATA GRID */
.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.data-cell {
    background: rgba(0, 255, 65, 0.05); /* Very slight tint */
    border: 1px solid var(--hud-dim);
    padding: 10px;
    border-radius: 8px;
    position: relative;
}

.label {
    font-size: 0.7rem;
    color: var(--hud-dim);
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.value {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 2px rgba(255,255,255,0.5);
}

.unit-small {
    position: absolute;
    right: 8px;
    bottom: 8px;
    font-size: 0.7rem;
    color: var(--hud-dim);
}

/* FOOTER */
.footer-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--hud-dim);
    font-family: var(--font-mono);
    border-top: 1px solid var(--hud-dim);
    padding-top: 10px;
}

#source-type {
    color: var(--hud-alert);
}

/* CONTROLS ROW */
.control-row {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

button {
  flex: 1;
  background: transparent;
  border: 1px solid var(--hud-dim);
  color: var(--hud-dim);
  font-family: var(--font-mono);
  padding: 10px;
  cursor: pointer;
  font-size: 0.9em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  border-radius: 4px;
}

button:hover {
  border-color: var(--hud-color);
  color: var(--hud-color);
  background: rgba(0, 255, 65, 0.1);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

#install-btn.hidden {
  display: none;
}

/* RESPONSIVE TWEAKS */
@media (max-width: 360px) {
    .compass-ring { width: 180px; height: 180px; }
    #speed-val { font-size: 3rem; }
}
