/* ============================================================
   F400 ANALYTICS
   Diseño profesional - estilo panel de competición
   ============================================================ */


/* ============================================================
   CONTENEDOR PRINCIPAL
   ============================================================ */

.f400-analytics {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 18px 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Arial, sans-serif;
    color: #1f2937;
}


/* ============================================================
   CABECERA
   ============================================================ */


/* ============================================================
   PANEL DE FILTROS
   ============================================================ */

.f400-analytics .form-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .08);
}


/* Filas */

.f400-analytics .form-table tr {
    border-bottom: 1px solid #e5e7eb;
}

.f400-analytics .form-table tr:last-child {
    border-bottom: none;
}


/* Etiquetas */

.f400-analytics .form-table th {
    width: 220px;
    padding: 16px 20px;
    background: #f8fafc;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    vertical-align: middle;
}


/* Celdas */

.f400-analytics .form-table td {
    padding: 13px 20px;
    background: #ffffff;
}


/* ============================================================
   SELECTS
   ============================================================ */

.f400-analytics select {
    width: 100%;
    min-height: 44px;
    padding: 9px 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    color: #111827;
    font-size: 14px;
    line-height: 1.4;
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background-color .2s ease;
}


/* Select múltiple */

.f400-analytics select[multiple] {
    min-height: 115px;
    padding: 6px;
}


/* Hover */

.f400-analytics select:hover:not(:disabled) {
    border-color: #9ca3af;
}


/* Focus */

.f400-analytics select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}


/* Deshabilitado */

.f400-analytics select:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}


/* ============================================================
   BOTÓN COMPARAR
   ============================================================ */

.f400-comparar-boton-container {
    margin: 20px 0 30px;
    text-align: center;
}


#f400-comparar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 210px;
    padding: 13px 30px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .5px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(153, 27, 27, .25);
    transition:
        transform .15s ease,
        box-shadow .2s ease,
        opacity .2s ease;
}


#f400-comparar:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 20px rgba(153, 27, 27, .32);
}


#f400-comparar:active {
    transform: translateY(0);
}


#f400-comparar:focus {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(220, 38, 38, .18),
        0 7px 18px rgba(153, 27, 27, .25);
}


/* ============================================================
   ZONA DE RESULTADOS
   ============================================================ */

#f400-resultados {
    width: 100%;
}


/* ============================================================
   TÍTULOS DE RESULTADOS
   ============================================================ */

.f400-resumen-comparacion h3,
.f400-resultados-individuales h3 {
    margin: 0;
    padding: 17px 20px;
    background: #111827;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
}


/* ============================================================
   TARJETAS DE RESULTADOS
   ============================================================ */

.f400-resumen-comparacion,
.f400-resultados-individuales {
    margin-bottom: 25px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .08);
}


/* ============================================================
   TABLAS
   ============================================================ */

.f400-resumen-comparacion table,
.f400-resultados-individuales table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    border-spacing: 0;
}


/* Cabecera */

.f400-resumen-comparacion thead th,
.f400-resultados-individuales thead th {
    padding: 13px 12px;
    background: #f3f4f6;
    color: #374151;
    border-bottom: 2px solid #d1d5db;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .35px;
    white-space: nowrap;
}


/* Celdas */

.f400-resumen-comparacion tbody td,
.f400-resultados-individuales tbody td {
    padding: 13px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    vertical-align: middle;
}


/* Última fila */

.f400-resumen-comparacion tbody tr:last-child td,
.f400-resultados-individuales tbody tr:last-child td {
    border-bottom: none;
}


/* ============================================================
   EFECTO HOVER FILAS
   ============================================================ */

.f400-resumen-comparacion tbody tr,
.f400-resultados-individuales tbody tr {
    transition: background-color .15s ease;
}


.f400-resumen-comparacion tbody tr:hover,
.f400-resultados-individuales tbody tr:hover {
    background-color: #f8fafc;
}


/* ============================================================
   CHASIS
   ============================================================ */

.f400-resumen-comparacion td:first-child {
    font-weight: 800;
    color: #111827;
}


.f400-resumen-comparacion td:first-child strong {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 6px;
    background: #eef2ff;
    color: #3730a3;
}


/* ============================================================
   TIEMPOS
   ============================================================ */

.f400-resumen-comparacion td:nth-child(3),
.f400-resumen-comparacion td:nth-child(4),
.f400-resumen-comparacion td:nth-child(5),
.f400-resultados-individuales td:nth-child(4),
.f400-resultados-individuales td:nth-child(5),
.f400-resultados-individuales td:nth-child(6) {
    font-family: "Roboto Mono", "Courier New", monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}


/* ============================================================
   TIEMPOS EN NEGRITA
   ============================================================ */

/*
 * Resumen:
 * 3 = Mejor crono
 * 4 = Mejor vuelta M1
 * 5 = Mejor vuelta M2
 *
 * Resultados individuales:
 * 4 = Crono
 * 5 = Mejor vuelta M1
 * 6 = Mejor vuelta M2
 *
 * Los seis valores se muestran ahora en negrita
 * para mejorar claramente la legibilidad.
 */

.f400-resumen-comparacion td:nth-child(3),
.f400-resumen-comparacion td:nth-child(4),
.f400-resumen-comparacion td:nth-child(5),
.f400-resultados-individuales td:nth-child(4),
.f400-resultados-individuales td:nth-child(5),
.f400-resultados-individuales td:nth-child(6) {
    font-weight: 800;
}


/* ============================================================
   NOMBRE DEL PILOTO BAJO EL MEJOR TIEMPO
   ============================================================ */

.f400-resumen-comparacion td small {
    display: inline-block;
    margin-top: 4px;
    color: #6b7280;
    font-family: -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 11px;
    font-weight: 500;
}


/* ============================================================
   FOTO + PILOTO
   ============================================================ */

.f400-piloto {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 170px;
}


.f400-foto-piloto {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
}


.f400-piloto span {
    font-weight: 700;
    color: #111827;
}


/* ============================================================
   FECHA
   ============================================================ */

.f400-resultados-individuales td:last-child {
    color: #6b7280;
    font-size: 13px;
    white-space: nowrap;
}


/* ============================================================
   CONCLUSIONES
   ============================================================ */

.f400-conclusion-comparativa {
    position: relative;
    margin: 10px 0;
    padding: 14px 18px 14px 45px;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 14px;
    line-height: 1.5;
}


/* Indicador lateral */

.f400-conclusion-comparativa::before {
    content: "✓";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 800;
}


/* Chasis ganador */

.f400-conclusion-comparativa strong {
    font-weight: 800;
}


/* ============================================================
   MENSAJES
   ============================================================ */

#f400-resultados > p {
    margin: 20px 0;
    padding: 18px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #4b5563;
    text-align: center;
}


/* ============================================================
   SCROLL HORIZONTAL PARA TABLAS
   ============================================================ */

.f400-resumen-comparacion,
.f400-resultados-individuales {
    overflow-x: auto;
}


/* ============================================================
   MÓVIL
   ============================================================ */

@media (max-width: 768px) {

    .f400-analytics {
        margin: 15px auto;
        padding: 0 10px 30px;
    }


    .f400-analytics .form-table {
        display: block;
    }


    .f400-analytics .form-table tbody {
        display: table-row-group;
    }


    .f400-analytics .form-table th {
        width: auto;
        display: block;
        padding: 12px 15px 5px;
        border-bottom: none;
    }


    .f400-analytics .form-table td {
        display: block;
        padding: 5px 15px 14px;
    }


    .f400-analytics select {
        min-height: 42px;
    }


    #f400-comparar {
        width: 100%;
        min-width: 0;
    }


    .f400-resumen-comparacion h3,
    .f400-resultados-individuales h3 {
        font-size: 16px;
        padding: 15px;
    }


    .f400-resumen-comparacion table,
    .f400-resultados-individuales table {
        min-width: 700px;
    }


    .f400-conclusion-comparativa {
        font-size: 13px;
    }

}


/* ============================================================
   MÓVIL PEQUEÑO
   ============================================================ */

@media (max-width: 480px) {


    .f400-conclusion-comparativa {
        padding-left: 40px;
    }


    .f400-foto-piloto {
        width: 34px;
        height: 34px;
    }

}

/* ============================================================
   BOTÓN CIRCUITOS Y VARIANTES
   ============================================================ */

.f400-circuitos-enlace {
    margin: -8px 0 18px;
    text-align: right;
}

.f400-boton-circuitos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 8px;

    background: linear-gradient(135deg, #2563eb, #1d4ed8);

    color: #ffffff !important;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
    letter-spacing: .35px;

    box-shadow: 0 5px 14px rgba(37, 99, 235, .25);

    transition:
        background .2s ease,
        transform .15s ease,
        box-shadow .2s ease;
}

.f400-boton-circuitos:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #ffffff !important;

    transform: translateY(-2px);

    box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
}

.f400-boton-circuitos:active {
    transform: translateY(0);
}


/* ============================================================
   MÓVIL
   ============================================================ */

@media (max-width: 768px) {

    .f400-circuitos-enlace {
        margin: -5px 0 15px;
        text-align: center;
    }

    .f400-boton-circuitos {
        width: 100%;
        box-sizing: border-box;
    }

}

/* ============================================================
   CRÉDITOS
   ============================================================ */

.f400-creditos {
    margin: -15px 0 28px;
    text-align: center;

    color: #9ca3af;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .25px;
}

.f400-creditos::before {
    content: "— ";
}

.f400-creditos::after {
    content: " —";
}

/* ============================================================
   CABECERA E INTRODUCCIÓN
   ============================================================ */

.f400-analytics > h2 {
    margin: 0 0 20px;
    padding: 22px 25px;
    border-radius: 12px;
    background: linear-gradient(135deg, #111827, #1f2937);
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: .3px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .12);
}


/* Descripción */

.f400-introduccion {
    margin-bottom: 20px;
    padding: 22px 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .06);
}


.f400-descripcion-principal {
    margin: 0 0 12px;
    color: #1f2937;
    font-size: 15px;
    line-height: 1.65;
}


.f400-descripcion-secundaria {
    margin: 0 0 18px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.6;
}


/* ============================================================
   MODOS DE ANÁLISIS
   ============================================================ */

.f400-modos-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 18px;
}


.f400-modo-info {
    padding: 16px 18px;
    background: #f8fafc;
    border-left: 4px solid #2563eb;
    border-radius: 8px;
}


.f400-modo-info h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 15px;
    font-weight: 800;
}


.f400-modo-info p {
    margin: 0;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.55;
}


/* Nota final */

.f400-nota-info {
    margin: 0;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
}