/*############### Tabellen-Formatierungen ############*/

/* --- BASIS-STRUKTUR & SCROLLBAR --- */
.racing-table-v1 {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    margin: 10px 0;
    font-family: sans-serif;
    font-size: 14px;
    background-color: transparent;
}

.uk-overflow-auto::-webkit-scrollbar { height: 8px; }
.uk-overflow-auto::-webkit-scrollbar-track { background: #f1f1f1; }
.uk-overflow-auto::-webkit-scrollbar-thumb { background: #ff6600; border-radius: 10px; }

/* --- HEADER DESIGN --- */
.racing-table-v1 th {
    background-color: #ff6600 !important;
    color: #000 !important;
    padding: 8px 10px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    border: none;
    text-align: center;
}

.racing-table-v1 th.col-driver, 
.racing-table-v1 th.col-team { text-align: left; }
.racing-table-v1 th:first-child { border-radius: 4px 0 0 4px; }
.racing-table-v1 th:last-child { border-radius: 0 4px 4px 0; }

.racing-table-v1 th.col-race-combined {
    background-color: #e65c00 !important;
    color: #fff !important;
    font-size: 10px;
    min-width: 50px;
}

/* --- ZEILEN-DESIGN --- */
.racing-table-v1 tbody tr td {
    background-color: #ffffff;
    padding: 6px 10px;
    vertical-align: middle;
    color: #333;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    cursor: pointer; /* Zeigt an, dass man klicken kann */
    transition: background-color 0.2s ease;
}

.racing-table-v1 tbody tr td:first-child { border-radius: 4px 0 0 4px; }
.racing-table-v1 tbody tr td:last-child { border-radius: 0 4px 4px 0; }

/* Spalten-Spezifikationen */
.racing-table-v1 .col-pos { width: 50px; text-align: center; background-color: #ff6600 !important; color: #000 !important; font-weight: 700; }
.racing-table-v1 .col-driver { font-weight: 600; padding-left: 15px; white-space: nowrap; width: 1%; }
.racing-table-v1 .col-team { color: #777; font-size: 12px; padding-left: 20px; }
.racing-table-v1 .col-total { width: 70px; text-align: center; font-weight: 700; background-color: #f9f9f9 !important; border-left: 1px solid #eee !important; }

/* RENNERGEBNIS-ZELLE (Kombiniert) */
.racing-table-v1 .col-race-combined {
    text-align: center;
    border-right: 2px solid #ddd !important;
}

.race-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.race-pos-val { color: #000; font-weight: 600; font-size: 13px; }
.race-points-val { color: #555; font-size: 11px; font-style: italic; font-weight: 400; }

/* Top 3 Highlights */
.racing-table-v1 td.col-race-combined.bg-gold { background-color: #fff9c4 !important; border-bottom: 2px solid #fbc02d; }
.racing-table-v1 td.col-race-combined.bg-silver { background-color: #f5f5f5 !important; border-bottom: 2px solid #bdbdbd; }
.racing-table-v1 td.col-race-combined.bg-bronze { background-color: #efe0d0 !important; border-bottom: 2px solid #a1887f; }

.racing-table-v1 .col-race-combined:last-child { border-right: none !important; }

/* --- HOVER & CLICK MARKIERUNG --- */

/* Der Hover-Effekt: Gilt für alle Zellen der Zeile außer der fest-orangenen Pos-Spalte */
.racing-table-v1 tbody tr:hover td:not(.col-pos) {
    background-color: #fff2e6 !important;
}

/* Die Markierung (durch Klick oder Suche) */
.racing-table-v1 tr.row-highlight td:not(.col-pos) {
    background-color: #ffeadb !important; /* Etwas kräftigeres Orange als Hover */
    border-top: 1px solid #ff6600 !important;
    border-bottom: 1px solid #ff6600 !important;
}

/* --- MEDAILLEN-PLÄTZE (GESAMT-POS) --- */
.racing-table-v1 tbody tr:nth-child(-n+3) .col-pos { font-size: 0; position: relative; }
.racing-table-v1 tbody tr:nth-child(-n+3) .col-pos::after {
    display: inline-block; width: 24px; height: 24px; line-height: 24px; border-radius: 50%;
    font-size: 13px; font-weight: 800; color: #000; text-align: center; vertical-align: middle;
}
.racing-table-v1 tbody tr:nth-child(1) .col-pos::after { content: "1"; background: linear-gradient(135deg, #FFD700 0%, #FFB900 100%); }
.racing-table-v1 tbody tr:nth-child(2) .col-pos::after { content: "2"; background: linear-gradient(135deg, #E0E0E0 0%, #B0B0B0 100%); }
.racing-table-v1 tbody tr:nth-child(3) .col-pos::after { content: "3"; background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%); }

/* --- SUCHE --- */
.table-search-container { margin-bottom: 15px; position: relative; max-width: 300px; }
#driverSearch { width: 100%; padding: 10px 15px 10px 35px; border: 2px solid #eee; border-radius: 20px; font-size: 14px; outline: none; }
#driverSearch:focus { border-color: #ff6600; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #888; }

/* --- MOBILE OPTIMIERUNG --- */
.mobile-team { display: none; }

@media (max-width: 767px) {
    .racing-table-v1 .col-team { display: none !important; }
    .racing-table-v1 .col-driver { padding-top: 5px !important; padding-bottom: 5px !important; line-height: 1.1; }
    .mobile-team { display: block !important; font-size: 10px; color: #888; margin-top: -2px; line-height: 1; }
    .race-wrapper { flex-direction: column; gap: 0; }
    .race-pos-val { font-size: 12px; line-height: 1.1; display: block; }
    .race-points-val { font-size: 9px; font-style: normal; display: block; margin-top: -2px; line-height: 1; color: #888; }
    .racing-table-v1 .col-race-combined { min-width: 32px; padding: 4px 2px !important; border-right: 1px solid #eee !important; }
}