/* Container auf volle Breite */
.profile-container {
    width: 100%;
    margin: 0;
}

/* Hero-Card über die gesamte Breite */
.driver-hero-card {
    width: 100%;
    background: linear-gradient(135deg, rgba(40,40,40,0.9) 0%, rgba(20,20,20,1) 100%);
    border-radius: 15px;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 40px;
    position: relative;
    box-sizing: border-box; /* Wichtig, damit Padding nicht die Breite sprengt */
}

/* Name-Bereich flexibel gestalten */
.hero-info-zone {
    flex: 1; /* Nimmt den restlichen Platz ein */
    min-width: 0; /* Verhindert das Ausbrechen langer Namen */
}

.hero-info-zone h1 {
    font-size: 3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Schneidet bei extrem langen Namen sauber mit ... ab */
    margin: 0;
}

/* Die Hauptkarte */
.driver-hero-card {
    background: linear-gradient(135deg, rgba(40,40,40,0.9) 0%, rgba(20,20,20,1) 100%);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 30px;
    position: relative;
    overflow: visible; /* Wichtig für den Overlap! */
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    margin-top: 50px; /* Platz für den Overlap nach oben */
    margin-bottom: 30px;
}

.status-subtitle-inline {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: var(--team-color, #888);
    background: rgba(var(--team-color-rgb, 136, 136, 136), 0.1); /* Optional: ganz dezent hinterlegt */
    padding: 2px 8px;
    border-radius: 4px;
}

/* Falls der Name zu groß wird, sorgt flex-wrap dafür, dass das Team sauber drunter rutscht */
.name-team-row {
    flex-wrap: wrap;
    margin-bottom: 5px;
}

/* Die Startnummer als riesiges Wasserzeichen */
.hero-number-bg {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12rem;
    font-weight: 900;
    color: rgba(255,255,255,0.03);
    font-style: italic;
    pointer-events: none;
}

/* Avatar-Container mit Overlap */
.hero-avatar-wrapper {
    position: relative;
    margin-top: -80px; /* Schiebt das Bild über den Rand */
}

.hero-avatar-wrapper img.main-avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 5px solid #222;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    object-fit: cover;
    background: #111;
}

/* Bio Badges */
/* Bio-Strip: Items als schicke Badges */
.hero-info-zone .bio-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

/* Flagge als runder Badge am Avatar */
.country-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 3px solid #222;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.country-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-title {
    margin-bottom: 5px;
}

/* Stats Widgets */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-box {
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-label { display: block; font-size: 0.7rem; text-transform: uppercase; opacity: 0.5; margin-bottom: 5px; }
.stat-value { font-size: 2rem; font-weight: 800; font-family: 'Orbitron'; color: var(--team-color); }

.track-badge {
    background: rgba(255, 255, 255, 0.05); /* Sehr dezentes Grau-Transparent */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #eee;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: default;
}

.track-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--team-color, #fff); /* Nutzt die Teamfarbe beim Hover */
    transform: translateY(-2px);
}

/* Timeline */
.timeline-content {
    flex: 1;
    background: rgba(255,255,255,0.02);
    padding: 15px 25px;
    border-radius: 10px;
    border-left: 3px solid rgba(255,255,255,0.1);
}

.tm-header { display: flex; justify-content: space-between; font-weight: bold; font-size: 1.1rem; margin-bottom: 5px; }
.final-rank { color: gold; }

.champion-rank {
    color: #FFD700 !important; /* Gold */
    font-weight: 800;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* Optional: Ein kleiner Glanz-Effekt für die P1-Zeile */
.timeline-item.winner {
    border-left: 3px solid #FFD700;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.05) 0%, transparent 100%);
}

.history-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.timeline-item {
    display: flex; /* Richtet year-tag und history-row nebeneinander aus */
    align-items: center;
    gap: 20px; /* Abstand zwischen Jahreszahl und der Datenbox */
    margin-bottom: 5px;
    width: 100%; /* Sicherstellen, dass das Item die volle Breite nutzt */
}

.year-tag {
    min-width: 100px; /* Feste Breite für die Jahreszahlen, damit alles untereinander steht */
    font-weight: 800;
    color: #888;
    font-size: 0.9rem;
    text-align: right;
}

.history-row {
    flex: 1; /* DAS IST WICHTIG: Die Box nimmt sich den kompletten restlichen Platz */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: grid;
    grid-template-columns: 70px 1.5fr 2fr 100px;
    align-items: center;
    padding: 10px 20px 10px 0px;
    transition: all 0.2s ease;
}

.history-row:hover {
    background: rgba(255, 255, 255, 0.07);
}

.history-row.is-winner {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.05) 0%, transparent 100%);
    border-color: rgba(255, 215, 0, 0.3);
}

/* Spalte 1: Logo */
.history-col-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 5px; /* Platz für den farbigen Border-Strich */
}

.h-team-logo {
    height: 32px;
    width: 32px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.3); /* Helle Base für dunkle Logos */
    padding: 5px;
    border-radius: 6px; /* Passt zum Badge-Stil */
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease;
}

/* Spalte 2: Info */
.h-league-title {
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
}
.h-season-sub {
    font-size: 0.8rem;
    color: #888;
}
.h-year { margin-right: 10px; }

.history-col-stats {
    display: flex;
    justify-content: space-evenly; /* Verteilt die Badges mit gleichem Abstand */
    align-items: center;
    padding: 0 40px; /* Gibt der Badge-Zone links und rechts etwas Puffer */
}

.h-stat-badge {
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 15px;
    border-radius: 20px; /* Pillen-Form sieht bei Badges oft moderner aus */
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 80px;
    justify-content: center;
}

/* Die Punkte-Box darf ruhig etwas massiver wirken */
.h-points-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
    min-width: 90px;
    justify-content: center;
}

.h-points-box .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.h-points-box .val {
    font-weight: 800;
    color: #fff;
    font-size: 0.95rem;
}

/* 3. Bonus: Vertikale Ausrichtung der gesamten Row */
.history-row {
    align-items: center; /* Stellt sicher, dass alles in der Row auf einer Linie ist */
}

.h-stat-badge i { font-size: 0.85rem; }
.icon-win { color: #2ecc71; }
.icon-fl { color: #ae5bb7; }
.icon-dnf { color: #e74c3c; }

/* Spalte 4: Rank */
.history-col-rank {
    text-align: right;
}
.final-rank-display {
    font-size: 1.3rem;
    font-weight: 800;
    color: #aaa;
}
.gold-text {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Stats-Boxen: Icons symmetrisch */
.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden; /* Für den Glassmorphism */
}

.stat-box i.stats-icon {
    font-size: 1.3rem; /* Etwas kleiner, dezenter */
    color: #888;
    margin-bottom: 5px;
    position: relative;
}

.stat-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    color: #999;
    letter-spacing: 1px;
}

/* Container-Karten */
.analysis-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
}

.analysis-card h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 20px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Letzte Ergebnisse (Kreise) */
.recent-results-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.res-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    background: #222;
    border: 2px solid rgba(255,255,255,0.1);
    color: #eee;
}

/* Farben für die Formkurve */
.res-circle.p1 { background: #FFD700; color: #000; border-color: #fff; box-shadow: 0 0 10px rgba(255,215,0,0.2); }
.res-circle.p2 { background: #C0C0C0; color: #000; }
.res-circle.p3 { background: #CD7F32; color: #000; }
.res-circle.dnf { background: #e74c3c; color: #fff; border-color: #ff7675; }

.analysis-hint {
    font-size: 0.7rem;
    color: #555;
    margin-top: 15px;
}

/* Top Strecken Liste */
.track-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.track-entry:last-child { border: none; }

.track-name { font-weight: 600; color: #ddd; font-size: 0.9rem; }

.t-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.t-badge.win { background: rgba(46, 204, 113, 0.15); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.3); }
.t-badge.pole { background: rgba(52, 152, 219, 0.15); color: #3498db; border: 1px solid rgba(52, 152, 219, 0.3); margin-left: 5px; }