/* Style for the whole body */
body {
    background-color: #1a1a1a;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #eeeeee;
    margin: 0;
}

/* Style for the top-bar */
/* 1. The Container */
.bar a:has(img) {
    display: flex;       /* Turn on the engine for this specific button */
    align-items: center; /* Center the image vertically */
    justify-content: center; /* Center the image horizontally */
    padding: 5px;        /* Small gap so the logo doesn't touch the rounded corners */
}

/* Ensure the image itself doesn't have weird default margins */
.bar img {
    display: block;
    margin: 0 auto;
}
.bar {
    background-color: #2e2e2e;
    padding: 10px 30px; /* Reduced top/bottom padding slightly */
    border-bottom: 2px solid orange;

    display: flex;
    align-items: center; /* This solves the image/text height mismatch */
    gap: 20px;
}

/* 2. Target the links inside the bar */
.bar a {
    color: #f0f0f0;            /* Off-white text */
    text-decoration: none;     /* Removes the ugly underline */
    font-weight: bold;
    font-size: 14px;
    
    padding: 10px 15px;        /* This creates the "box" around the text */
    border-radius: 4px;        /* Slightly rounded corners */
    transition: 0.2s;          /* Makes the hover effect smooth */
}

/* 3. The Hover State (Interactive feel) */
.bar a:hover {
    background-color: #444;    /* Subtle highlight when hovering */
    color: orange;             /* Text turns orange */
}

/* 4. The Logo Link */
/* We don't want the logo to have a background or padding like a button */
.bar > a:first-child {
    background-color: transparent;
    padding: 0;
}

.profile {
    margin-left: auto;
    border: 1px solid orange; /* Give it an outline so it stands out */
}

/* 5. Main Content Container */
.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background-color: #242424;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

h1 {
    color: orange;
    margin-bottom: 20px;
}

/* 6. Form Styling */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
}

input {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #444;
    background-color: #333;
    color: white;
    outline: none;
}

input:focus {
    border-color: orange;
}

button {
    padding: 10px;
    background-color: orange;
    border: none;
    border-radius: 4px;
    color: #1a1a1a;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background-color: #ffaa00;
}

a {
    color: orange;
    text-decoration: none;
}

/* --- CARDS & GRIDS (New) --- */
.card-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    background-color: #2e2e2e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    width: 300px;
    text-align: center;
    transition: 0.3s;
    cursor: pointer;
}

.card:hover {
    border-color: orange;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 165, 0, 0.2);
}

.card h3 { color: orange; margin-bottom: 10px; }
.card p { color: #ccc; font-size: 14px; margin-bottom: 20px; }

/* --- CHAMPIONSHIP SPECIFIC MENU --- */
.sub-bar {
    background-color: #111;
    border-bottom: 2px solid #00ffcc; /* Cyan for race tech feel */
    padding: 10px 30px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.sub-bar a {
    color: #00ffcc;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.sub-bar a:hover {
    color: white;
    text-decoration: underline;
}

/* --- DASHBOARD TABLES --- */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid #444; }
th { color: orange; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Audiowide', sans-serif; /* The master racing font */
    /* 1. Tell the browser to prioritize legibility over smoothness */
    text-rendering: optimizeLegibility;

    /* 2. The 'Sharpening' trick for Mac/Webkit browsers */
    -webkit-font-smoothing: antialiased;

    /* 3. The 'Sharpening' trick for Firefox */
    -moz-osx-font-smoothing: grayscale;
}

/* --- CARDS (For Championships) --- */
.card-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    background-color: #2e2e2e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    width: 300px;
    text-align: center;
    transition: 0.3s;
    cursor: pointer;
}

.card:hover {
    border-color: orange;
    transform: translateY(-5px);
}

.card h3 { color: orange; margin-bottom: 10px; }
.card p { color: #ccc; font-size: 14px; margin-bottom: 20px; }

/* --- CHAMPIONSHIP SUB-BAR --- */
.sub-bar {
    background-color: #111;
    border-bottom: 2px solid #00ffcc; /* Cyan color for racing tech feel */
    padding: 10px 30px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.sub-bar a {
    color: #00ffcc;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.sub-bar a:hover {
    color: white;
    text-decoration: underline;
}

/* --- TABLES --- */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid #444; }
th { color: orange; }

/* --- DROPDOWN MENU STYLES --- */

.dropdown {
    position: relative;
    display: inline-block;
    margin-left: auto; /* Pushes it to the right side of the bar */
}

.dropbtn {
    background-color: transparent;
    color: orange;
    padding: 10px 15px;
    font-size: 14px;
    border: 1px solid orange;
    cursor: pointer;
    text-transform: uppercase;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #2e2e2e;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1;
    border: 1px solid #444;
}

.dropdown-content a {
    color: #f0f0f0;
    padding: 15px 20px;
    text-decoration: none;
    display: block;
    font-size: 16px;
    border-radius: 0;
}

.dropdown-content a:hover {background-color: #444; color: orange;}
.dropdown:hover .dropdown-content {display: block;}
.dropdown:hover .dropbtn {background-color: #444;}

/* --- TOOLTIP --- */
.tooltip {
    position: relative;
    display: inline-block;
    background-color: #555;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    cursor: help;
    font-size: 14px;
    line-height: 20px;
    margin-left: 10px;
}
.tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: #222;
    color: #fff;
    text-align: left;
    border: 1px solid orange;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 12px;
    font-weight: normal;
}
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* --- SPONSOR GRID --- */
.sponsor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.sponsor-card-label {
    cursor: pointer;
    display: block;
}
.sponsor-card-label input[type="radio"] {
    display: none;
}
.sponsor-content {
    background-color: #2e2e2e;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: 0.2s;
    height: 100%;
}

/* The actively saved sponsor */
.sponsor-content.saved-sponsor {
    border-color: #00ffcc;
    background-color: #1a332d;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
}

/* A newly selected sponsor (pending update) */
.sponsor-card-label input[type="radio"]:not(.saved-radio):checked + .sponsor-content {
    border-color: orange;
    background-color: #332200;
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.4);
    transform: scale(1.05); /* Make the pending choice pop out slightly */
}

.sponsor-card-label:hover .sponsor-content {
    border-color: orange;
}

/* --- HISTORY TIMELINE --- */
.history-item {
    border-left: 2px solid orange;
    padding-left: 20px;
    margin-bottom: 20px;
    position: relative;
}
.history-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: orange;
}

/* --- CALENDAR RACE STATUS --- */
.race-card {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.status-border-completed { border-left: 4px solid #00ff00; }
.status-border-pending { border-left: 4px solid orange; }

.status-text-completed { color: #00ff00; }
.status-text-pending { color: orange; }

/* --- STANDINGS POSITIONS --- */
.pos-1 { font-weight: bold; color: gold; }
.pos-2 { font-weight: bold; color: silver; }
.pos-3 { font-weight: bold; color: #cd7f32; }
.pos-default { font-weight: bold; color: gray; }

/* --- RACE CONTROL VOTING --- */
.vote-btn { background: #333; color: white; border: 1px solid #00ffcc; padding: 5px 15px; cursor: pointer; }
.vote-btn-active { background: #00ffcc; color: black; }

/* --- DYNAMIC STATES --- */
.budget-positive { color: #00ff00; }
.budget-negative { color: #ff4444; }

.status-box { padding: 10px; width: 100%; border: 1px solid; }
.status-accepted { border-color: #00ff00; }
.status-reviewing { border-color: red; }

.inbox-msg-card { background: #222; border-radius: 8px; padding: 15px; margin-bottom: 10px; border-left: 4px solid #00ffcc; }
.msg-type-invite { border-left-color: #ff4444; }
.msg-type-system { border-left-color: orange; }
.msg-read { opacity: 0.5; }

.msg-success { color: #00ff00; }
.msg-error { color: #ff4444; }

.dimmed-sponsor { opacity: 0.3; }
.disabled-sponsor { opacity: 0.3; cursor: not-allowed; }

@keyframes goldPulse {
    0% { color: #b8860b; text-shadow: 0 0 2px #b8860b; }
    50% { color: #ffd700; text-shadow: 0 0 10px #ffd700; }
    100% { color: #b8860b; text-shadow: 0 0 2px #b8860b; }
}