/**
 * ============================================================================
 * SISTEMA: F1 TELEMETRY & SIMULATOR WEB (MVP)
 * ARQUIVO: assets/css/cockpit.css
 * DESCRIÇÃO: Estilização visual do painel de telemetria (HUD), barra de LEDs
 *            de RPM de volante F1, estados de DRS, scrollbar customizada,
 *            animações de notificações toast e prevenção de gestos mobile.
 * ============================================================================
 */

/* ============================================================================
   SEÇÃO 01: RESET DE VIEWPORT, TRAVA DE TOQUE E RENDERS WEBGL
   ============================================================================ */
html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #07080c;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

#f1-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    cursor: crosshair;
}

/* ============================================================================
   SEÇÃO 02: GRID CUSTOMIZADO DE 15 COLUNAS PARA LEDS DE ROTAÇÃO (RPM)
   ============================================================================ */
.grid-cols-15 {
    display: grid;
    grid-template-columns: repeat(15, minmax(0, 1fr));
}

.rpm-led {
    transition: background-color 45ms linear, box-shadow 45ms linear, transform 45ms linear;
    background-color: rgba(255, 255, 255, 0.08);
}

/* LEDs 1 a 5: Faixa Verde de Potência */
.rpm-led.active-green {
    background-color: #00e676;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.85), 0 0 2px #ffffff;
}

/* LEDs 6 a 10: Faixa Vermelha de Alta Rotação */
.rpm-led.active-red {
    background-color: #ff1744;
    box-shadow: 0 0 12px rgba(255, 23, 68, 0.9), 0 0 2px #ffffff;
}

/* LEDs 11 a 15: Faixa Azul/Violeta de Troca Ideal (Shift Point) */
.rpm-led.active-blue {
    background-color: #00f0ff;
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.95), 0 0 3px #ffffff;
}

/* Animação de Corte de Giro (Rev Limiter Flash) */
@keyframes revLimiterFlash {
    0%, 100% {
        opacity: 1;
        transform: scaleY(1.15);
    }
    50% {
        opacity: 0.25;
        transform: scaleY(0.95);
    }
}

.rpm-led.rev-limiter {
    animation: revLimiterFlash 90ms infinite;
}

/* ============================================================================
   SEÇÃO 03: INDICADORES DE TELEMETRIA (DRS, SETORES E BADGE GAMEPAD)
   ============================================================================ */
#hud-drs-badge.drs-available {
    border-color: rgba(255, 184, 0, 0.45);
    background-color: rgba(255, 184, 0, 0.12);
    color: #ffb800;
}

#hud-drs-badge.drs-active {
    border-color: #00e676;
    background-color: rgba(0, 230, 118, 0.22);
    color: #00e676;
    box-shadow: 0 0 16px rgba(0, 230, 118, 0.35);
}

/* Cores de Setores Estilo Cronometragem Oficial F1 */
.sector-purple {
    border-color: rgba(192, 38, 211, 0.65) !important;
    background-color: rgba(192, 38, 211, 0.18) !important;
}

.sector-purple span:last-child {
    color: #e879f9 !important;
}

.sector-green {
    border-color: rgba(0, 230, 118, 0.55) !important;
    background-color: rgba(0, 230, 118, 0.14) !important;
}

.sector-green span:last-child {
    color: #00e676 !important;
}

.sector-yellow {
    border-color: rgba(255, 184, 0, 0.45) !important;
    background-color: rgba(255, 184, 0, 0.12) !important;
}

.sector-yellow span:last-child {
    color: #ffb800 !important;
}

/* Badge de Controle Xbox Conectado */
#gamepad-status-badge.connected {
    border-color: rgba(0, 230, 118, 0.45);
    background-color: rgba(13, 15, 23, 0.88);
}

#gamepad-status-badge.connected #gamepad-icon {
    color: #00e676;
    filter: drop-shadow(0 0 6px rgba(0, 230, 118, 0.6));
}

/* ============================================================================
   SEÇÃO 04: PAINÉIS HUD, BOTÕES E EFEITO FIBRA DE CARBONO SUTIL
   ============================================================================ */
.hud-panel {
    background-image: linear-gradient(
        145deg,
        rgba(21, 25, 38, 0.86) 0%,
        rgba(9, 11, 18, 0.92) 100%
    );
    box-shadow:
        0 18px 40px -12px rgba(0, 0, 0, 0.75),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
}

.hud-action-btn {
    cursor: pointer;
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.6);
}

.hud-action-btn:active {
    transform: scale(0.96);
}

/* ============================================================================
   SEÇÃO 05: SCROLLBAR CUSTOMIZADA DO MODAL DE GARAGEM
   ============================================================================ */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(7, 8, 12, 0.6);
    border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.32);
}

/* ============================================================================
   SEÇÃO 06: ANIMAÇÕES DE NOTIFICAÇÕES TOAST NATIVAS
   ============================================================================ */
@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(24px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastFadeOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(16px);
    }
}

.apex-toast {
    animation: toastSlideIn 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.apex-toast.hiding {
    animation: toastFadeOut 220ms ease-in forwards;
}

/* ============================================================================
   SEÇÃO 07: RESPONSIVIDADE PARA TELAS MENORES E FUTURO MODO MOBILE PWA
   ============================================================================ */
@media (max-width: 640px) {
    #hud-top {
        padding: 0.75rem;
    }

    #hud-bottom {
        padding: 0.75rem;
    }

    #hud-current-time {
        font-size: 1.25rem;
    }
}