/* Races Page Specific Styles */

.races-container {
    padding: 2rem;
    justify-content: flex-start;
    align-items: center;
    overflow-y: auto;
}

.nav-bar {
    width: 100%;
    max-width: 1000px;
    margin-bottom: 2rem;
    z-index: 20;
}

.nav-link {
    color: var(--visit-recent);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.nav-link:hover {
    color: #e2e8f0;
    transform: translateX(-5px);
}

.races-header {
    position: relative;
    top: 0;
    transform: none;
    margin-bottom: 3rem;
    left: auto;
}

/* Chart Container */
.chart-container {
    width: 100%;
    max-width: 1000px;
    z-index: 10;
    margin-bottom: 3rem;
}

.glass-chart-wrapper {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    height: 350px;
    position: relative;
}

.table-container {
    width: 100%;
    max-width: 1000px;
    z-index: 10;
    margin-bottom: 4rem;
}

/* Glassmorphism Table */
.glass-table-wrapper {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.glass-table th {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.25rem 1.5rem;
    font-weight: 800;
    color: #fff;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 1rem;
    transition: background 0.2s ease;
}

.glass-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.glass-table tbody tr:last-child td {
    border-bottom: none;
}

/* Specific Columns */
.col-title strong {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}

.col-time,
.col-pace {
    font-variant-numeric: tabular-nums;
    /* Monospace numbers for easy reading */
    color: var(--visit-recent);
    font-weight: 600;
}

.badge-year {
    background: var(--visit-older);
    color: #fff;
}

.badge-dist {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-hm {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-m {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

/* Scrollbar styling for table container if needed */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .races-container {
        padding: 1rem;
    }

    .glass-chart-wrapper {
        padding: 1rem;
        height: 250px;
    }

    .glass-table th,
    .glass-table td {
        padding: 1rem;
        white-space: nowrap;
        /* Keep table data from wrapping to save horizontal space */
        font-size: 0.9rem;
    }

    .col-title strong {
        font-size: 1rem;
    }

    .races-header {
        margin-bottom: 2rem;
    }
}