/* ========================================
   RACE DASHBOARD - TELEMETRIA E DADOS
   ======================================== */

.race-dashboard {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(135deg,
        rgba(10, 10, 10, 0.98) 0%,
        rgba(26, 26, 26, 0.98) 100%);
    border: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 60px rgba(255, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    animation: dashboard-glow 4s ease-in-out infinite;
}

@keyframes dashboard-glow {
    0%, 100% {
        box-shadow:
            0 20px 40px rgba(0, 0, 0, 0.8),
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            0 0 60px rgba(255, 0, 0, 0.1);
    }
    50% {
        box-shadow:
            0 20px 40px rgba(0, 0, 0, 0.8),
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            0 0 80px rgba(255, 0, 0, 0.2);
    }
}

/* Grid Pattern Background */
.race-dashboard::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(192, 192, 192, 0.1);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--red);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
    animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 8px rgba(255, 0, 0, 0);
    }
}

.session-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.session-type {
    font-size: 0.7rem;
    color: var(--silver);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.session-time {
    font-family: 'Teko', sans-serif;
    font-size: 1.2rem;
    color: var(--white);
    font-weight: 600;
}

/* Main Stats */
.main-stats {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Position Display */
.position-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.position-current,
.lap-info {
    background: rgba(255, 0, 0, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.2);
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pos-label,
.lap-label {
    font-size: 0.7rem;
    color: var(--silver);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pos-number {
    font-family: 'Teko', sans-serif;
    font-size: 1.8rem;
    color: var(--red);
    font-weight: 700;
    line-height: 1;
}

.lap-number {
    font-family: 'Teko', sans-serif;
    font-size: 1.2rem;
    color: var(--white);
    font-weight: 600;
}

/* Lap Times */
.lap-times {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.time-block {
    background: rgba(192, 192, 192, 0.05);
    border: 1px solid rgba(192, 192, 192, 0.1);
    padding: 0.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.time-block:hover {
    background: rgba(192, 192, 192, 0.1);
    border-color: rgba(192, 192, 192, 0.2);
}

.time-block.best {
    border-color: rgba(138, 43, 226, 0.3);
    background: rgba(138, 43, 226, 0.05);
}

.time-label {
    display: block;
    font-size: 0.6rem;
    color: var(--silver);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
}

.time-value {
    font-family: 'Teko', sans-serif;
    font-size: 1.1rem;
    color: var(--white);
    font-weight: 600;
}

.delta-positive {
    color: #ff4444;
}

.delta-negative {
    color: #44ff44;
}

/* Performance Chart */
.performance-chart {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 1rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chart-header span:first-child {
    color: var(--silver);
}

.chart-status {
    color: #44ff44;
    font-weight: 600;
}

/* Sectors Compacto */
.sectors-compact {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.sector-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background: rgba(192, 192, 192, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(192, 192, 192, 0.1);
    flex: 1;
}

.sector-mini.purple {
    background: rgba(138, 43, 226, 0.1);
    border-color: rgba(138, 43, 226, 0.3);
}

.sector-mini .sector-label {
    font-size: 0.7rem;
    color: var(--silver);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.sector-mini .sector-time {
    font-family: 'Teko', sans-serif;
    font-size: 1rem;
    color: var(--white);
    font-weight: 600;
}

.sector-mini.purple .sector-time {
    color: #9b59b6;
}

/* Telemetry Data */
.telemetry-data {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.telemetry-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem;
    background: rgba(255, 0, 0, 0.03);
    border: 1px solid rgba(255, 0, 0, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.telemetry-item:hover {
    background: rgba(255, 0, 0, 0.05);
    border-color: rgba(255, 0, 0, 0.2);
    transform: translateY(-2px);
}

.telemetry-item i {
    font-size: 1.2rem;
    color: var(--red);
}

.telemetry-info {
    text-align: center;
}

.telemetry-label {
    display: block;
    font-size: 0.6rem;
    color: var(--silver);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
}

.telemetry-value {
    font-family: 'Teko', sans-serif;
    font-size: 1.1rem;
    color: var(--white);
    font-weight: 600;
}

/* Track Map */
.track-map {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(192, 192, 192, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.map-container {
    position: relative;
    height: 120px;
}

.track-svg {
    width: 100%;
    height: 100%;
}

.car-position {
    animation: pulse-car 1s ease-in-out infinite;
}

@keyframes pulse-car {
    0%, 100% {
        opacity: 1;
        r: 4;
    }
    50% {
        opacity: 0.8;
        r: 6;
    }
}

.track-name {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.7rem;
    color: var(--silver);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Quick Standings */
.quick-standings {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.standing-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: rgba(192, 192, 192, 0.03);
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.standing-row:hover {
    background: rgba(192, 192, 192, 0.05);
}

.standing-row.leader {
    border-left-color: #ffd700;
    background: rgba(255, 215, 0, 0.05);
}

.standing-row.current {
    border-left-color: var(--red);
    background: rgba(255, 0, 0, 0.05);
}

.standing-pos {
    font-family: 'Teko', sans-serif;
    font-size: 1rem;
    color: var(--white);
    font-weight: 600;
}

.standing-driver {
    font-size: 0.9rem;
    color: var(--silver);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.standing-row.current .standing-driver {
    color: var(--red);
    font-weight: 700;
}

.standing-gap {
    font-family: 'Teko', sans-serif;
    font-size: 0.9rem;
    color: var(--silver);
}

/* Dashboard Footer */
.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(192, 192, 192, 0.1);
}

.footer-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--silver);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-stat i {
    color: #44ff44;
    font-size: 0.8rem;
}

/* Animações de Dados */
@keyframes data-update {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.time-value,
.telemetry-value,
.standing-gap {
    animation: data-update 3s ease-in-out infinite;
}

/* Responsividade */
@media (max-width: 768px) {
    .race-dashboard {
        max-width: 100%;
        padding: 0.8rem;
        margin: 0 auto;
    }

    .main-stats {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .lap-times {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }

    .time-block {
        padding: 0.4rem;
    }

    .time-label {
        font-size: 0.55rem;
    }

    .time-value {
        font-size: 0.95rem;
    }

    .telemetry-data {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .telemetry-item {
        padding: 0.5rem;
    }

    .telemetry-item i {
        font-size: 1rem;
    }

    .telemetry-label {
        font-size: 0.55rem;
    }

    .telemetry-value {
        font-size: 0.95rem;
    }

    .sectors-compact {
        gap: 0.5rem;
    }

    .sector-mini {
        padding: 0.4rem;
    }

    .sector-mini .sector-label {
        font-size: 0.6rem;
    }

    .sector-mini .sector-time {
        font-size: 0.9rem;
    }

    .performance-chart {
        padding: 0.6rem;
    }

    .chart-header {
        font-size: 0.7rem;
        margin-bottom: 0.8rem;
    }

    .position-current,
    .lap-info {
        padding: 0.4rem;
    }

    .pos-number {
        font-size: 1.5rem;
    }

    .lap-number {
        font-size: 1rem;
    }

    .dashboard-footer {
        padding-top: 0.8rem;
    }

    .footer-stat {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .race-dashboard {
        padding: 0.6rem;
        border-width: 1px;
    }

    .dashboard-header {
        margin-bottom: 0.8rem;
        padding-bottom: 0.6rem;
    }

    .live-indicator {
        font-size: 0.7rem;
    }

    .live-dot {
        width: 6px;
        height: 6px;
    }

    .session-type {
        font-size: 0.65rem;
    }

    .main-stats {
        gap: 0.6rem;
    }

    .lap-times {
        gap: 0.3rem;
    }

    .time-block {
        padding: 0.3rem;
    }

    .time-label {
        font-size: 0.5rem;
    }

    .time-value {
        font-size: 0.85rem;
    }

    .telemetry-data {
        gap: 0.4rem;
    }

    .telemetry-item {
        padding: 0.4rem;
    }

    .telemetry-item i {
        font-size: 0.9rem;
    }

    .telemetry-label {
        font-size: 0.5rem;
    }

    .telemetry-value {
        font-size: 0.85rem;
    }

    .performance-chart {
        padding: 0.5rem;
    }

    .chart-header {
        font-size: 0.65rem;
    }

    .sectors-compact {
        gap: 0.4rem;
    }

    .sector-mini {
        padding: 0.3rem;
    }

    .sector-mini .sector-label {
        font-size: 0.55rem;
    }

    .sector-mini .sector-time {
        font-size: 0.8rem;
    }

    .pos-number {
        font-size: 1.3rem;
    }

    .lap-number {
        font-size: 0.9rem;
    }

    .pos-label,
    .lap-label {
        font-size: 0.6rem;
    }

    .footer-stat {
        font-size: 0.6rem;
    }
}

/* Efeito de Scanner */
.race-dashboard::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 0, 0, 0.1) 50%,
        transparent 100%);
    animation: scanner 8s linear infinite;
    pointer-events: none;
}

@keyframes scanner {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}