/**
 * toplist.css - Hall of Fame Layout
 * Max length: ~100 lines
 */

/* 1. Haupt-Layout (Das Grid) */
.toplist-wrapper {
    display: grid !important;
    /* 1fr für die Masterliste, 350px für die Sidebar Awards */
    grid-template-columns: 1fr 350px !important; 
    gap: 30px !important;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    align-items: start;
}

/* 2. Glass-Card Basis-Design */
.glass-card {
    background: rgba(15, 15, 15, 0.65) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    overflow: hidden;
}

/* 3. Master-Tabelle Styling */
.toplist-main {
    min-width: 0; /* Verhindert Layout-Bruch durch Tabellenbreite */
}

.main-stats-box {
    padding: 25px;
}

.master-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-top: 20px;
}

.master-table th {
    padding: 10px 15px;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
}

.master-table td {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.master-table tr td:first-child { border-radius: 8px 0 0 8px; }
.master-table tr td:last-child { border-radius: 0 8px 8px 0; }

.master-list-row {
    transition: background-color 0.1s ease-in-out;
}

.master-list-row:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Optional: Die Zelle mit dem Namen beim Hover leicht hervorheben */
.master-list-row:hover .driver-cell strong {
    color: var(--accent-color, #FFD700); /* Oder deine Hauptfarbe */
}

/* Suchfeld Styling */
.search-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-wrapper input {
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    font-size: 0.9rem;
}

/* Die Masterliste begrenzen */
.table-responsive {
    max-height: 700px; /* Hier wird die Liste gestoppt */
    overflow-y: auto;
    margin-top: 15px;
    scrollbar-width: thin;
    scrollbar-color: #ffd700 rgba(0,0,0,0.2);
}

/* Fixierter Tabellen-Header beim Scrollen */
.master-table thead th {
    position: sticky;
    top: 0;
    background: #111; /* Hintergrundfarbe deiner Box */
    z-index: 10;
}

/* 4. Fahrer-Details */
.driver-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.driver-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: #222;
}

.color-gold { color: #ffd700; font-weight: bold; }

/* 5. Sidebar & Achievement-Boxen */
.toplist-sidebar {
    position: flex;
    top: 20px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.achievement-box {
    padding: 20px;
}

.achievement-box h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.achievement-list {
    list-style: none;
    padding: 0;
}

.achievement-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.achievement-list li:last-child { border-bottom: none; }

.badge {
    background: #ffd700;
    color: #000;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

/* 6. Responsiveness */
@media (max-width: 1200px) {
    .toplist-wrapper {
        grid-template-columns: 1fr !important; /* Untereinander auf kleinen Screens */
    }
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #ffd700;
    padding: 18px;
    border-radius: 10px;
    transition: transform 0.2s ease;
}

.history-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.05);
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Abstand zwischen den Zeilen */
}

.s-league-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.s-meta-info {
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
    margin-bottom: 5px;
}

.s-winner {
    color: #ffd700; /* Gold */
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.s-runner-up {
    font-weight: 500;
    color: #bdc3c7; /* Helleres Silber */
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2));
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    opacity: 0.9;
}

.s-runner-up i {
    font-size: 0.75rem;
    color: #a5a5a5; /* Etwas dunkleres Silber für das Icon */
}

.season-date { font-size: 0.75rem; opacity: 0.5; }
.season-title { font-weight: bold; margin: 5px 0; color: #eee; }
.season-winner { color: #ffd700; font-size: 0.9rem; }

.master-table td:last-child {
    color: #ffffff; /* Reines Weiß für die Punkte */
    font-weight: 800;
    background: rgba(255, 255, 255, 0.05); /* Etwas dunklerer Hintergrund für die letzte Spalte */
}