/* --- FORMULA COLOUR SCHEMES --- */

/* F2 Stock Cars */
.formula-f2stockcars .result-card {
    border-left: 6px solid #005bbb;
}
.formula-f2stockcars .result-view-btn {
    background: #005bbb;
    color: #fff;
}

/* 1300cc Series */
.formula-1300cc-series .result-card {
    border-left: 6px solid #c40000;
}
.formula-1300cc-series .result-view-btn {
    background: #c40000;
    color: #fff;
}

/* Bangers */
.formula-bangers .result-card {
    border-left: 6px solid #333333;
}
.formula-bangers .result-view-btn {
    background: #333333;
    color: #fff;
}

/* Ministox */
.formula-ministox .result-card {
    border-left: 6px solid #ff7a00;
}
.formula-ministox .result-view-btn {
    background: #ff7a00;
    color: #fff;
}

/* Legends */
.formula-legends .result-card {
    border-left: 6px solid #0077ff;
}
.formula-legends .result-view-btn {
    background: #0077ff;
    color: #fff;
}

/* Hot Rods */
.formula-2l-hotrods .result-card {
    border-left: 6px solid #6a0dad;
}
.formula-2l-hotrods .result-view-btn {
    background: #6a0dad;
    color: #fff;
}

/* Results Table Headers */
.formula-f2stockcars .rc-results-table thead th {
    background: #005bbb;
    color: #fff;
    border-bottom-color: #004a99;
}

.formula-1300cc-series .rc-results-table thead th {
    background: #c40000;
    color: #fff;
    border-bottom-color: #c5303d;
}

.formula-bangers .rc-results-table thead th {
    background: #333333;
    color: #fff;
    border-bottom-color: #222;
}

.formula-ministox .rc-results-table thead th {
    background: #ff7a00;
    color: #fff;
    border-bottom-color: #000;
}

.formula-legends .rc-results-table thead th {
    background: #0077ff;
    color: #fff;
    border-bottom-color: #000;
}

.formula-2l-hotrods .rc-results-table thead th {
    background: #6a0dad;
    color: #fff;
    border-bottom-color: #000;
}

.latest-result-tag {
    display: inline-block;
    background: #005bbb;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.results-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.results-tabs .tab-btn {
    padding: 10px 15px;
    background: #333;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.results-tabs .tab-btn.active {
    background: #e60000;
}

/* --- RESULTS LIST --- */
.formula-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* --- CARD --- */
.result-card {
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* --- TOP ROW --- */
.result-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.result-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #222;
}

.result-venue {
    font-weight: 400;
    color: #555;
    margin-left: 6px;
}

/* --- BUTTON --- */
.result-view-btn {
    background: #f2c200;
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease;
}

.result-view-btn:hover {
    background: #e0b700;
}

/* --- SLIDE‑DOWN VIEWER --- */
.result-viewer {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.35s ease;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    padding: 0 14px;
    margin-top: 8px;
}

.result-viewer.loaded {
    padding: 14px;
    max-height: 2000px;
    opacity: 1;
}

/* --- TABLE --- */
.rc-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    margin-top: 10px;
}

.rc-results-table thead th {
    background: #f2c200;
    color: #000;
    padding: 10px;
    font-weight: 700;
    border-bottom: 2px solid #d9ac00;
    text-align: left;
}

.rc-results-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e5e5;
}

.rc-results-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.rc-results-table tr:hover td {
    background: #f7f7f7;
}

/* Formula header rows: light grey with black text */
.result-viewer table tr:has(td:nth-child(2):empty) td {
    background: #e6e6e6;       /* Light grey background */
    color: #000;               /* Black text */
    font-weight: 700;          /* Bold */
    text-align: center;        /* Centre text */
    font-size: 1.05rem;        /* Slightly larger */
    padding: 6px 0;            /* Compact spacing */
    white-space: nowrap;       /* Prevent wrapping */
}

/* Optional: subtle divider between formula blocks */
.result-viewer table tr:has(td:nth-child(2):empty) {
    border-top: 2px solid #ccc;
    border-bottom: 2px solid #ccc;
}

/* ============================================================
   UKSOR FORMULA DASHBOARD — CHAMPIONSHIP SNAPSHOT
============================================================ */

.formula-dashboard-section {
    margin: 0 0 24px;
}

.formula-dashboard-heading {
    background: #111;
    border-left: 4px solid var(--uksor-red);
    padding: 11px 16px;
}

.formula-dashboard-heading h2 {
    margin: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.formula-dashboard-heading h2 i {
    margin-right: 8px;
    color: var(--uksor-red);
}


/* Snapshot row */

.formula-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: #fff;
    border: 1px solid #ddd;
    border-top: 0;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
}


/* Individual snapshot */

.formula-snapshot-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border-right: 1px solid #e1e1e1;
}

.formula-snapshot-card:last-child {
    border-right: 0;
}


/* Icon */

.formula-snapshot-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #111;
    border-radius: 50%;

    color: var(--uksor-red);
    font-size: 17px;
}


/* Text */

.formula-snapshot-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.formula-snapshot-label {
    margin-bottom: 3px;

    color: #777;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.formula-snapshot-content strong {
    color: #111;
    font-size: 20px;
    line-height: 1.15;
}

.formula-snapshot-content > span:last-child {
    margin-top: 3px;

    color: #777;
    font-size: 12px;
}


/* Mobile */

@media (max-width: 700px) {

    .formula-snapshot-grid {
        grid-template-columns: 1fr;
    }

    .formula-snapshot-card {
        border-right: 0;
        border-bottom: 1px solid #e1e1e1;
    }

    .formula-snapshot-card:last-child {
        border-bottom: 0;
    }
}

.dd-winner-box {
    margin-top: 12px;
    padding: 14px 18px;
    border-left: 4px solid var(--uksor-red, #d40000);
    background: #fff6d8;
    border-radius: 4px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    font-size: 16px;
    line-height: 1.3;
    text-align: center;
}

.dd-winner-box strong {
    font-weight: 700;
}

.dd-winner-box::before {
    content: "🏆";
    font-size: 20px;
    line-height: 1;
}

@media (max-width: 600px) {
    .dd-winner-box {
        padding: 12px;
        font-size: 14px;
        flex-wrap: wrap;
    }

    .dd-winner-box::before {
        font-size: 18px;
    }
}