html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* Ensure accessible and neat focus indicators across modern touch devices */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    
    padding-bottom: 40px;
    background-color: var(--bg-app);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

@media (min-width: 768px) {
    body {
        padding-bottom: 60px;
    }
}

/* --- Variables --- */
:root {
    --bg-app: #f4f7f9;
    --bg-panel: #ffffff;
    --bg-nested: #f8fafb;
    --border-color: #dbe3e8;
    --text-main: #374151;
    --text-muted: #7b8794;
    --accent-blue: #7ba7c7;
    --accent-hover: #6895b6;
    --success: #2f9e5c;
    --danger: #dc2626;
}

.dark-theme {
    --bg-app: #0f172a;
    --bg-panel: #1e293b;
    --bg-nested: #334155;
    --border-color: #475569;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-blue: #38bdf8;
    --accent-hover: #7dd3fc;
    --success: #55a37f;
    --danger: #f87171;
}

/* --- Base --- */
body {
    background-color: var(--bg-app);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-family: "Segoe UI", sans-serif;
    min-height: 100vh;
}

/* --- Components --- */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.03);
}

.navbar-mgmt {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
}

/* FIX: Hamburger Menu Visibility */
.dark-theme .navbar-toggler-icon {
    filter: invert(1);
}

/* --- Inputs --- */
.dark-theme input.form-control,
.dark-theme .pole-time-input input {
    background-color: var(--bg-nested) !important;
    color: var(--text-main) !important;
    border: 2px solid var(--border-color) !important;
}

/* --- Grids --- */
.driver-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .driver-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .driver-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 1. Variables --- */
:root {
    --bg-app: #f4f7f9;
    --bg-panel: #ffffff;
    --bg-nested: #f8fafb;
    --navbar-bg: rgba(255, 255, 255, 0.8);
    --banner-bg: #ffffff;
    --border-color: #dbe3e8;
    --text-main: #374151;
    --text-muted: #7b8794;
    --accent-blue: #38bdf8;
    --accent-hover: #0ea5e9;
}

.dark-theme {
    --bg-app: #0f172a;
    --bg-panel: #1e293b;
    --bg-nested: #334155;
    --navbar-bg: rgba(30, 41, 59, 0.9);
    --banner-bg: #1e293b;
    --border-color: #475569;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-blue: #38bdf8;
    --accent-hover: #7dd3fc;
}

/* --- 2. Base Styles --- */
body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: "Segoe UI", sans-serif;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- 3. Navbar & Banner --- */
.navbar-mgmt {
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
}

.navbar-brand {
    color: var(--accent-blue) !important;
    font-weight: 700;
}

.nav-link {
    color: var(--text-muted) !important;
    text-transform: uppercase;
    font-size: 0.85rem;
}

    .nav-link:hover, .nav-link.active {
        color: var(--accent-blue) !important;
    }


/* --- 4. Cards & Components --- */
.card, .panel, .financials-panel, .current-team-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.btn-primary {
    background: var(--accent-blue);
    border: none;
}

    .btn-primary:hover {
        background: var(--accent-hover);
    }

/* --- 5. Inputs (The "Pole Time" fixes) --- */
input.form-control, .pole-time-input input {
    background-color: var(--bg-panel);
    color: var(--text-main);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    text-align: center;
    padding: 0.5rem;
}

    input.form-control:focus {
        border-color: var(--accent-blue);
        box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
        outline: none;
    }
/* Keep your existing .panel styles, then add this specifically for the banner */
.race-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem; /* Match your other panels */
}

.banner-content {
    display: flex;
    flex-direction: column;
}

.next-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.race-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.countdown {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-blue);
}

/* --- Flag Styling --- */
.race-flag-large {
    /*font-size: 2.5rem;*/ /* Makes the emoji "graphic-sized" */
    line-height: 1;
    margin-right: 1rem;
    display: flex;
    align-items: center;
}

/* Ensure the info group is aligned */
.race-info {
    display: flex;
    /*align-items: center;*/
    flex-direction: column;
    gap: 0.15rem;
}

.race-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
}

.race-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
}

.race-circuit {
    font-size: 1rem;
    color: var(--text-secondary);
}

.sprint-badge {
    align-self: flex-start;
    margin-bottom: 0.25rem;
}


/* --- Responsive Mobile Fix --- */
@media (max-width: 576px) {
    .race-banner {
        flex-direction: column;
        align-items: center; /* Center everything on mobile for better flow */
        gap: 1rem;
        text-align: center;
    }

    .race-info {
        flex-direction: column; /* Stack flag on top of text on mobile */
        gap: 0.5rem;
    }

    .race-flag-large {
        margin-right: 0;
    }
}
/* 1. Force the hamburger icon to render in high-contrast white */
.navbar-mgmt .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.95)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}

/* 2. Give the toggler button a clean, subtle border */
.navbar-mgmt .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* 3. Re-introduce safe edge padding on mobile so things don't hug the screen bezel */
@media (max-width: 991.98px) {
    .navbar-mgmt .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}