/*
 * Motorsport Manager - Standings Table  
 * Version 5.0.0 - DRAMATICALLY ENHANCED with animations, glows, and modern effects
 */

.mm-table-container {
    max-width: 950px;
    margin: 2.5em auto;
    font-family: "Titillium Web", sans-serif;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.mm-table-row {
    margin-bottom: 14px;
    border-radius: 14px;
    overflow: hidden;
    transition: all .35s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 7px solid var(--team-color, #e10600);
    background: linear-gradient(90deg, rgba(35, 35, 35, 0.95) 0%, rgba(25, 25, 25, 0.7) 100%);
    color: #fff;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
}

.mm-table-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--team-color, #e10600) 0%, transparent 80%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.mm-table-row::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.mm-table-row:hover {
    transform: translateX(12px) scale(1.025);
    box-shadow: 0 16px 48px rgba(225, 6, 0, 0.35), 
                0 0 48px rgba(225, 6, 0, 0.15),
                inset 0 0 60px rgba(225, 6, 0, 0.05);
    border-left-width: 10px;
    background: linear-gradient(90deg, rgba(45, 45, 45, 1) 0%, rgba(35, 35, 35, 0.85) 100%);
}

.mm-table-row:hover::before {
    opacity: 1;
}

.mm-table-row:hover::after {
    left: 100%;
}

/* PODIUM SPECIAL STYLING */
.mm-table-row:nth-child(1) {
    border-left-color: #FFD700;
    background: linear-gradient(90deg, rgba(50, 45, 20, 0.95) 0%, rgba(40, 35, 20, 0.7) 100%);
}

.mm-table-row:nth-child(2) {
    border-left-color: #C0C0C0;
    background: linear-gradient(90deg, rgba(45, 45, 45, 0.95) 0%, rgba(35, 35, 35, 0.7) 100%);
}

.mm-table-row:nth-child(3) {
    border-left-color: #CD7F32;
    background: linear-gradient(90deg, rgba(45, 35, 25, 0.95) 0%, rgba(35, 25, 20, 0.7) 100%);
}

.mm-row-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    text-decoration: none;
    color: inherit;
}

.mm-table-cell-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0; /* Allow flex shrinking */
    overflow: hidden;
}

.mm-table-cell-main .position {
    font-size: 1.6em;
    font-weight: 900;
    min-width: 50px;
    max-width: 50px;
    flex-shrink: 0;
    text-align: center;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.4));
    letter-spacing: -1px;
}

/* GOLD 1st PLACE WITH GLOW ANIMATION */
.mm-table-row:nth-child(1) .position {
    font-size: 2em;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8)) 
            drop-shadow(0 4px 8px rgba(255, 215, 0, 0.4));
    animation: goldPulse 3s ease-in-out infinite;
}

.mm-table-row:nth-child(2) .position {
    font-size: 1.8em;
    background: linear-gradient(135deg, #E8E8E8 0%, #A8A8A8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(192, 192, 192, 0.7));
}

.mm-table-row:nth-child(3) .position {
    font-size: 1.7em;
    background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(205, 127, 50, 0.6));
}

@keyframes goldPulse {
    0%, 100% {
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8)) 
                drop-shadow(0 4px 8px rgba(255, 215, 0, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1)) 
                drop-shadow(0 4px 12px rgba(255, 215, 0, 0.6));
    }
}

.mm-table-cell-main .driver-name {
    font-weight: 400;
    font-size: 1.05em;
    white-space: nowrap;
    flex-shrink: 1;
}

.mm-table-cell-main .driver-surname {
    font-weight: 700;
    font-size: 1.15em;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-table-cell-main .team {
    font-size: .95em;
    opacity: .75;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 2;
    min-width: 0;
}

.mm-table-cell-points {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

.mm-table-cell-points .points {
    font-weight: 900;
    font-size: 1.5em;
    margin-right: 10px;
    background: linear-gradient(135deg, #fff 0%, #d0d0d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.25));
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.mm-table-cell-points i {
    opacity: .6;
    transition: opacity 0.3s ease;
}

.mm-table-row:hover .mm-table-cell-points i {
    opacity: .9;
}

/* Position change indicators */
.change-indicator {
    min-width: 38px;
    text-align: center;
    font-size: 1em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Championship status icons */
.mm-champion,
.mm-eliminated {
    font-size: 1.2em;
    margin-left: 6px;
    display: inline-block;
    flex-shrink: 0;
}

.mm-champion {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    animation: championGlow 3s ease-in-out infinite;
}

@keyframes championGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1));
    }
}

.mm-eliminated {
    opacity: 0.6;
}

.mm-change.mm-up { 
    color: #4ade80;
    filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.5));
}

.mm-change.mm-down { 
    color: #f87171;
    filter: drop-shadow(0 0 8px rgba(248, 113, 113, 0.5));
}

.mm-change.mm-same { 
    color: #9ca3af;
}

.mm-change.mm-new { 
    color: #facc15;
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.5));
}

.mm-change.mm-up::before {
    content: '▲ ';
    animation: bounceUp 1.5s ease-in-out infinite;
}

.mm-change.mm-down::before {
    content: '▼ ';
    animation: bounceDown 1.5s ease-in-out infinite;
}

@keyframes bounceUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

@media (max-width: 768px) {
    .mm-table-container {
        padding: 1rem;
    }
    
    .mm-row-link {
        padding: 14px 16px;
    }
    
    .mm-table-cell-main {
        gap: 12px;
    }
    
    .mm-table-cell-main .position {
        font-size: 1.3em;
        min-width: 40px;
    }
    
    .mm-table-row:nth-child(1) .position {
        font-size: 1.6em;
    }
    
    .mm-table-cell-points .points {
        font-size: 1.2em;
    }
    
    .mm-table-row:hover {
        transform: scale(1.015);
    }
}

/* =================================================================
   SURNAME ONLY MODE - Compact for Sidebars
   ================================================================= */

.mm-table-container.mm-surname-only {
    padding: 1rem;
    max-width: 100%;
}

.mm-table-container.mm-surname-only .mm-table-row {
    margin-bottom: 10px;
}

.mm-table-container.mm-surname-only .mm-row-link {
    padding: 12px 16px;
}

/* Hide first name and team in compact mode */
.mm-table-container.mm-surname-only .mm-table-cell-main .driver-name,
.mm-table-container.mm-surname-only .mm-table-cell-main .team {
    display: none;
}

/* Adjust surname styling for compact mode */
.mm-table-container.mm-surname-only .mm-table-cell-main .driver-surname {
    margin-left: 0;
    font-size: 1em;
    font-weight: 700;
}

/* Smaller position numbers in compact mode */
.mm-table-container.mm-surname-only .mm-table-cell-main .position {
    font-size: 1.3em;
    min-width: 35px;
    max-width: 35px;
}

.mm-table-container.mm-surname-only .mm-table-row:nth-child(1) .position {
    font-size: 1.5em;
}

.mm-table-container.mm-surname-only .mm-table-row:nth-child(2) .position {
    font-size: 1.4em;
}

.mm-table-container.mm-surname-only .mm-table-row:nth-child(3) .position {
    font-size: 1.35em;
}

/* Smaller points display in compact mode */
.mm-table-container.mm-surname-only .mm-table-cell-points .points {
    font-size: 1.1em;
    margin-right: 6px;
}

/* Tighter spacing for compact mode */
.mm-table-container.mm-surname-only .mm-table-cell-main {
    gap: 8px;
}

/* Smaller change indicators */
.mm-table-container.mm-surname-only .change-indicator {
    min-width: 30px;
    font-size: 0.9em;
}

/* Smaller champion/eliminated icons */
.mm-table-container.mm-surname-only .mm-champion,
.mm-table-container.mm-surname-only .mm-eliminated {
    font-size: 1em;
    margin-left: 4px;
}

/* Less dramatic hover effect in compact mode */
.mm-table-container.mm-surname-only .mm-table-row:hover {
    transform: translateX(6px) scale(1.015);
}

/* Mobile adjustments for surname-only mode */
@media (max-width: 768px) {
    .mm-table-container.mm-surname-only .mm-table-row {
        margin-bottom: 8px;
    }
    
    .mm-table-container.mm-surname-only .mm-row-link {
        padding: 10px 12px;
    }
    
    .mm-table-container.mm-surname-only .mm-table-cell-main .position {
        font-size: 1.2em;
        min-width: 30px;
        max-width: 30px;
    }
    
    .mm-table-container.mm-surname-only .mm-table-row:nth-child(1) .position {
        font-size: 1.4em;
    }
    
    .mm-table-container.mm-surname-only .mm-table-cell-points .points {
        font-size: 1em;
    }
    
    .mm-table-container.mm-surname-only .mm-table-cell-main .driver-surname {
        font-size: 0.95em;
    }
}