/**
 * Styles pour WRC Live Timing - Frontend
 */

/* Container principal */
.wrc-standings,
.wrc-stage-times,
.wrc-live-results,
.wrc-calendar,
.wrc-stage-winners {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Tables */
.wrc-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.wrc-table thead {
    background: #e30613;
    color: #fff;
}

.wrc-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wrc-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.wrc-table tbody tr:hover {
    background-color: #f8f9fa;
}

.wrc-table tbody td {
    padding: 12px 15px;
    font-size: 14px;
}

/* Position */
.wrc-position {
    font-weight: 700;
    font-size: 16px;
    color: #333;
    width: 50px;
    text-align: center;
}

.wrc-table tbody tr:nth-child(1) .wrc-position {
    color: #FFD700;
}

.wrc-table tbody tr:nth-child(2) .wrc-position {
    color: #C0C0C0;
}

.wrc-table tbody tr:nth-child(3) .wrc-position {
    color: #CD7F32;
}

/* Temps et écarts */
.wrc-time {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #2c3e50;
}

.wrc-diff {
    font-family: 'Courier New', monospace;
    color: #e74c3c;
    font-size: 13px;
}

/* Ligne la plus rapide */
.wrc-fastest {
    background-color: #fff3cd !important;
    font-weight: 600;
}

.wrc-fastest td {
    border-left: 3px solid #FFD700;
}

/* Pays */
.wrc-country {
    display: inline-block;
    background: #6c757d;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 5px;
}

/* Live Results */
.wrc-live-results {
    border: 2px solid #e30613;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
}

.wrc-live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.wrc-live-header h3 {
    margin: 0;
    color: #e30613;
    font-size: 24px;
}

.wrc-refresh-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #28a745;
    font-weight: 600;
    font-size: 14px;
}

.wrc-dot {
    width: 10px;
    height: 10px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Calendrier */
.wrc-calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.wrc-calendar-item {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.wrc-calendar-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.wrc-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.wrc-calendar-header h4 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
    line-height: 1.4;
}

.wrc-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.wrc-status-completed .wrc-status-badge {
    background: #28a745;
    color: #fff;
}

.wrc-status-running .wrc-status-badge {
    background: #e30613;
    color: #fff;
}

.wrc-status-scheduled .wrc-status-badge {
    background: #6c757d;
    color: #fff;
}

.wrc-calendar-dates {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 14px;
}

.wrc-calendar-dates .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .wrc-table {
        font-size: 12px;
    }
    
    .wrc-table thead th,
    .wrc-table tbody td {
        padding: 8px 10px;
    }
    
    .wrc-calendar-grid {
        grid-template-columns: 1fr;
    }
    
    .wrc-live-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Widgets */
.widget .wrc-table {
    font-size: 12px;
}

.widget .wrc-table thead th,
.widget .wrc-table tbody td {
    padding: 8px;
}

/* Loading spinner */
.wrc-loading {
    text-align: center;
    padding: 40px;
}

.wrc-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e30613;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
