/* CSS Variables for Driver Dashboard */
:root {
    --dash-sprint-color: #0c7abf;
    --dash-latemodel-color: #ffde00;
    --dash-woo-color: #ea0000;
    --dash-ascs-color: #d32f2f;
    --dash-superdirt-color: #ED1C24;
    --dash-xtreme-color: #C12B2A;
    --dash-nationals-color: #F15A22;
    --dash-radius: 8px;
    --dash-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --dash-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
    --dash-border: 1px solid #e0e0e0;
    --dash-bg: #fff;
    --dash-bg-muted: #f9f9f9;
}

/* ─── Main Container ─── */
.dash-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ─── Tab Navigation (Segmented Control) ─── */
.dash-button-container {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    margin-bottom: 0;
    background: var(--dash-bg-muted);
    border: var(--dash-border);
    border-radius: var(--dash-radius);
    overflow: hidden;
}

.dash-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.25rem;
    width: auto;

    /* Typography */
    font-family: 'Oswald', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.025em !important;
    white-space: nowrap;
    color: #555 !important;

    /* Visual */
    background: transparent !important;
    border: none !important;
    border-right: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: background 0.2s ease, color 0.2s ease !important;
}

.dash-button:last-child {
    border-right: none !important;
}

.dash-button:hover {
    color: #222 !important;
    background: #eee !important;
    transform: none !important;
    box-shadow: none !important;
}

.dash-button:focus {
    outline: 2px solid var(--dash-accent, #0c7abf) !important;
    outline-offset: -2px !important;
}

/* Series accent color — set per series, used throughout the dash */
.dash-series-sprint { --dash-accent: var(--dash-sprint-color); --dash-accent-text: #fff; --dash-accent-link: var(--dash-sprint-color); }
.dash-series-lm { --dash-accent: var(--dash-latemodel-color); --dash-accent-text: #000; --dash-accent-link: #b8960a; }
.dash-series-ascs { --dash-accent: var(--dash-ascs-color); --dash-accent-text: #fff; --dash-accent-link: var(--dash-ascs-color); }
.dash-series-superdirt { --dash-accent: var(--dash-superdirt-color); --dash-accent-text: #fff; --dash-accent-link: var(--dash-superdirt-color); }
.dash-series-xtreme { --dash-accent: var(--dash-xtreme-color); --dash-accent-text: #fff; --dash-accent-link: var(--dash-xtreme-color); }
.dash-series-nationals { --dash-accent: var(--dash-nationals-color); --dash-accent-text: #fff; --dash-accent-link: var(--dash-nationals-color); }

.dash-button.active {
    color: var(--dash-accent-text, #fff) !important;
    background: var(--dash-accent, #0c7abf) !important;
    border-color: var(--dash-accent, #0c7abf) !important;
}

/* Mobile segmented control */
@media (max-width: 768px) {
    .dash-button-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        border-radius: var(--dash-radius);
    }

    .dash-button {
        width: 100%;
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
        text-align: center;
        min-height: 2.75rem;
        border-right: 1px solid #e0e0e0;
        border-bottom: 1px solid #e0e0e0;
    }

    /* Remove right border on even (last in row) items */
    .dash-button:nth-child(2n) {
        border-right: none;
    }

    /* Remove bottom border on last row */
    .dash-button:nth-last-child(-n+2) {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .dash-button-container {
        grid-template-columns: 1fr;
    }

    .dash-button {
        padding: 0.875rem 0.5rem;
        font-size: 0.85rem;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .dash-button:last-child {
        border-bottom: none;
    }
}


/* ─── Tab Content Panels ─── */
.driverdash-info {
    padding: 2rem;
    margin-bottom: 0;
    background-color: var(--dash-bg);
    border: var(--dash-border);
    border-radius: var(--dash-radius);
    box-shadow: var(--dash-shadow);
}

.driverdash-info h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #eee;
    color: #222;
}

.driverdash-info a {
    color: var(--dash-accent-link, #0c7abf);
    text-decoration: none;
    transition: color 0.2s ease;
}

.driverdash-info a:hover {
    color: var(--hover-color, #171717);
    text-decoration: underline;
}

.driverdash-info p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #333;
}

@media (max-width: 768px) {
    .driverdash-info {
        padding: 1.25rem;
    }

    .driverdash-info h2 {
        font-size: 1.25rem;
    }
}


/* ─── Link Card Lists (Comp Guides, Order of Events) ─── */
.dash-link-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dash-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--dash-bg-muted);
    border: var(--dash-border);
    border-radius: var(--dash-radius);
    text-decoration: none !important;
    color: #333 !important;
    transition: all 0.2s ease;
}

.dash-link-card:hover {
    background: #fff;
    box-shadow: var(--dash-shadow-hover);
    border-color: var(--dash-accent-link, #0c7abf);
    transform: translateX(4px);
    color: #333 !important;
    text-decoration: none !important;
}

.dash-link-date {
    flex-shrink: 0;
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dash-accent-link, #0c7abf);
    min-width: 140px;
}

.dash-link-date .date-separator {
    font-size: 0.75rem;
    text-transform: lowercase;
    opacity: 0.7;
}

.dash-link-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.dash-link-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    opacity: 0.4;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.dash-link-card:hover .dash-link-icon {
    opacity: 1;
    transform: translateX(4px);
}

@media (max-width: 600px) {
    .dash-link-card {
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.875rem 1rem;
    }

    .dash-link-date {
        min-width: auto;
        width: 100%;
        font-size: 0.8rem;
    }

    .dash-link-name {
        width: 100%;
    }

    .dash-link-icon {
        display: none;
    }
}


/* ─── Rules + Membership Grid ─── */
.rules-membership-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.rules-col {
    /* Styles for each column in the rules/membership grid */
}

.rules-col h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #222;
}

.rules-col p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #333;
}

.rules-col a {
    color: var(--dash-accent-link, #0c7abf);
    text-decoration: none;
    font-weight: 500;
}

.rules-col a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .rules-membership-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ─── Rules Section ─── */
.rules-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.rules-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}


/* ─── Contingency Rules Intro ─── */
.contingency-rules {
    background: var(--dash-bg-muted);
    border: var(--dash-border);
    border-radius: var(--dash-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
}


/* ─── Contingency Award Cards ─── */
.contingencys {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0;
}

.conti-card {
    background: var(--dash-bg);
    border: var(--dash-border);
    border-radius: var(--dash-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.conti-card:hover {
    box-shadow: var(--dash-shadow-hover);
    transform: translateY(-2px);
}

.conti-card-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--dash-bg-muted);
    border-bottom: var(--dash-border);
}

.conti-card-logo img {
    max-width: 200px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.conti-card-body {
    padding: 1.25rem;
    text-align: left;
    flex: 1;
}

.conti-card-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #222;
}

.conti-card-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444;
}

.conti-card-desc ul {
    list-style: disc;
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.conti-card-desc ul li {
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

@media (max-width: 680px) {
    .contingencys {
        grid-template-columns: 1fr;
    }
}


/* ─── Exclusivity / Winner Circle Bonus ─── */
.exclusivity-bonus {
    border: var(--dash-border);
    border-radius: var(--dash-radius);
    overflow: hidden;
}


/* ─── Table Wrapper ─── */
.table-wrapper {
    padding: 0.5rem;
    overflow-x: auto;
}

/* ─── Dashboard Tables ─── */
.driverdash-info table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--dash-radius);
    overflow: hidden;
    font-size: 0.95rem;
}

.driverdash-info table caption {
    font-family: 'Oswald', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    color: #222;
    caption-side: top;
}

.driverdash-info table thead th {
    background: var(--dash-accent, #0c7abf);
    color: var(--dash-accent-text, #fff);
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.75rem 1rem;
    text-align: left;
    border: none;
}

.driverdash-info table tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #eee;
    color: #333;
}

.driverdash-info table tbody tr:last-child td {
    border-bottom: none;
}

.driverdash-info table tbody tr:nth-child(even) {
    background: var(--dash-bg-muted);
}

.driverdash-info table tbody tr:hover {
    background: #f0f0f0;
}

/* Right-align currency/number columns */
.driverdash-info table td:last-child {
    text-align: right;
    font-weight: 500;
}

.driverdash-info table thead th:last-child {
    text-align: right;
}

.driverdash-info table tfoot td {
    font-weight: 700;
    background: #222;
    color: #fff;
    border-bottom: none;
}

.driverdash-info table tfoot tr:hover {
    background: #222;
}

.driverdash-info table tbody td:first-child,
.driverdash-info table thead th:first-child,
.driverdash-info table tfoot td:first-child {
    text-align: center;
    font-weight: 600;
}

/* Section headings within tab content (e.g. Standard Purses, Special Events) */
.driverdash-info .section {
    margin-bottom: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.driverdash-info .section h2 {
    width: 100%;
    border-bottom: 3px solid var(--dash-accent, #0c7abf);
    padding-bottom: 0.5rem;
    margin-top: 0;
}

.driverdash-info .section .purse-group {
    flex: 1 1 250px;
    max-width: calc(33.333% - 1rem);
    min-width: 220px;
}

.driverdash-info .section .purse-group h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #444;
    margin: 0 0 0.5rem 0;
}

.driverdash-info .section .purse-group table {
    margin-bottom: 0;
}

.driverdash-info h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: #444;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 900px) {
    .driverdash-info .section .purse-group {
        max-width: calc(50% - 0.75rem);
    }
}

@media (max-width: 600px) {
    .driverdash-info .section .purse-group {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .driverdash-info table {
        font-size: 0.85rem;
    }

    .driverdash-info table thead th,
    .driverdash-info table tbody td,
    .driverdash-info table tfoot td {
        padding: 0.5rem 0.75rem;
    }
}


/* ─── Tire Rules Section ─── */
.tire-rules-list {
    margin-top: 1rem;
}

.tire-rules-event {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--dash-bg-muted);
    border: var(--dash-border);
    border-radius: var(--dash-radius);
}

.tire-rules-event:last-child {
    margin-bottom: 0;
}

.tire-rules-event h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.tire-rules-track {
    margin-bottom: 0.75rem;
    padding-left: 1rem;
}

.tire-rules-track:last-child {
    margin-bottom: 0;
}

.tire-rules-track .track-name {
    margin-bottom: 0.25rem;
}

.tire-rules-track p {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.tire-rules-track p:last-child {
    margin-bottom: 0;
}
