/* ==========================================================================
   F1 Stars Live Timing Dashboard Stylesheet
   ========================================================================== */

:root {
    --f1-red: #e10600;
    --f1-dark-bg: #15151c;
    --f1-card-bg: rgba(28, 28, 36, 0.75);
    --f1-border: rgba(255, 255, 255, 0.08);
    --f1-text-primary: #ffffff;
    --f1-text-secondary: #a0a0ab;
    --f1-purple: #b026ff; /* Fastest lap color */
    --f1-green: #00e676; /* Live status, interval ok */
    --font-f1: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.f1-live-dashboard-container {
    background-color: var(--f1-dark-bg);
    color: var(--f1-text-primary);
    font-family: var(--font-f1);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    margin: 20px 0;
    border: 1px solid var(--f1-border);
    position: relative;
    overflow: hidden;
}

/* Carbon Fiber effect background */
.f1-live-dashboard-container::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%), 
        linear-gradient(-45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%), 
        linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%);
    background-size: 4px 4px;
    background-position: 0 0, 0 2px, 2px -2px, -2px 0px;
    z-index: 0;
    opacity: 0.15;
    pointer-events: none;
}

.f1-dashboard-header {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-bottom: 2px solid var(--f1-border);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.f1-header-title-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.f1-live-badge {
    background-color: var(--f1-red);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: f1-pulse 1.8s infinite;
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.4);
}

.f1-live-badge::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
}

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

.f1-header-title-area h2 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #d5d5db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.f1-session-selector-wrapper {
    position: relative;
    z-index: 2;
}

.f1-session-select {
    background: rgba(30, 30, 40, 0.85) !important;
    color: var(--f1-text-primary) !important;
    border: 1px solid var(--f1-border) !important;
    border-radius: 8px !important;
    padding: 10px 36px 10px 16px !important;
    font-size: 0.95rem !important;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.f1-session-select:hover, .f1-session-select:focus {
    border-color: var(--f1-red) !important;
    box-shadow: 0 0 10px rgba(225, 6, 0, 0.25);
}

.f1-dashboard-layout {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Glassmorphism Card Panels */
.f1-dashboard-card {
    background: var(--f1-card-bg);
    border: 1px solid var(--f1-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.f1-dashboard-card:hover {
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.35);
}

.f1-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--f1-border);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.f1-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.f1-card-header h3::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    background-color: var(--f1-red);
    border-radius: 2px;
}

/* Live Timing Table styling */
.f1-table-wrapper {
    overflow-x: auto;
}

.f1-timing-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.f1-timing-table th {
    color: var(--f1-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 12px 8px;
    border-bottom: 2px solid var(--f1-border);
}

.f1-timing-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--f1-border);
    vertical-align: middle;
}

.f1-row-driver {
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
}

.f1-row-driver:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.f1-td-pos {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--f1-text-primary);
    width: 30px;
    text-align: center;
}

.f1-td-driver {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.f1-driver-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #333;
    object-fit: cover;
    border: 1px solid var(--f1-border);
}

.f1-driver-meta {
    display: flex;
    flex-direction: column;
}

.f1-driver-fullname {
    font-weight: 700;
    color: #fff;
}

.f1-driver-acronym {
    font-size: 0.75rem;
    color: var(--f1-text-secondary);
}

.f1-driver-number {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 800;
    align-self: flex-start;
}

.f1-td-team {
    font-weight: 600;
    color: var(--f1-text-secondary);
}

.f1-td-gap, .f1-td-interval {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
    color: #e0e0e0;
}

.f1-td-gap.leader, .f1-td-interval.leader {
    color: var(--f1-green);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.f1-td-laptime, .f1-td-besttime {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
}

.f1-td-besttime.overall-fastest {
    color: var(--f1-purple);
    text-shadow: 0 0 8px rgba(176, 38, 255, 0.4);
}

.f1-td-tyre {
    text-align: center;
}

.f1-tyre-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    line-height: 18px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 900;
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #000;
}

.f1-tyre-badge.S { background-color: #ff1744; color: #fff; } /* Soft */
.f1-tyre-badge.M { background-color: #ffea00; color: #000; } /* Medium */
.f1-tyre-badge.H { background-color: #f5f5f5; color: #000; } /* Hard */
.f1-tyre-badge.I { background-color: #00e676; color: #000; } /* Intermediate */
.f1-tyre-badge.W { background-color: #2979ff; color: #fff; } /* Wet */
.f1-tyre-badge.unknown { background-color: #616161; color: #fff; }

/* Tabs container styling */
.f1-tabs-header {
    display: flex;
    border-bottom: 1px solid var(--f1-border);
    margin-bottom: 20px;
    gap: 5px;
}

.f1-tab-btn {
    background: transparent !important;
    border: none !important;
    color: var(--f1-text-secondary) !important;
    padding: 10px 16px !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    border-bottom: 3px solid transparent !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    text-transform: uppercase;
}

.f1-tab-btn:hover {
    color: var(--f1-text-primary) !important;
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.f1-tab-btn.active {
    color: var(--f1-red) !important;
    border-bottom-color: var(--f1-red) !important;
}

.f1-tab-content {
    display: none;
}

.f1-tab-content.active {
    display: block;
    animation: f1-fade-in 0.3s ease;
}

@keyframes f1-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Telemetry tab styling */
.f1-telemetry-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

@media (max-width: 600px) {
    .f1-telemetry-controls {
        grid-template-columns: 1fr;
    }
}

.f1-telemetry-select {
    background: rgba(30, 30, 40, 0.7) !important;
    color: #fff !important;
    border: 1px solid var(--f1-border) !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
}

.f1-chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: rgba(10, 10, 15, 0.5);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--f1-border);
}

.f1-telemetry-metrics-summary {
    margin-top: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.f1-metric-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--f1-border);
    border-radius: 8px;
    padding: 12px;
}

.f1-metric-title {
    font-size: 0.75rem;
    color: var(--f1-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.f1-metric-values {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
}

.f1-metric-val-a { color: #00e5ff; }
.f1-metric-val-b { color: #ff3d00; }

/* Weather Widget styling */
.f1-weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.f1-weather-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--f1-border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.f1-weather-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.f1-weather-label {
    font-size: 0.75rem;
    color: var(--f1-text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.f1-weather-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
}

/* Team Radio Feed styling */
.f1-radio-feed {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 5px;
}

.f1-radio-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--f1-border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 4px solid #555;
    transition: transform 0.2s ease;
}

.f1-radio-card:hover {
    transform: translateX(3px);
}

.f1-radio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.f1-radio-driver-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.f1-radio-driver-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.f1-radio-time {
    font-size: 0.75rem;
    color: var(--f1-text-secondary);
}

.f1-radio-audio {
    width: 100%;
    height: 32px;
    outline: none;
    border-radius: 4px;
}

.f1-radio-audio::-webkit-media-controls-panel {
    background-color: rgba(30, 30, 40, 0.9);
}

.f1-radio-audio::-webkit-media-controls-play-button {
    filter: invert(1);
}

.f1-radio-audio::-webkit-media-controls-current-time-display,
.f1-radio-audio::-webkit-media-controls-time-remaining-display {
    color: #fff;
}

.f1-no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--f1-text-secondary);
    font-style: italic;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px dashed var(--f1-border);
}

.f1-dashboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 15px;
    color: var(--f1-text-secondary);
}

.f1-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--f1-border);
    border-top: 4px solid var(--f1-red);
    border-radius: 50%;
    animation: f1-spin 1s linear infinite;
}

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

.f1-start-btn {
    background-color: var(--f1-red) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 24px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(225, 6, 0, 0.2) !important;
    text-transform: uppercase;
}

.f1-start-btn:hover:not(:disabled) {
    background-color: #ff1a13 !important;
    box-shadow: 0 0 15px rgba(225, 6, 0, 0.4) !important;
    transform: translateY(-1px);
}

.f1-start-btn:active:not(:disabled) {
    transform: translateY(0);
}

.f1-start-btn:disabled {
    background-color: #33333e !important;
    color: #666670 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    opacity: 0.6;
}

.f1-sector-cell {
    font-family: 'Courier New', Courier, monospace !important;
    font-weight: 700 !important;
    text-align: center !important;
    font-size: 0.85rem !important;
}

.f1-sector-yellow {
    color: #ffeb3b !important; /* Yellow: slower than personal best */
}

.f1-sector-green {
    color: #00e676 !important; /* Green: personal best */
}

.f1-sector-purple {
    color: #d500f9 !important; /* Purple: session overall best */
    text-shadow: 0 0 6px rgba(213, 0, 249, 0.45);
}
