/* ============================================
   TESLA OS INTERFACE - INDEX (REALISTIC V11/V12)
   ============================================ */

:root {
    --bg-black: #000000;
    --panel-dark: #111111;
    --panel-light-dark: #1c1c1e;
    --text-main: #ffffff;
    --text-muted: #8e8e93;
    --tesla-blue: #3e82f7;
    --font-main:
        -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
        sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-black);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

.screen-container {
    display: grid;
    grid-template-columns: 300px 1fr; /* 1/3 Carro, 2/3 Mapa */
    grid-template-rows: 1fr 80px; /* Corpo e Dock inferior */
    height: 100%;
    width: 100%;
}

/* --- PAINEL DIREITO: MAPA --- */
.map-area {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    position: relative;
    background-color: #1a1b1e;
    overflow: hidden;
}

.map-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Fake map streets pattern */
    background-image:
        linear-gradient(#2a2b2e 1px, transparent 1px),
        linear-gradient(90deg, #2a2b2e 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
}

.floating-top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
}

.nav-search {
    background: rgba(30, 30, 32, 0.9);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    width: 350px;
    cursor: pointer;
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

#lock-icon {
    cursor: pointer;
}

/* --- PAINEL ESQUERDO: VEÍCULO --- */
.vehicle-area {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    background: var(--panel-dark);
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-right: 1px solid #222;
    position: relative;
}

.gear-selector {
    display: flex;
    gap: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
}

.gear {
    cursor: pointer;
    transition: color 0.2s;
}
.gear.active {
    color: var(--text-main);
    font-weight: 700;
}
.gear#gear-d:hover {
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.speed-display {
    margin-top: 20px;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.speed-number {
    font-size: 5.5rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -2px;
}

.speed-unit {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.battery-indicator {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.battery-line {
    flex: 1;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.battery-fill {
    height: 100%;
    background: #4cd964; /* Verde bateria */
}

.battery-pct {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.car-visualization {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tesla-car-top {
    width: 120px;
    height: 260px;
    background: linear-gradient(180deg, #444 0%, #222 100%);
    border-radius: 40px 40px 30px 30px;
    position: relative;
    box-shadow:
        inset 0 0 15px rgba(255, 255, 255, 0.1),
        0 20px 30px rgba(0, 0, 0, 0.5);
}

.car-roof {
    position: absolute;
    top: 30%;
    left: 10%;
    right: 10%;
    bottom: 25%;
    background: #111;
    border-radius: 30px 30px 20px 20px;
}

.action-prompt {
    position: absolute;
    bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.blink {
    animation: blinker 2s linear infinite;
}
@keyframes blinker {
    50% {
        opacity: 0.3;
    }
}

/* --- DOCK INFERIOR --- */
.bottom-dock {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    background: var(--panel-black);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-top: 1px solid #222;
}

.dock-left,
.dock-right,
.dock-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dock-center {
    flex: 1;
    justify-content: center;
    gap: 25px;
}

.dock-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dock-btn:hover,
.dock-btn.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.temp-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.3rem;
    font-weight: 500;
    cursor: pointer;
}

/* --- AVISO TESLA (Substituto do Cookie Popup) --- */
.tesla-alert {
    position: absolute;
    bottom: 40px;
    right: 20px;
    width: 320px;
    background: var(--panel-light-dark);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    z-index: 100;
    transition: opacity 0.3s;
}

.tesla-alert.hidden {
    opacity: 0;
    pointer-events: none;
}

.tesla-alert h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 500;
}
.tesla-alert p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.4;
}

.alert-actions {
    display: flex;
    gap: 10px;
}
.alert-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}
.btn-primary {
    background: var(--tesla-blue);
    color: white;
}
.btn-secondary {
    background: #333;
    color: white;
}

/* Responsividade (Para ecrãs mais pequenos, empilhar) */
@media (max-width: 800px) {
    .screen-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto 70px;
    }
    .map-area {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    .vehicle-area {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        height: 150px;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid #222;
        align-items: center;
        justify-content: space-around;
    }
    .car-visualization {
        display: none;
    } /* Oculta o carro em mobile para poupar espaço */
    .bottom-dock {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }
    .nav-search {
        width: auto;
        flex: 1;
    }
}
