/* public/style.css */

body {
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: auto; /* Allow scrolling if maze is huge */
}

/* --- GAME CONTAINER --- */
#game-container {
    position: relative;
    
    /* Remove min-width/width 100vw so JS can set the real size */
    /* display: block or inline-block is fine */
    display: block; 
    
    background-color: #222;
    margin: 20px auto; /* Optional: Centers the maze on screen */
    
    /* Ensure the container expands to fit the floating children */
    overflow: hidden; 
}

/* --- MAZE GRID SYSTEM --- */

/* Remove #game-container specific display rules, JS handles it */

/* 1. Layout Behavior */
/* Grid items stretch to fill their slots automatically */
.wall, .tile {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    /* No floats needed! */
}

/* 2. Appearance */
.wall {
    background-color: #666; /* Wall color */
    z-index: 1;
}

.tile {
    background-color: #2a2a2a; /* Floor color */
    z-index: 0;
}

/* Open Doors (Passable Walls) */
.tile.v, .tile.o, .tile.c {
    background-color: #2a2a2a; 
}


/* --- THE CAR --- */
.car {
    width: 20px;
    height: 10px;
    position: absolute; /* Car floats above the maze */
    z-index: 10;
    
    /* Center pivot for rotation */
    transform-origin: center center;
    
    /* Visuals */
    background-image: url('img/red_car.svg'); 
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent; 
}

.cursor.manual {
    filter: drop-shadow(0 0 4px white); /* Glow in manual mode */
}

/* --- FINISH ZONE --- */
.finish-zone {
    position: absolute;
    background-color: rgba(0, 255, 0, 0.15);
    border: 2px dashed #00ff00;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 255, 0, 0.5);
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
}
.finish-zone::after {
    content: "FINISH";
}

/* --- DASHBOARD (2-Column) --- */
#dashboard {
    position: fixed; /* Fixed prevents it from scrolling away */
    top: 10px;
    right: 10px;
    width: 280px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    z-index: 1000;
}

.dash-panel {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.dash-panel:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.dash-panel h3 {
    margin: 0 0 10px 0;
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
}

.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.stat span:last-child {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: bold;
    color: #00C851;
}

.stat-row-compact {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
}

.half-stat {
    display: flex;
    justify-content: space-between;
    width: 48%;
}

.mono-val {
    font-family: 'Consolas', 'Courier New', monospace;
    color: #aaa;
}

/* RADAR GRIDS */
.radar-grid {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.radar-col {
    flex: 1; 
}

.col-header {
    text-align: center;
    color: #666;
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 6px;
    border-bottom: 1px solid #333;
    padding-bottom: 2px;
}

.bar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 5px;
}

.bar-row span:first-child {
    width: 30px; 
    text-align: right;
    margin-right: 6px;
    color: #ccc;
}

.bar-bg {
    flex-grow: 1;
    height: 6px;
    background: #333;
    margin-right: 6px;
    border-radius: 2px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0%;
    background-color: #00C851;
    transition: width 0.1s linear, background-color 0.1s;
}

.bar-row span:last-child {
    width: 20px;
    text-align: right;
    color: #888;
    font-size: 10px;
}

/* LOG PANEL */
.log-container {
    height: 100px; /* Fixed height */
    background-color: #111;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 5px;
    overflow-y: auto; /* Scrollable */
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: #ccc;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Individual Log Lines */
.log-line {
    border-bottom: 1px solid #222;
    padding: 2px 0;
}

.log-line.warn { color: #ffbb33; }
.log-line.action { color: #00C851; font-weight: bold; }

/* LOADING INDICATOR */
.dash-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading-text {
    color: #00C851;
    font-family: monospace;
    font-weight: bold;
    font-size: 1.2em;
}
