/* F1 Data Viz Styles */

:root {
    --f1-red: #E10600;
    --f1-black: #000000;
    --f1-white: #FFFFFF;
    --f1-gray: #38383F;
    --f1-dark: #1F1F2B;
    --f1-darker: #1a1a2e;
    --f1-border: #2D2D3A;
}

body {
    background-color: var(--f1-black);
    color: #FFFFFF;
    font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Force high contrast text */
.text-muted {
    color: #B0B0B0 !important;
}

.card-body, .card-header {
    color: #FFFFFF;
}

h1, h2, h3, h4, h5, h6 {
    color: #FFFFFF;
}

p, span, div {
    color: inherit;
}

.small, small {
    color: #CCCCCC;
}

/* Cards */
.card {
    background-color: var(--f1-dark);
    border: 1px solid var(--f1-border);
    border-radius: 8px;
}

.card-header {
    background-color: var(--f1-darker);
    border-bottom: 1px solid var(--f1-border);
}

/* Tables */
.table-dark {
    --bs-table-bg: var(--f1-dark);
    --bs-table-border-color: var(--f1-border);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
}

/* Team Colors */
.team-redbull { color: #3671C6; }
.team-mercedes { color: #27F4D2; }
.team-ferrari { color: #E8002D; }
.team-mclaren { color: #FF8000; }
.team-astonmartin { color: #229971; }
.team-alpine { color: #FF87BC; }
.team-williams { color: #64C4FF; }
.team-haas { color: #B6BABD; }
.team-sauber { color: #52E252; }
.team-rb { color: #6692FF; }

/* Timing colors */
.timing-purple { color: #A855F7 !important; }
.timing-green { color: #22C55E !important; }
.timing-yellow { color: #EAB308 !important; }
.timing-red { color: #EF4444 !important; }

/* Sector colors */
.sector-purple {
    color: #A855F7 !important;
    font-weight: bold;
}
.sector-green {
    color: #22C55E !important;
}
.sector-yellow {
    color: #EAB308 !important;
}

/* Animations */
.highlight {
    animation: highlight-fade 1s ease-out;
}

@keyframes highlight-fade {
    0% {
        background-color: rgba(225, 6, 0, 0.4);
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Live blink animation */
.blink-badge {
    animation: blink 1.5s infinite;
}

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

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
}

/* Weather Widget */
.weather-widget .weather-stat {
    padding: 0.5rem;
}

.weather-widget .weather-stat .label {
    display: block;
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weather-widget .weather-stat .value {
    font-size: 1.25rem;
    font-weight: bold;
}

.weather-widget .weather-stat .unit {
    font-size: 0.7rem;
    color: #888;
}

/* Timing Table */
.timing-table {
    font-size: 0.85rem;
}

.timing-table th {
    background-color: var(--f1-darker);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 0.5rem;
    border-bottom: 2px solid var(--f1-red);
    position: sticky;
    top: 0;
}

.timing-table td {
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
    transition: background-color 0.3s ease;
}

.timing-table .position {
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
}

.timing-table .driver-name {
    font-weight: 600;
}

.timing-table .driver-acronym {
    font-size: 0.8rem;
}

/* Position delta indicators for race sessions */
.timing-table .position-delta {
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 20px;
    display: inline-block;
}

/* Knocked out drivers (eliminated in qualifying) */
.timing-table tr.knocked-out {
    background-color: rgba(108, 117, 125, 0.15) !important;
    opacity: 0.7;
}

.timing-table tr.knocked-out td {
    color: #888 !important;
}

.timing-table tr.knocked-out .position {
    color: #666 !important;
}

.timing-table tr.knocked-out .status .badge {
    animation: knockout-pulse 2s infinite;
}

@keyframes knockout-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Overall best (purple) */
.timing-table .overall-best {
    color: #A855F7 !important;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

/* Personal best (green) */
.timing-table .personal-best {
    color: #22C55E !important;
    font-weight: bold;
}

/* Race Control Messages */
.race-control-message {
    font-size: 0.8rem;
    border-left: 3px solid transparent;
    transition: transform 0.2s ease;
}

.race-control-message:hover {
    transform: translateX(3px);
}

.race-control-message.bg-warning {
    border-left-color: #ffc107;
    background-color: rgba(255, 193, 7, 0.2) !important;
}

.race-control-message.bg-danger {
    border-left-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.2) !important;
}

.race-control-message.bg-success {
    border-left-color: #198754;
    background-color: rgba(25, 135, 84, 0.2) !important;
}

.race-control-message.bg-info {
    border-left-color: #0dcaf0;
    background-color: rgba(13, 202, 240, 0.2) !important;
}

.race-control-message.bg-secondary {
    border-left-color: #6c757d;
    background-color: rgba(108, 117, 125, 0.2) !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--f1-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--f1-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Navbar */
.navbar {
    background-color: var(--f1-black) !important;
    padding: 1rem 1.5rem;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 1px;
}

.navbar-brand img {
    height: 50px;
}

/* Status badges */
.badge {
    font-weight: 600;
}

/* Connection status indicator */
.connection-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.connection-indicator.connected {
    background-color: #22C55E;
    box-shadow: 0 0 8px #22C55E;
}

.connection-indicator.connecting {
    background-color: #EAB308;
    animation: pulse 1s infinite;
}

.connection-indicator.disconnected {
    background-color: #EF4444;
}

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

/* Responsive adjustments */
@media (max-width: 992px) {
    .timing-table {
        font-size: 0.75rem;
    }

    .timing-table th,
    .timing-table td {
        padding: 0.3rem 0.4rem;
    }

    .weather-widget .weather-stat .value {
        font-size: 1rem;
    }
}
