/*
 * Motorsport Manager - Widget Styles
 * Version: 5.0.0 - ENHANCED with countdown animations
 */

/* --- Next Race Widget --- */
.mm-widget-next-race {
    background: linear-gradient(135deg, #2d2d2d 0%, #1d1d1d 100%);
    border: 2px solid #444;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    color: #fff;
    font-family: "Titillium Web", sans-serif;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.mm-widget-next-race::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e10600 0%, transparent 100%);
}

.mm-widget-next-race h3 {
    margin-top: 0;
    font-size: 1.5em;
    color: #fff;
    border-bottom: 2px solid #555;
    padding-bottom: 12px;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.mm-widget-next-race h4 {
    margin: 12px 0 20px;
}

.mm-widget-next-race h4 a {
    text-decoration: none;
    color: #e10600;
    font-size: 1.3em;
    transition: all 0.3s ease;
    font-weight: 700;
}

.mm-widget-next-race h4 a:hover {
    color: #ff4444;
    text-shadow: 0 0 15px rgba(225, 6, 0, 0.6);
}

#mm-countdown-timer {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    margin-top: 20px;
}

#mm-countdown-timer > div {
    background: linear-gradient(135deg, #444 0%, #2a2a2a 100%);
    padding: 16px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
    flex-basis: 22%;
    font-size: 0.75em;
    color: #aaa;
    border: 1px solid #555;
    position: relative;
    overflow: hidden;
}

#mm-countdown-timer > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(225, 6, 0, 0.15), transparent);
    transition: left 0.6s ease;
}

#mm-countdown-timer > div:hover::before {
    left: 100%;
}

#mm-countdown-timer span {
    display: block;
    font-size: 2.2em;
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #fff 0%, #ccc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.3));
    transition: all 0.3s ease;
}

#mm-countdown-timer > div:hover span {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 10px rgba(225, 6, 0, 0.6));
}

/* Urgent countdown (< 24 hours) */
#mm-countdown-timer.urgent {
    animation: urgentPulse 2s ease-in-out infinite;
}

#mm-countdown-timer.urgent > div {
    border-color: #e10600;
    background: linear-gradient(135deg, #4a1010 0%, #2a0a0a 100%);
}

#mm-countdown-timer.urgent span {
    background: linear-gradient(135deg, #ff4444 0%, #e10600 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes urgentPulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(225, 6, 0, 0.7);
    }
    50% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px 10px rgba(225, 6, 0, 0);
    }
}

/* --- Compact Standings Widget Styles --- */
.mm-standings-widget-wrapper .mm-table-container {
    font-size: 13px;
    padding: 12px;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
}

.mm-standings-widget-wrapper .mm-table-row {
    margin-bottom: 8px;
    padding: 0;
}

.mm-standings-widget-wrapper .mm-row-link {
    padding: 12px 16px;
}

.mm-standings-widget-wrapper .mm-table-row .driver-name,
.mm-standings-widget-wrapper .mm-table-row .team,
.mm-standings-widget-wrapper .mm-table-row .fa-chevron-right {
    display: none;
}

.mm-standings-widget-wrapper .mm-table-row .driver-surname {
    display: inline-block;
    margin-left: 0;
    font-weight: 700;
    font-size: 1.05em;
}

.mm-standings-widget-wrapper .mm-table-row .mm-table-cell-main {
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 12px;
}

.mm-standings-widget-wrapper .mm-table-row .mm-table-cell-main .position {
    font-size: 1.3em;
    min-width: 35px;
}

.mm-standings-widget-wrapper .mm-table-row .mm-table-cell-points {
    padding-left: 8px;
}

.mm-standings-widget-wrapper .mm-table-row .mm-table-cell-points .points {
    font-size: 1.2em;
}

.mm-standings-widget-wrapper .mm-table-row:nth-child(1) .position {
    font-size: 1.6em;
}

@media (max-width: 480px) {
    #mm-countdown-timer {
        flex-wrap: wrap;
    }
    
    #mm-countdown-timer > div {
        flex-basis: 48%;
    }
    
    #mm-countdown-timer span {
        font-size: 1.8em;
    }
}