/*
 * Motorsport Manager - Race Results Template
 * Version 5.0.0 - ENHANCED with podium celebrations and driver highlights
 */
:root { 
    --f1-red: #e10600; 
    --background-dark: #0d0d0d; 
    --text-primary: #FFFFFF; 
    --text-secondary: #9CA3AF; 
    --border-color: #2a2a2a; 
    --podium-gold: #FFD700; 
    --podium-silver: #C0C0C0; 
    --podium-bronze: #CD7F32;
}

body.mm-race-page { 
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 100%);
    margin: 0; 
    padding: 20px; 
    font-family: "Titillium Web", sans-serif; 
    color: var(--text-primary); 
    line-height: 1.6; 
}

.mm-results-wrapper { 
    max-width: 1100px; 
    margin: 30px auto; 
    background: linear-gradient(145deg, #1f1f1f, #2a2a2a); 
    border-radius: 16px; 
    padding: clamp(20px, 4vw, 35px); 
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 100px rgba(225, 6, 0, 0.1); 
    border: 1px solid var(--border-color); 
    position: relative;
    overflow: hidden;
}

.mm-results-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--f1-red) 0%, transparent 100%);
}

/* Header */
.mm-race-header { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; 
    gap: 25px; 
    margin-bottom: 35px; 
    border-bottom: 2px solid var(--border-color); 
    padding-bottom: 25px; 
}

.mm-header-info { 
    flex: 1 1 500px; 
}

.mm-header-info h1 { 
    margin: 0 0 18px; 
    font-size: clamp(2rem, 5vw, 2.8rem); 
    color: var(--text-primary); 
    line-height: 1.1; 
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #999 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 10px rgba(255, 255, 255, 0.2));
}

.mm-header-meta { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px 24px; 
    color: var(--text-secondary); 
    font-size: 0.95em; 
}

.mm-header-meta .meta-item { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-weight: 600;
}

.mm-header-meta .meta-item i {
    color: var(--f1-red);
}

.mm-header-meta .meta-item a { 
    color: var(--text-secondary); 
    text-decoration: none;
    transition: color 0.3s ease;
}

.mm-header-meta .meta-item a:hover { 
    color: var(--text-primary); 
}

.series-logo img { 
    height: 22px; 
    width: auto; 
    margin-right: 6px; 
}

.mm-header-map { 
    flex-shrink: 0; 
    width: 180px; 
}

.mm-header-map img { 
    width: 100%; 
    height: auto; 
    border-radius: 12px; 
    background: #fff; 
    padding: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: transform 0.3s ease;
}

.mm-header-map img:hover {
    transform: scale(1.05);
}

/* Highlights & Summary */
.mm-highlights-block { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 18px; 
    margin-bottom: 35px; 
}

.mm-highlight-item { 
    background: rgba(255,255,255,0.06); 
    padding: 20px; 
    border-radius: 12px; 
    border-left: 5px solid var(--border-color); 
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mm-highlight-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: inherit;
    transition: width 0.3s ease;
}

.mm-highlight-item:hover::before {
    width: 100%;
    opacity: 0.1;
}

.mm-highlight-item.winner { 
    border-color: var(--podium-gold); 
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255,255,255,0.06) 100%);
}

.mm-highlight-item.pole { 
    border-color: var(--podium-silver); 
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1) 0%, rgba(255,255,255,0.06) 100%);
}

.mm-highlight-item.fastest-lap { 
    border-color: #A020F0; 
    background: linear-gradient(135deg, rgba(160, 32, 240, 0.1) 0%, rgba(255,255,255,0.06) 100%);
}

.mm-highlight-item small { 
    display: block; 
    font-size: 0.75em; 
    color: var(--text-secondary); 
    margin-bottom: 8px; 
    text-transform: uppercase; 
    font-weight: 700;
    letter-spacing: 1px;
}

.mm-highlight-item .driver-info a { 
    font-size: 1.3em; 
    font-weight: 700; 
    color: var(--text-primary); 
    text-decoration: none; 
    transition: color 0.3s ease;
}

.mm-highlight-item .driver-info a:hover { 
    color: var(--f1-red);
}

.mm-summary-block { 
    margin-bottom: 35px; 
    background: rgba(255,255,255,0.03); 
    padding: 24px; 
    border-radius: 12px; 
    border: 1px solid var(--border-color);
}

.mm-summary-block h3 { 
    margin-top: 0; 
    color: var(--f1-red);
}

/* Results Table */
.mm-results-wrapper h3 { 
    color: var(--text-primary); 
    font-size: 1.7em; 
    margin: 45px 0 24px; 
    padding-bottom: 14px; 
    border-bottom: 2px solid var(--border-color); 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

.mm-results-wrapper h3 .fas { 
    color: var(--f1-red); 
}

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

.mm-results-table th { 
    padding: 14px; 
    text-align: left; 
    color: var(--text-secondary); 
    text-transform: uppercase; 
    font-size: 0.75em; 
    letter-spacing: 1px; 
    font-weight: 700; 
    border-bottom: 2px solid var(--border-color);
}

.mm-results-table tbody tr { 
    border-bottom: 1px solid var(--border-color); 
    transition: all 0.3s ease; 
    position: relative;
}

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

.mm-results-table tbody tr:hover { 
    background: linear-gradient(90deg, rgba(225, 6, 0, 0.1) 0%, transparent 100%);
    transform: translateX(4px);
}

/* PODIUM ROW STYLING */
.mm-results-table tbody tr:nth-child(1) {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.08) 0%, transparent 100%);
}

.mm-results-table tbody tr:nth-child(1):hover {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15) 0%, transparent 100%);
}

.mm-results-table tbody tr:nth-child(2) {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.06) 0%, transparent 100%);
}

.mm-results-table tbody tr:nth-child(3) {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.06) 0%, transparent 100%);
}

.mm-results-table td { 
    padding: 14px; 
    vertical-align: middle; 
    font-size: 0.95em; 
}

.mm-results-table .pos-col, 
.mm-results-table .grid-col { 
    text-align: center; 
    font-weight: 700; 
    font-size: 1.1em;
}

/* Gold/Silver/Bronze for podium positions */
.mm-results-table tbody tr:nth-child(1) .pos-col {
    color: var(--podium-gold);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    font-size: 1.3em;
}

.mm-results-table tbody tr:nth-child(2) .pos-col {
    color: var(--podium-silver);
    filter: drop-shadow(0 0 6px rgba(192, 192, 192, 0.5));
    font-size: 1.2em;
}

.mm-results-table tbody tr:nth-child(3) .pos-col {
    color: var(--podium-bronze);
    filter: drop-shadow(0 0 6px rgba(205, 127, 50, 0.5));
    font-size: 1.2em;
}

.mm-results-table .laps-col, 
.mm-results-table .time-col, 
.mm-results-table .pts-col { 
    text-align: center; 
}

.mm-results-table .driver-col a { 
    color: var(--text-primary); 
    text-decoration: none; 
    font-weight: 700; 
    transition: color 0.3s ease;
}

.mm-results-table .driver-col a:hover {
    color: var(--f1-red);
}

.mm-results-table .team-col a { 
    color: var(--text-secondary); 
    text-decoration: none; 
    font-weight: 600;
}

.mm-results-table a:hover { 
    text-decoration: underline; 
}

.status-dnf, 
.status-dsq { 
    color: #f87171; 
    font-weight: bold; 
}

/* Footer */
.mm-race-footer { 
    text-align: center; 
    margin-top: 45px; 
    padding-top: 35px; 
    border-top: 2px solid var(--border-color); 
}

.mm-button { 
    background: linear-gradient(135deg, var(--f1-red), #c10500); 
    color: #fff; 
    padding: 14px 30px; 
    text-decoration: none; 
    border-radius: 10px; 
    font-weight: 700; 
    transition: all 0.3s ease; 
    display: inline-block; 
    box-shadow: 0 4px 15px rgba(225, 6, 0, 0.3);
}

.mm-button:hover { 
    background: linear-gradient(135deg, #c10500, var(--f1-red)); 
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(225, 6, 0, 0.5);
}

@media (max-width: 768px) {
    .mm-results-table .team-col, 
    .mm-results-table .laps-col { 
        display: none; 
    }
    
    .mm-highlights-block {
        grid-template-columns: 1fr;
    }
}