:root {
    --primary-color: #e63946;
    --secondary-color: #457b9d;
    --dark-color: #1d3557;
    --light-color: #f1faee;
    --success-color: #2a9d8f;
    --warning-color: #e9c46a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

header .event-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

header .event-title {
    flex: 2;
}

header .event-image {
    flex: 1;
    text-align: right;
    height: 120px;
}

header .event-image img {
    height: 100%;
    object-fit: contain;
}

.search-section {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    margin-top: 50px;
}

.search-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.verify-box {
    display: flex;
    align-items: center;
}

.verify-certificate-button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-weight: bold;
}

.verify-certificate-button i {
    margin-right: 5px;
}

.verify-certificate-button:hover {
    background-color: #45a049;
}

.verify-link {
    display: inline-block;
    margin-top: 5px;
    color: #3498db;
    text-decoration: none;
    font-size: 12px;
}

.verify-link:hover {
    text-decoration: underline;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark-color);
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-box {
    flex: 1;
    min-width: 200px;
}

.filter-box label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark-color);
}

.filter-box select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: white;
}

.button-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button.primary {
    background-color: var(--primary-color);
    color: white;
}

button.secondary {
    background-color: var(--secondary-color);
    color: white;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.results-section {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.results-count {
    font-weight: 600;
    color: var(--dark-color);
}

.sort-by {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-by label {
    font-weight: 600;
    color: var(--dark-color);
}

.sort-by select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th, .results-table td {
    padding: 12px 15px;
    text-align: left;
}

.results-table th {
    background-color: #f8f9fa;
    color: var(--dark-color);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.results-table tr {
    border-bottom: 1px solid #eee;
}

.results-table tr:hover {
    background-color: #f8f9fa;
}

.results-table tr.highlighted {
    background-color: rgba(230, 57, 70, 0.1);
}

.position {
    font-weight: 700;
    width: 50px;
    text-align: center;
}

.position.top-3 {
    color: white;
    background-color: var(--primary-color);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

tr.top-3-row {
    background-color: rgba(230, 57, 70, 0.05);
}

tr.top-3-row:hover {
    background-color: rgba(230, 57, 70, 0.1);
}

.runner-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bib-number {
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-color);
}

.runner-name {
    font-weight: 600;
}

.runner-category {
    font-size: 14px;
    color: #666;
}

.runner-unique-id {
    font-size: 13px;
    color: #e63946;
    margin-top: 4px;
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 3px 6px;
    border-radius: 3px;
    display: inline-block;
    border: 1px dashed #e63946;
}

.unique-id-value {
    font-weight: bold;
    letter-spacing: 1px;
}

.time {
    font-family: monospace;
    font-size: 16px;
    font-weight: 600;
}

.pace {
    font-size: 14px;
    color: #666;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 5px;
    flex-wrap: wrap;
    padding: 10px;
}

.pagination button {
    padding: 8px 12px;
    background-color: white;
    border: 1px solid #ddd;
    color: var(--dark-color);
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.pagination button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:hover:not(.active) {
    background-color: #f5f5f5;
}

.no-results {
    text-align: center;
    padding: 30px;
    color: #666;
}

.runner-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    position: relative;
}

.runner-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Modal para detalles del corredor */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 60px auto;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    z-index: 10;
}

.modal-close:hover {
    color: var(--primary-color);
}

.runner-header {
    background-color: var(--primary-color);
    color: white;
    padding: 25px;
    border-radius: 10px 10px 0 0;
    position: relative;
}

.runner-name-large {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.runner-verification-id {
    color: white;
    font-size: 14px;
    font-family: monospace;
    margin-top: 5px;
}

.modal-unique-id {
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.runner-certificate {
    margin-top: 10px;
}

.certificate-btn {
    display: inline-block;
    background-color: white;
    color: var(--primary-color);
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.certificate-btn:hover {
    background-color: #f1f1f1;
    transform: translateY(-2px);
}

.runner-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.detail-box {
    text-align: center;
    padding: 15px;
}

.detail-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 22px;
    font-weight: 700;
}

.detail-sub {
    font-size: 14px;
    color: #666;
}

.times-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 20px;
}

.time-box {
    text-align: center;
    padding: 10px;
}

.time-label {
    font-weight: 600;
    margin-bottom: 5px;
}

.time-value {
    font-size: 20px;
    font-weight: 700;
    font-family: monospace;
}

.pace-value {
    color: #666;
    font-size: 14px;
}

.photos-section {
    padding: 20px;
    border-top: 1px solid #eee;
}

.photos-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.photo-item {
    position: relative;
    height: 120px;
    border-radius: 5px;
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.photo-item img:hover {
    transform: scale(1.05);
    cursor: pointer;
}

.photo-time {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    text-align: center;
    font-family: monospace;
}

.navigation-buttons {
    display: flex;
    justify-content: center;
    padding: 15px;
    gap: 10px;
}

.nav-btn {
    padding: 8px 16px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-btn:hover {
    background-color: #e9ecef;
}

/* Footer */
footer {
    background-color: #000000;
    color: white;
    padding: 40px 0 0;
    margin-top: 50px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 30px;
    padding: 0 20px;
}

.footer-about img {
    max-width: 180px;
    margin-bottom: 15px;
}

.footer-about p {
    color: #bbb;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-links h3, .footer-contact h3 {
    font-size: 18px;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h3:after, .footer-contact h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.contact-info {
    margin-bottom: 20px;
}

.contact-info p {
    color: #bbb;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.contact-info i {
    margin-right: 10px;
    color: var(--primary-color);
}

.social-media {
    display: flex;
    gap: 10px;
}

.social-media a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #333;
    color: white;
    border-radius: 50%;
    transition: all 0.3s;
}

.social-media a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    background-color: #111;
    padding: 15px 0;
    text-align: center;
    color: #777;
    font-size: 14px;
}

.footer-bottom a {
    color: #bbb;
    text-decoration: none;
}

@media (max-width: 768px) {
    .search-box, .filter-box {
        min-width: 100%;
    }

    .results-table {
        display: block;
        overflow-x: auto;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .runner-details-grid,
    .times-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .photos-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .pagination {
        gap: 3px;
    }

    .pagination button {
        min-width: 36px;
        height: 36px;
        padding: 6px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .photos-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pagination {
        gap: 2px;
    }

    .pagination button {
        min-width: 32px;
        height: 32px;
        padding: 4px;
        font-size: 12px;
    }
}

.race-banner {
    width: 100%;
    margin-bottom: 30px;
    text-align: center;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.race-banner-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.top-navbar {
    width: 100%;
    height: 50px;
    background: #000;
}

.actions-cell {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #bbb;
    background: #fff;
    color: #1d3557;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
    box-shadow: none;
    padding: 0;
}

.action-btn:hover {
    border-color: #e63946;
    color: #e63946;
    background: #f8f9fa;
    transform: scale(1.12);
}

.btn-certificado,
.btn-metricas,
.btn-fotos {
    background: #fff;
    color: #1d3557;
    border: 1.5px solid #bbb;
}

.btn-certificado:hover,
.btn-metricas:hover,
.btn-fotos:hover {
    background: #f8f9fa;
    color: #e63946;
    border-color: #e63946;
}

.actions-cell-horizontal {
    display: flex;
    gap: 6px;
    align-items: center;
}

.action-btn-rect {
    border: 1.5px solid #bbb;
    background: #fff;
    color: #1d3557;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
    box-shadow: none;
    min-width: 32px;
    min-height: 28px;
}

.action-btn-rect i {
    font-size: 15px;
}

.action-btn-rect:hover {
    border-color: #e63946;
    color: #e63946;
    background: #f8f9fa;
    transform: scale(1.08);
}

/* Estilos para el modal de galería */
.gallery-modal-content {
    max-width: 95%;
    height: 95vh;
    display: flex;
    flex-direction: column;
    background-color: #000;
    padding: 0;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.gallery-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px 0;
}

.gallery-main-photo {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main-photo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.photo-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    display: flex;
    gap: 15px;
    z-index: 2;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev-photo {
    left: 20px;
}

.gallery-nav.next-photo {
    right: 20px;
}

.gallery-nav i {
    font-size: 24px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    z-index: 3;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.gallery-thumbnails {
    height: 100px;
    padding: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.gallery-thumbnail {
    height: 80px;
    width: auto;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.gallery-thumbnail:hover {
    opacity: 0.9;
}

.gallery-thumbnail.active {
    border-color: #2A9D8F;
    opacity: 1;
}

/* Media queries para dispositivos móviles */
@media (max-width: 768px) {
    .gallery-modal-content {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .gallery-container {
        padding: 10px 0;
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
    }

    .gallery-nav.prev-photo {
        left: 10px;
    }

    .gallery-nav.next-photo {
        right: 10px;
    }

    .photo-info {
        bottom: 15px;
        font-size: 14px;
        padding: 8px 16px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .gallery-thumbnails {
        height: 80px;
    }

    .gallery-thumbnail {
        height: 60px;
    }
}

/* Media query para pantallas muy pequeñas */
@media (max-width: 480px) {
    .gallery-nav {
        width: 36px;
        height: 36px;
    }

    .gallery-nav i {
        font-size: 20px;
    }

    .photo-info {
        bottom: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Estilos para la sección de análisis */
.analysis-section {
    margin-top: 2rem;
    padding: 1rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-explanation-row {
    display: block;
    gap: 0;
}

.chart-container {
    flex: unset;
    width: 100%;
    max-width: 100%;
    height: 400px;
    margin-bottom: 2rem;
}

#column-explanation {
    display: none;
    min-width: auto;
    max-width: auto;
    margin-top: 0;
}

/* Asegurar fondo blanco para la exportación */
#export-area {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
}

#export-area .metrics-table,
#export-area .metrics-table tr,
#export-area .metrics-table td,
#export-area .metrics-table th {
    background-color: white !important;
}

.selected-runners {
    margin-top: 2rem;
}

.selected-runners h3 {
    color: #1d3557;
    margin-bottom: 1rem;
}

.selected-runners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.runner-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.runner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.runner-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.runner-name {
    font-weight: bold;
    color: #1d3557;
}

.runner-bib {
    color: #457b9d;
    font-size: 0.9rem;
}

.runner-category {
    color: #666;
    font-size: 0.9rem;
}

.remove-runner {
    background: none;
    border: none;
    color: #e63946;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-runner:hover {
    background: #fee2e2;
    transform: scale(1.1);
}

.search-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input-group input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 1rem;
}

.search-btn {
    background-color: #457b9d;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #1d3557;
}

.section-description {
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

/* Estilos para el dropdown de resultados de búsqueda */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-result-item {
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item .name {
    font-weight: bold;
    color: #1d3557;
}

.search-result-item .details {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.3rem;
}

/* --- NUEVO DISEÑO DE COMPARATIVA: TARJETAS EN MÓVIL --- */
.metrics-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    background: #fff;
    font-size: 0.92rem;
    font-weight: 400;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.01em;
}
.metrics-table th, .metrics-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #eee;
    text-align: center;
    font-size: 0.92rem;
    font-weight: 400;
}
.metrics-table th {
    background: #f8f9fa;
    color: #1d3557;
    font-weight: 500;
    font-size: 0.98em;
}
.metrics-table tr:last-child td {
    border-bottom: none;
}
.metrics-table td[data-best="true"] {
    background: #d4edda !important;
    font-weight: bold;
    border-radius: 6px;
}

/* Tarjetas para móvil */
@media (max-width: 700px) {
    .metrics-table, .metrics-table thead, .metrics-table tbody, .metrics-table tr {
        display: block;
        width: 100%;
    }
    .metrics-table thead {
        display: none;
    }
    .metrics-table tr {
        background: #fff;
        margin-bottom: 18px;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.07);
        padding: 12px 0 8px 0;
    }
    .metrics-table td {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        border: none;
        padding: 7px 10px;
        font-size: 0.98em;
        position: relative;
    }
    .metrics-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #457b9d;
        min-width: 120px;
        display: inline-block;
        margin-right: 10px;
        font-size: 0.97em;
    }
    .metrics-table td[data-best="true"] {
        background: #d4edda !important;
        border-radius: 6px;
    }
}

/* Iconos para métricas */
.metric-icon {
    margin-right: 7px;
    color: #457b9d;
    font-size: 1.1em;
    vertical-align: middle;
}

/* Mejorar visualización de la gráfica en móvil (más compacta, sin scroll) */
@media (max-width: 700px) {
    .chart-container {
        height: 220px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    #performanceComparisonChart {
        height: 200px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Estilos para el modal de explicación */
#explanation-modal .modal-content {
    max-width: 500px;
}

#explanation-modal .modal-body p {
    margin-bottom: 8px;
    line-height: 1.4;
}

#explanation-modal .modal-body b {
    color: #1d3557;
}

.chart-container {
    flex: unset;
    width: 100%;
    max-width: 100%;
    height: 400px;
    margin-bottom: 2rem;
}

#performanceComparisonChart {
    display: block;
    margin: 0 auto;
}

/* Estilos para forzar fondo blanco en la tabla durante la exportación */
#export-area table,
#export-area tr,
#export-area th {
    background-color: white !important;
}
/* Regla ajustada para forzar fondo blanco en celdas TD dentro del área de exportación que NO son los mejores resultados */
#export-area td {
    background-color: white !important;
}

#export-area td[data-best="true"] {
    background-color: #d4edda !important; /* Asegurar que esta regla tenga prioridad */
}

.selected-runners {
    margin-top: 2rem;
}

.selected-runners h3 {
    color: #1d3557;
    margin-bottom: 1rem;
}

.selected-runners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.runner-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.runner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.runner-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.runner-name {
    font-weight: bold;
    color: #1d3557;
}

.runner-bib {
    color: #457b9d;
    font-size: 0.9rem;
}

.runner-category {
    color: #666;
    font-size: 0.9rem;
}

.remove-runner {
    background: none;
    border: none;
    color: #e63946;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-runner:hover {
    background: #fee2e2;
    transform: scale(1.1);
}

.search-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input-group input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 1rem;
}

.search-btn {
    background-color: #457b9d;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #1d3557;
}

.section-description {
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

/* Estilos para el dropdown de resultados de búsqueda */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-result-item {
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item .name {
    font-weight: bold;
    color: #1d3557;
}

.search-result-item .details {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.3rem;
}