/* ==========================================================
   CABECERA RESULTADOS
========================================================== */

.results-hero {
    padding: 48px 0;
    color: white;

    background:
        linear-gradient(
            135deg,
            #071b5b 0%,
            #123da8 60%,
            #1597df 100%
        );
}

.results-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.results-kicker {
    display: inline-block;
    margin-bottom: 7px;

    color: var(--cyan-400);

    font-size: 11px;
    font-weight: 900;

    text-transform: uppercase;
    letter-spacing: 0.10em;
}

.results-hero h1 {
    margin: 0 0 8px;

    font-size: clamp(38px, 5vw, 58px);
    line-height: 1;
}

.results-hero p {
    margin: 0;

    color: rgba(255,255,255,0.78);
    font-size: 16px;
}

.results-back {
    flex: 0 0 auto;

    padding: 11px 16px;

    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px;

    background: rgba(255,255,255,0.08);

    color: white;

    font-size: 13px;
    font-weight: 800;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.results-back:hover {
    background: rgba(255,255,255,0.16);
    transform: translateY(-1px);
}


/* ==========================================================
   CONTENIDO
========================================================== */

.results-section {
    padding: 55px 0 80px;
}


/* ==========================================================
   FILTROS
========================================================== */

.results-filters {
    margin-bottom: 18px;
    padding: 18px;

    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.4fr;
    gap: 14px;

    background: white;

    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow:
        0 8px 25px rgba(13,47,105,0.06);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    color: var(--text-700);

    font-size: 11px;
    font-weight: 800;

    text-transform: uppercase;
}

.filter-group select,
.filter-group input {
    width: 100%;
    height: 43px;

    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: white;
    color: var(--text-900);

    font: inherit;
    font-size: 13px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--cyan-500);

    box-shadow:
        0 0 0 3px rgba(25,183,242,0.10);
}


/* ==========================================================
   LEYENDA ESTADOS
========================================================== */

.status-legend {
    margin-bottom: 26px;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.legend-title {
    color: var(--text-500);

    font-size: 11px;
    font-weight: 800;
}

.legend-items {
    display: flex;
    align-items: center;
    gap: 7px;
}


/* ==========================================================
   RESUMEN
========================================================== */

.results-summary {
    margin-bottom: 28px;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.summary-card {
    padding: 18px 20px;

    background: white;

    border: 1px solid var(--border);
    border-radius: 14px;

    box-shadow:
        0 6px 18px rgba(13,47,105,0.04);
}

.summary-card span {
    display: block;
    margin-bottom: 5px;

    color: var(--text-500);

    font-size: 10px;
    font-weight: 900;

    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.summary-card strong {
    color: var(--blue-950);

    font-size: 24px;
    font-weight: 900;
}

.summary-card .summary-time {
    font-size: 16px;
}


/* ==========================================================
   LISTADO RESULTADOS
========================================================== */

.results-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.result-item {
    padding: 22px;

    background: white;

    border: 1px solid var(--border);
    border-radius: 18px;

    box-shadow:
        0 8px 24px rgba(13,47,105,0.05);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.result-item:hover {
    transform: translateY(-4px);

    border-color: #cad9eb;

    box-shadow:
        0 15px 34px rgba(13,47,105,0.10);
}

.result-item-unavailable {
    background: #fffafa;
    border-color: #f1cccc;
}

.result-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 18px;
}

.result-code {
    color: var(--text-500);

    font-size: 11px;
    font-weight: 900;
}

.result-discipline {
    display: inline-flex;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 900;
}


/* TIPOS */

.discipline-track {
    background: #e9f4ff;
    color: #1364b5;
}

.discipline-field {
    background: #e9f8f0;
    color: #2c8651;
}

.discipline-combined {
    background: #f2edff;
    color: #6c4ab6;
}

.discipline-para {
    background: #fff0e8;
    color: #b45a25;
}


.result-item h2 {
    margin: 0 0 6px;

    color: var(--blue-950);

    font-size: 22px;
}

.result-meta {
    min-height: 40px;
    margin-bottom: 18px;

    color: var(--text-500);

    font-size: 13px;
}

.result-meta strong {
    color: var(--text-700);
}

.result-item-bottom {
    padding-top: 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    border-top: 1px solid var(--border);
}


/* ==========================================================
   BOTÓN VER RESULTADO
========================================================== */

.result-open {
    padding: 0;

    border: 0;

    background: transparent;

    color: var(--blue-800);

    cursor: pointer;

    font-family: inherit;
    font-size: 13px;
    font-weight: 900;

    transition:
        color 0.2s ease;
}

.result-open:hover {
    color: var(--cyan-500);
    text-decoration: underline;
}

.result-open-unavailable {
    color: #b42318;
}

.result-open-unavailable:hover {
    color: #8f1c14;
}


/* ==========================================================
   ESTADOS

   VERDE    = OFICIAL
   AMARILLO = PROVISIONAL
   ROJO     = NO DISPONIBLE
========================================================== */

.result-state {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 7px 11px;

    border-radius: 999px;

    font-size: 9px;
    font-weight: 900;

    line-height: 1;

    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* OFICIAL */

.state-official {
    background: #daf5df;

    border: 1px solid #a4ddb0;

    color: #177437;
}


/* PROVISIONAL */

.state-provisional {
    background: #fff0b8;

    border: 1px solid #e8cf67;

    color: #846600;
}


/* NO DISPONIBLE */

.state-unavailable {
    background: #ffe1df;

    border: 1px solid #efaaa5;

    color: #b42318;
}


/* ==========================================================
   SIN RESULTADOS
========================================================== */

.no-results {
    display: none;

    margin-top: 20px;
    padding: 28px;

    background: white;

    border: 1px solid var(--border);
    border-radius: 16px;

    color: var(--text-500);

    text-align: center;

    font-size: 14px;
}


/* ==========================================================
   MODAL
========================================================== */

.result-modal {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;
}

.result-modal.active {
    display: flex;
}

.result-modal-overlay {
    position: absolute;

    inset: 0;

    background: rgba(4, 15, 46, 0.78);

    backdrop-filter: blur(4px);

    cursor: pointer;
}


/* ==========================================================
   VENTANA MODAL
========================================================== */

.result-modal-dialog {
    position: relative;

    z-index: 2;

    width: min(1120px, 100%);

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    background: white;

    border-radius: 22px;

    box-shadow:
        0 30px 80px rgba(0,0,0,0.30);

    animation:
        modalAppear 0.22s ease;
}

@keyframes modalAppear {

    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* ==========================================================
   CABECERA MODAL
========================================================== */

.result-modal-header {
    position: relative;

    padding: 26px 30px;

    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #071b5b 0%,
            #123da8 65%,
            #1597df 100%
        );
}

.result-modal-kicker {
    display: block;

    margin-bottom: 7px;

    color: var(--cyan-400);

    font-size: 10px;
    font-weight: 900;

    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.result-modal-header h2 {
    margin: 0 0 5px;

    color: white;

    font-size: 32px;

    line-height: 1.1;
}

.result-modal-header p {
    margin: 0;

    color: rgba(255,255,255,0.77);

    font-size: 14px;
}


/* ==========================================================
   BOTÓN CERRAR X
========================================================== */

.modal-close {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    display: grid;
    place-items: center;

    padding: 0;

    border: 1px solid rgba(255,255,255,0.30);
    border-radius: 50%;

    background: rgba(255,255,255,0.10);

    color: white;

    cursor: pointer;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 27px;

    line-height: 1;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.modal-close:hover {
    background: rgba(255,255,255,0.20);

    transform: rotate(5deg);
}


/* ==========================================================
   INFORMACIÓN SUPERIOR DEL MODAL
========================================================== */

.result-modal-info {
    padding: 17px 30px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 25px;

    background: #f7f9fc;

    border-bottom: 1px solid var(--border);
}

.modal-info-data {
    display: flex;

    align-items: center;
    flex-wrap: wrap;

    gap: 34px;
}

.modal-info-item {
    display: flex;

    flex-direction: column;

    gap: 2px;
}

.modal-info-item span {
    color: var(--text-500);

    font-size: 9px;
    font-weight: 900;

    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.modal-info-item strong {
    color: var(--blue-950);

    font-size: 13px;
}

.modal-state-area .result-state {
    padding: 9px 15px;

    font-size: 10px;
}


/* ==========================================================
   AVISO PROVISIONAL
========================================================== */

.provisional-warning {
    display: none;

    margin: 18px 30px 0;

    padding: 14px 16px;

    background: #fff7d6;

    border: 1px solid #ead479;

    border-left: 5px solid #dbb913;

    border-radius: 10px;
}

.provisional-warning.active {
    display: flex;

    flex-direction: column;

    gap: 2px;
}

.provisional-warning strong {
    color: #745b00;

    font-size: 13px;
}

.provisional-warning span {
    color: #806d23;

    font-size: 12px;
}


/* ==========================================================
   NO DISPONIBLE
========================================================== */

.unavailable-message {
    display: none;

    padding: 60px 30px 70px;

    text-align: center;
}

.unavailable-message.active {
    display: block;
}

.unavailable-icon {
    width: 62px;
    height: 62px;

    margin: 0 auto 17px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #ffe1df;

    color: #b42318;

    font-size: 30px;
    font-weight: 900;
}

.unavailable-message h3 {
    margin: 0 0 8px;

    color: #9f1c13;

    font-size: 24px;
}

.unavailable-message p {
    max-width: 540px;

    margin: 0 auto;

    color: var(--text-500);

    font-size: 13px;

    line-height: 1.6;
}


/* ==========================================================
   CONTENIDO RESULTADO DEL MODAL
========================================================== */

.modal-results-content {
    display: block;

    padding: 24px 30px 30px;
}

.modal-results-content.hidden {
    display: none;
}

.modal-table-title {
    margin-bottom: 16px;

    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;
}

.modal-table-title span {
    display: block;

    margin-bottom: 2px;

    color: var(--cyan-500);

    font-size: 10px;
    font-weight: 900;

    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modal-table-title h3 {
    margin: 0;

    color: var(--blue-950);

    font-size: 23px;
}

.modal-updated {
    color: var(--text-500);

    font-size: 11px;
}


/* ==========================================================
   TABLA MODAL
========================================================== */

.modal-table-wrap {
    overflow-x: auto;

    border: 1px solid var(--border);

    border-radius: 13px;
}

.modal-results-table {
    width: 100%;

    min-width: 870px;

    border-collapse: collapse;
}

.modal-results-table th {
    padding: 12px 14px;

    background: #f5f8fc;

    border-bottom: 1px solid var(--border);

    color: var(--text-500);

    font-size: 9px;
    font-weight: 900;

    text-align: left;

    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-results-table td {
    padding: 14px;

    border-bottom: 1px solid #edf1f6;

    color: var(--text-700);

    font-size: 13px;

    vertical-align: middle;
}

.modal-results-table tbody tr:last-child td {
    border-bottom: 0;
}

.modal-results-table tbody tr:hover {
    background: #fafcff;
}


/* ==========================================================
   POSICIONES
========================================================== */

.modal-position {
    width: 30px;
    height: 30px;

    display: inline-grid;
    place-items: center;

    border-radius: 50%;

    background: #edf2f8;

    color: var(--blue-950);

    font-size: 12px;
    font-weight: 900;
}

.modal-position.first {
    background: #fff2b7;

    color: #8d6a00;
}

.modal-position.second {
    background: #e8ebef;

    color: #545b64;
}

.modal-position.third {
    background: #f2dfd2;

    color: #8c5030;
}

.modal-lane {
    color: var(--blue-800) !important;

    font-weight: 900;
}

.modal-athlete {
    color: var(--blue-950) !important;

    font-weight: 800;
}

.modal-time {
    color: var(--blue-950) !important;

    font-size: 18px !important;

    font-weight: 900;
}

.modal-difference {
    color: var(--text-500) !important;

    font-size: 11px !important;
}


/* ==========================================================
   FOOTER MODAL
========================================================== */

.result-modal-footer {
    padding: 16px 30px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    background: #f7f9fc;

    border-top: 1px solid var(--border);
}

.modal-powered {
    color: var(--text-500);

    font-size: 11px;
}

.modal-powered strong {
    color: var(--blue-800);
}

.modal-button-close {
    padding: 10px 19px;

    border: 0;
    border-radius: 9px;

    background: var(--blue-800);

    color: white;

    cursor: pointer;

    font-family: inherit;

    font-size: 12px;
    font-weight: 800;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.modal-button-close:hover {
    background: var(--blue-700);

    transform: translateY(-1px);
}


/* ==========================================================
   BLOQUEAR SCROLL CUANDO ABRE MODAL
========================================================== */

body.modal-open {
    overflow: hidden;
}


/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 1024px) {

    .results-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-summary {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 900px) {

    .results-filters {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 720px) {

    .result-modal {
        padding: 10px;
    }

    .result-modal-dialog {
        max-height: calc(100vh - 20px);

        border-radius: 15px;
    }

    .result-modal-header,
    .result-modal-info,
    .modal-results-content,
    .result-modal-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .result-modal-info {
        align-items: flex-start;
        flex-direction: column;
    }

    .modal-info-data {
        width: 100%;

        display: grid;

        grid-template-columns: repeat(3, 1fr);

        gap: 14px;
    }

    .provisional-warning {
        margin-left: 18px;
        margin-right: 18px;
    }

}


@media (max-width: 640px) {

    .results-hero {
        padding: 34px 0;
    }

    .results-hero-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-hero h1 {
        font-size: 40px;
    }

    .results-back {
        width: 100%;

        text-align: center;
    }

    .results-section {
        padding: 35px 0 55px;
    }

    .results-filters,
    .results-summary,
    .results-list {
        grid-template-columns: 1fr;
    }

    .status-legend {
        align-items: flex-start;

        flex-direction: column;
    }

    .legend-items {
        flex-wrap: wrap;
    }

    .result-item-bottom {
        align-items: flex-start;

        flex-direction: column;
    }

    .result-modal-header h2 {
        font-size: 25px;
    }

    .modal-info-data {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-table-title {
        align-items: flex-start;

        flex-direction: column;
    }

    .result-modal-footer {
        align-items: flex-start;

        flex-direction: column;
    }

    .modal-button-close {
        width: 100%;
    }

}


@media (max-width: 420px) {

    .modal-info-data {
        grid-template-columns: 1fr;
    }

    .result-modal-header {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .result-modal-header h2 {
        font-size: 22px;
    }

}