/**
 * F1 Race Results Styling
 * Clean dark theme like F1 calendar
 */

/* Container */
.race-results-container {
    max-width: 1200px;
    margin: 0 auto;
    color: #e0e0e0;
}

/* Header - Enhanced */
.race-results-header {
    margin-bottom: 1.5rem;
}

.race-results-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.5rem 0;
}

.race-subtitle {
    color: #888;
    font-size: 1rem;
    margin: 0 0 1.5rem 0;
}

.back-link {
    display: inline-block;
    color: #888;
    text-decoration: none;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: #e10600;
}

/* Year Selector Dropdown */
.year-selector {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.year-label {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
}

.year-dropdown {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23e10600' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: all 0.2s ease;
}

.year-dropdown:hover {
    border-color: #e10600;
}

.year-dropdown:focus {
    outline: none;
    border-color: #e10600;
}

/* Races List */
.races-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.race-card {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.race-card:hover {
    background: #222;
    border-color: #e10600;
}

.race-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    color: #888;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 6px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.race-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.race-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.race-location {
    font-size: 0.8rem;
    color: #666;
}

.race-winner {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    font-size: 0.8rem;
}

.race-winner::before {
    content: '🏆';
    font-size: 0.75rem;
}

.winner-label {
    display: none;
}

.winner-name {
    color: #ffd700;
    font-weight: 600;
}

.winner-team {
    color: #555;
    font-size: 0.75rem;
}

.race-arrow {
    color: #444;
    font-size: 1.25rem;
    margin-left: 1rem;
    transition: all 0.2s ease;
}

.race-card:hover .race-arrow {
    color: #e10600;
}

/* Results Table */
.results-table-wrapper {
    overflow-x: auto;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.results-table th {
    background: #252525;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #333;
}

.results-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #2a2a2a;
    vertical-align: middle;
}

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

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

/* Position column */
.col-pos {
    width: 60px;
    text-align: center;
}

.position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-weight: 700;
    background: #333;
    color: #fff;
}

.position-1 {
    background: linear-gradient(135deg, #ffd700, #b8860b);
    color: #000;
}

.position-2 {
    background: linear-gradient(135deg, #c0c0c0, #808080);
    color: #000;
}

.position-3 {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    color: #fff;
}

/* Number column */
.col-num {
    width: 50px;
    text-align: center;
    color: #666;
}

/* Driver column */
.col-driver {
    min-width: 180px;
}

.col-driver .team-color-bar {
    display: inline-block;
    width: 4px;
    height: 20px;
    border-radius: 2px;
    margin-right: 0.75rem;
    vertical-align: middle;
}

.driver-name {
    font-weight: 600;
    color: #fff;
}

.driver-code {
    color: #666;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Team column */
.col-team {
    color: #888;
}

/* Laps column */
.col-laps {
    text-align: center;
    width: 60px;
}

/* Time column */
.col-time {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
}

/* Points column */
.col-points {
    width: 60px;
    text-align: center;
}

.points-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: #e10600;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 4px;
    padding: 0 0.5rem;
}

/* Podium rows */
.podium-1 {
    background: rgba(255, 215, 0, 0.05);
}

.podium-2 {
    background: rgba(192, 192, 192, 0.05);
}

.podium-3 {
    background: rgba(205, 127, 50, 0.05);
}

/* No results message */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: #1a1a1a;
    border-radius: 8px;
    color: #888;
}

.no-results .btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: #e10600;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.no-results .btn:hover {
    background: #ff1a1a;
}

/* Race meta */
.race-meta {
    margin-top: 1.5rem;
    text-align: right;
}

.last-updated {
    color: #555;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .race-results-container {
        padding: 1.5rem 1rem;
    }
    
    .race-results-header h1 {
        font-size: 1.5rem;
    }
    
    .race-results-header h1::before {
        font-size: 1.25rem;
    }
    
    .year-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .year-dropdown {
        width: auto;
    }
    
    .races-grid {
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .race-card {
        padding: 0.75rem;
    }
    
    .race-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .race-info h3 {
        font-size: 0.85rem;
    }
    
    .race-location {
        font-size: 0.75rem;
    }
    
    .race-winner {
        font-size: 0.75rem;
    }
    
    .race-arrow {
        font-size: 1.25rem;
        margin-left: 0.75rem;
    }
    
    .results-table {
        font-size: 0.8rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.5rem;
    }
    
    .col-team {
        display: none;
    }
    
    .driver-code {
        display: none;
    }
}

@media (max-width: 480px) {
    /* Hide all columns except pos, driver, pts on mobile */
    .col-laps,
    .col-time,
    .col-team {
        display: none;
    }
    
    .race-info {
        flex-wrap: wrap;
    }
    
    .race-location {
        display: none;
    }
    
    .race-winner {
        margin-left: 0;
        width: 100%;
        margin-top: 0.35rem;
    }
    
    .results-table {
        font-size: 0.85rem;
    }
    
    .driver-code {
        display: none;
    }
}
