﻿/* ========================================
   PILOT DETAILS - STILE COMUNE
   ======================================== */

/* Container principale */
.details-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Pilota */
.pilot-header {
    background: linear-gradient(135deg, #FAA500 0%, #000000 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.pilot-header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 30px;
    align-items: center;
}

.pilot-number-badge {
    background: white;
    color: #FAA500;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5em;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.pilot-info {
    flex: 1;
}

.pilot-name {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.pilot-meta {
    display: flex;
    gap: 30px;
    font-size: 1.1em;
    opacity: 0.95;
}

.pilot-meta-item {
    display: flex;
    flex-direction: column;
}

.pilot-meta-label {
    font-size: 0.8em;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.pilot-final-time {
    text-align: right;
}

.final-time-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.final-time-value {
    font-size: 3em;
    font-weight: 900;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Link indietro */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #f8f9fa;
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

    .back-link:hover {
        background: #FAA500;
        color: white;
        transform: translateX(-5px);
    }

/* Card per manche (gimkana) */
.manche-cards-container {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.manche-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 5px solid #FAA500;
}

.manche-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.manche-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #FAA500;
    margin: 0;
}

.manche-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #000;
}

    .stat-value.penalty {
        color: #dc3545;
    }

    .stat-value.total {
        color: #FAA500;
        font-size: 2.2em;
    }

    .stat-value.disqualified {
        color: #dc3545;
        font-weight: 900;
    }

/* Sezioni dati */
.data-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 5px solid #FAA500;
}

.data-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.data-section-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #FAA500;
    margin: 0;
}

/* Tabelle */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

    .table-modern thead {
        background: linear-gradient(135deg, #FAA500 0%, #000000 100%);
        color: white;
    }

        .table-modern thead th {
            padding: 15px 12px;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.85em;
            letter-spacing: 0.5px;
            text-align: center;
            border-right: 1px solid rgba(255, 255, 255, 0.2);
        }

            .table-modern thead th:last-child {
                border-right: none;
            }

    .table-modern tbody td {
        padding: 12px;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
        color: #000;
    }

    .table-modern tbody tr:hover {
        background-color: #f8f9fa;
    }

    .table-modern tbody tr:last-child td {
        border-bottom: none;
    }

    .table-modern tfoot {
        background-color: #f8f9fa;
        font-weight: 700;
    }

        .table-modern tfoot td,
        .table-modern tfoot th {
            padding: 15px 12px;
            border-top: 2px solid #FAA500;
        }

/* Badge penalità */
.penalty-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1em;
}

    .penalty-badge.positive {
        background-color: #fff3cd;
        color: #856404;
    }

    .penalty-badge.negative {
        background-color: #d1ecf1;
        color: #0c5460;
    }

    .penalty-badge.zero {
        background-color: #d4edda;
        color: #155724;
    }

/* Indicatore di aggiornamento */
.update-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background-color: #28a745;
    color: white;
    border-radius: 8px;
    display: none;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-size: 1em;
    font-weight: 500;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   DESKTOP - DEFAULT
   ======================================== */

/* Desktop: nascondi vista mobile */
.mobile-card-view {
    display: none;
}

/* Desktop: mostra tabella */
.table-desktop {
    display: block;
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media screen and (max-width: 768px) {
    .details-container {
        padding: 10px;
    }

    /* Header pilota mobile */
    .pilot-header {
        padding: 20px;
    }

    .pilot-header-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }

    .pilot-number-badge {
        margin: 0 auto;
        width: 100px;
        height: 100px;
        font-size: 2.5em;
    }

    .pilot-name {
        font-size: 1.8em;
    }

    .pilot-meta {
        flex-direction: column;
        gap: 15px;
    }

    .pilot-final-time {
        text-align: center;
    }

    .final-time-value {
        font-size: 2em;
    }

    /* Sezioni dati */
    .data-section {
        padding: 15px;
    }

    .data-section-title {
        font-size: 1.2em;
    }

    /* Tabelle desktop nascoste su mobile */
    .table-desktop {
        display: none !important;
    }

    /* Manche stats */
    .manche-stats {
        grid-template-columns: 1fr;
    }

    /* Update indicator */
    .update-indicator {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
        font-size: 0.9em;
        padding: 12px 15px;
    }

    /* Card mobile per passaggi (regolarità) - MOSTRA SOLO SU MOBILE */
    .mobile-card-view {
        display: block !important;
    }

    .passage-card {
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        border-left: 4px solid #FAA500;
    }

    .passage-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 2px solid #f0f0f0;
    }

        .passage-card-header strong {
            color: #000;
            font-size: 1em;
        }

    .passage-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        font-size: 0.95em;
    }

    .passage-card-item {
        display: flex;
        flex-direction: column;
        background: #f8f9fa;
        padding: 10px;
        border-radius: 6px;
    }

        .passage-card-item label {
            font-weight: 700;
            color: #666;
            font-size: 0.75em;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 5px;
        }

        .passage-card-item > div {
            font-size: 1.1em;
            font-weight: 600;
            color: #000;
            font-family: 'Courier New', monospace;
        }

    /* Card totale - PIÙ EVIDENTE */
    .total-card {
        background: linear-gradient(135deg, #FAA500 0%, #ff8c00 100%);
        color: white;
        font-weight: bold;
        border: none;
        box-shadow: 0 4px 12px rgba(250, 165, 0, 0.3);
    }

        .total-card .passage-card-header {
            border-bottom: 2px solid rgba(255,255,255,0.3);
        }

            .total-card .passage-card-header strong {
                color: white;
                font-size: 1.3em;
            }

        .total-card .passage-card-item {
            background: rgba(255,255,255,0.2);
        }

            .total-card .passage-card-item label {
                color: rgba(255,255,255,0.9);
                font-weight: 700;
            }

            .total-card .passage-card-item > div {
                color: white;
                font-size: 1.4em;
                font-weight: 900;
            }

        .total-card .penalty-badge {
            background: white;
            color: #FAA500;
            font-size: 1.3em;
            padding: 8px 16px;
        }
}
