:root {
    --bg-color: #050a15;
    --panel-bg: rgba(12, 22, 45, 0.7);
    --border-color: rgba(45, 212, 191, 0.3);
    --primary-neon: #2dd4bf; /* Cyan/Teal */
    --secondary-neon: #818cf8; /* Indigo/Purple */
    --danger-neon: #f43f5e; /* Red/Pink */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(45, 212, 191, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(129, 140, 248, 0.05), transparent 25%);
}

.dashboard {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.5rem;
    gap: 1.5rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text-main);
}

.logo span {
    color: var(--primary-neon);
    text-shadow: 0 0 10px rgba(45, 212, 191, 0.5);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #eab308; /* Yellow for sim mode */
    box-shadow: 0 0 10px #eab308;
    animation: pulse 2s infinite;
}

.dot.connected {
    background-color: var(--primary-neon);
    box-shadow: 0 0 10px var(--primary-neon);
}

.system-time {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: var(--primary-neon);
}

/* Main Layout */
.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

.main-content .map-panel {
    min-width: 420px;
    min-height: 420px;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.8rem;
}

.panel-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.badge {
    background: rgba(45, 212, 191, 0.1);
    color: var(--primary-neon);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    border: 1px solid var(--primary-neon);
    font-family: 'Orbitron', sans-serif;
}

/* Map Section */
.map-panel {
    flex: 2;
    position: relative;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: #02040a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    image-rendering: pixelated; /* To make costmap look sharp */
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(45, 212, 191, 0.1));
}

.crosshair {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: 
        linear-gradient(transparent 49.5%, rgba(45, 212, 191, 0.2) 49.5%, rgba(45, 212, 191, 0.2) 50.5%, transparent 50.5%),
        linear-gradient(90deg, transparent 49.5%, rgba(45, 212, 191, 0.2) 49.5%, rgba(45, 212, 191, 0.2) 50.5%, transparent 50.5%);
}

.robot-avatar {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary-neon);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary-neon);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.arrow-up {
    width: 0; 
    height: 0; 
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #fff;
    margin-top: -12px;
}

.legend {
    display: flex;
    gap: 20px;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}
.color-box.free { background: #02040a; border: 1px solid #333; }
.color-box.danger { background: rgba(129, 140, 248, 0.6); }
.color-box.obstacle { background: var(--danger-neon); box-shadow: 0 0 8px var(--danger-neon); }

/* Sidebar */
.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.telemetry-panel {
    flex: 1;
}

.data-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.data-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
}

.data-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.highlight { color: var(--primary-neon); text-shadow: 0 0 15px rgba(45, 212, 191, 0.4); }
.highlight-alt { color: var(--secondary-neon); text-shadow: 0 0 15px rgba(129, 140, 248, 0.4); }

.unit {
    font-size: 1rem;
    color: var(--text-muted);
    text-shadow: none;
}

.progress-bar-bg {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-neon);
    box-shadow: 0 0 10px var(--primary-neon);
    transition: width 0.2s ease-out;
}

.steering-wheel {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wheel {
    width: 60px;
    height: 60px;
    border: 4px solid var(--secondary-neon);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.4);
    transition: transform 0.1s ease-out;
}

.wheel-spoke {
    position: absolute;
    width: 100%;
    height: 4px;
    background: var(--secondary-neon);
    top: 50%;
    transform: translateY(-50%);
}

.ai-status {
    border-color: var(--primary-neon);
    background: rgba(45, 212, 191, 0.05);
}

.status-text.active {
    color: var(--primary-neon);
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 0.5rem;
}

.status-detail {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-muted);
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}
