/* PSRRGP Frontend Styles - Scoped to prevent conflicts */

.psrrgp-chart-widget {
    max-width: 1200px;
    margin: 30px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333; /* Default text color */
}

.psrrgp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    flex-wrap: wrap;
    gap: 20px;
}

/* Scope white color only to header elements */
.psrrgp-header,
.psrrgp-header *:not(.year-select):not(.year-select *) {
    color: white;
}

.header-left h3,
.psrrgp-title {
    margin: 0 0 12px 0;
    font-size: 26px;
    font-weight: 700;
    color: white !important; /* Explicit white for title */
}

.driver-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.driver-pill {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: white !important; /* Explicit white for pills */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right label,
.psrrgp-label {
    font-weight: 600;
    font-size: 16px;
    color: white !important; /* Explicit white for label */
}

.year-select {
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    background: white;
    color: #1a1a2e !important; /* Dark text for dropdown */
    font-weight: 700;
    cursor: pointer;
    min-width: 120px;
}

.year-select option {
    color: #1a1a2e !important; /* Dark text for options */
}

.psrrgp-chart-container {
    position: relative;
    padding: 25px 30px;
    background: #fff;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    font-size: 18px;
    font-weight: bold;
    color: #0f3460;
    animation: psrrgp-pulse 1.5s infinite;
}

@keyframes psrrgp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.psrrgp-legend-custom {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.legend-label {
    font-size: 15px;
    font-weight: 600;
    color: #333 !important; /* Dark text for legend */
}

.psrrgp-footer {
    padding: 18px 30px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    text-align: center;
}

.psrrgp-footer small,
.psrrgp-footer-text {
    color: rgba(255,255,255,0.85) !important; /* Explicit white for footer */
    font-size: 13px;
}

@media (max-width: 768px) {
    .psrrgp-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    
    .header-right {
        width: 100%;
    }
    
    .year-select {
        width: 100%;
    }
    
    .psrrgp-chart-container {
        padding: 15px;
    }
}