/* ==============================================================
   BASE CSS - COMMON STRUCTURE
   This file contains the layout and core styles shared across all themes.
   Themes only override variables and specific visual properties.
   ============================================================== */

* {
    box-sizing: border-box;
}

:root {
    /* DEFAULT VARIABLES (Fallback if not overridden) */
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --primary-color: #00c3ff;
    --accent-color: #ff9500;
    --border-color: #333333;
    --success-color: #00e676;
    --danger-color: #ff1744;
    --font-main: 'Montserrat', 'Segoe UI', sans-serif;
    --font-heading: 'Russo One', 'Montserrat', sans-serif;
    --shadow-small: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 16px rgba(0, 0, 0, 0.3);
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    padding-bottom: 40px;
    scroll-behavior: smooth;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 800px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
    max-width: 1800px;
    margin: 0 auto;
}

/* NAVIGATION */
.main-navbar {
    background-color: rgba(30, 30, 30, 0.85);
    /* Slightly transparent for glass effect */
    backdrop-filter: blur(12px);
    /* Glassmorphism */
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
    margin-bottom: 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 20px;
    flex-wrap: nowrap;
    /* Prevent ugly wrapping before breakpoint */
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.5em;
    text-decoration: none;
    background: linear-gradient(135deg, #fff 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
    /* Allow items to wrap on desktop if needed */
    justify-content: center;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    flex-shrink: 0;
    /* Keep controls visible */
}

/* Compact icon buttons for controls */
.nav-controls .nav-icon-btn,
.lang-dropdown .lang-btn {
    padding: 0;
    width: 34px;
    height: 34px;
    min-width: 34px;
    /* Fix for flex shrink */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.9em;
    background: transparent;
    /* Ensure button background matches */
    line-height: 1;
    border: 1px solid transparent;
    /* Maintain border box sizing consistency */
}

.nav-controls .nav-icon-btn:hover,
.lang-dropdown .lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-controls .nav-icon-btn i,
.lang-dropdown .lang-btn span {
    font-size: 1.2em;
    /* Ensure icon is well sized */
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 50px;
    /* Pill shape */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nav-link.active {
    color: white;
    background-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 195, 255, 0.3);
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Specific icons in nav */
.nav-link i {
    font-size: 1.1em;
}

/* RESPONSIVE PODIUMS */
@media (max-width: 600px) {
    .podium-display {
        height: auto !important;
        align-items: flex-end !important;
        transform: scale(0.9);
        /* Slight scale down */
        transform-origin: bottom center;
        margin-top: 10px !important;
    }

    .podium-step {
        width: 32% !important;
        /* Ensure they fit side by side */
        margin: 0 2px !important;
    }

    .podium-step img {
        width: 50px !important;
        height: 50px !important;
    }

    .podium-step.step-1 img {
        width: 70px !important;
        height: 70px !important;
    }

    .podium-step a {
        font-size: 0.8em !important;
    }

    .podium-step div[style*="font-size: 1.1em"],
    .podium-step div[style*="font-size: 0.9em"] {
        font-size: 0.8em !important;
    }
}

/* ENHANCED PODIUM CARDS */
.podium-card {
    position: relative;
    overflow: hidden;
    border-top: 4px solid transparent;
    /* Colored via inline style */
    transition: transform 0.3s, box-shadow 0.3s;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
    /* Fallback border */
    flex: 1 1 350px;
    min-width: 350px;
    display: flex;
    flex-direction: column;
}

.podium-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.podium-header-banner {
    padding: 15px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.podium-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 150px;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

.podium-content-wrapper {
    position: relative;
    z-index: 1;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* RESPONSIVE NAVIGATION */
.nav-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.4em;
    cursor: pointer;
    padding: 5px 10px;
    margin-right: 15px;
    /* Espace après le burger */
    transition: transform 0.2s;
}

.nav-toggle-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

@media (max-width: 1150px) {
    .nav-toggle-btn {
        display: block;
        order: 2;
        /* Burger après le logo */
        margin-right: auto;
        /* Pousse les contrôles à droite */
        margin-left: 10px;
        /* Petit espace après le logo */
    }

    .nav-container {
        /* Flex pour tout aligner */
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 5px 8px;
        /* Réduction espacement global */
    }

    /* Brand takes remaining space or just sits next to burger */
    .nav-brand {
        order: 1;
        /* Logo en premier */
        margin-right: 0;
    }

    /* Controls stay on the right */
    .nav-controls {
        display: flex;
        align-items: center;
        order: 3;
    }

    /* Menu becomes full width dropdown */
    .nav-menu {
        display: none;
        /* Hidden by default */
        width: 100%;
        flex-direction: row;
        /* Horizontal */
        flex-wrap: nowrap;
        /* Pas de wrap */
        overflow-x: auto;
        /* Scroll horizontal */
        -webkit-overflow-scrolling: touch;
        order: 4;
        /* Last, below everything */
        margin-top: 10px;
        padding: 10px 5px;
        background: rgba(30, 30, 30, 0.95);
        /* Better opacity for readability */
        backdrop-filter: blur(10px);
        border-radius: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        animation: fadeIn 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        scrollbar-width: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        width: auto;
        white-space: nowrap;
        justify-content: flex-start;
        padding: 8px 15px;
        border-radius: 50px;
        margin-bottom: 0;
        margin-right: 5px;
        background: transparent;
        font-size: 0.95em;
        flex-shrink: 0;
    }

    .nav-link:hover,
    .nav-link.active {
        background-color: var(--primary-color);
        color: white;
    }

    /* Adjust dropdowns for mobile */
    .lang-dropdown .lang-btn {
        padding: 5px;
    }

    .main-navbar {
        padding: 5px 0;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* TROPHIES / BADGES */
.trophy-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    width: 100%;
}

.trophy-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    transition: all 0.2s;
    cursor: pointer;
}

.trophy-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.trophy-icon {
    font-size: 1.2em;
}

.trophy-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: left;
}

.trophy-title {
    font-weight: bold;
    font-size: 0.9em;
    color: #fff;
}

.trophy-val {
    font-size: 0.75em;
    color: var(--text-muted);
}

.mini-badge {
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 3px;
    opacity: 0.9;
}

.mini-badge:hover {
    transform: scale(1.3);
    opacity: 1;
    text-shadow: 0 0 10px currentColor;
    /* Glow effect using icon color */
    z-index: 10;
}

/* RANK & RACES COUNT STYLES */
.pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    min-width: 30px;
}

.pos-badge.pos-1 {
    border-color: #FFD700;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    border-width: 1px;
}

.pos-badge.pos-1 i {
    color: #FFD700;
}

.pos-badge.pos-2 {
    border-color: #C0C0C0;
    color: #C0C0C0;
    background: rgba(192, 192, 192, 0.15);
    box-shadow: 0 0 5px rgba(192, 192, 192, 0.2);
}

.pos-badge.pos-2 i {
    color: #C0C0C0;
}

.pos-badge.pos-3 {
    border-color: #CD7F32;
    color: #CD7F32;
    background: rgba(205, 127, 50, 0.15);
    box-shadow: 0 0 5px rgba(205, 127, 50, 0.2);
}

.pos-badge.pos-3 i {
    color: #CD7F32;
}

/* Ensure hover on clickable badge doesn't break style */
a.pos-badge:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
    transition: all 0.2s;
    text-decoration: none;
}

.rank-circle {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.rank-circle.rank-1 {
    border-color: #FFD700;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    font-size: 1.1em;
    border-width: 2px;
}

.rank-circle.rank-2 {
    border-color: #C0C0C0;
    color: #C0C0C0;
    background: rgba(192, 192, 192, 0.1);
    box-shadow: 0 0 5px rgba(192, 192, 192, 0.2);
}

.rank-circle.rank-3 {
    border-color: #CD7F32;
    color: #CD7F32;
    background: rgba(205, 127, 50, 0.1);
    box-shadow: 0 0 5px rgba(205, 127, 50, 0.2);
}

/* ROW HIGHLIGHTS FOR TOP 3 */
.row-rank-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.08) 0%, transparent 100%);
}

.row-rank-1 td:first-child {
    border-left: 3px solid #FFD700;
}

.row-rank-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.05) 0%, transparent 100%);
}

.row-rank-2 td:first-child {
    border-left: 3px solid #C0C0C0;
}

.row-rank-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.05) 0%, transparent 100%);
}

.row-rank-3 td:first-child {
    border-left: 3px solid #CD7F32;
}

.races-count-badge {
    display: inline-block;
    font-weight: 600;
    color: var(--text-color);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    min-width: 30px;
    text-align: center;
}

/* TYPOGRAPHY */
h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 40px;
    font-family: var(--font-heading);
    font-size: 3em;
    text-transform: uppercase;
    letter-spacing: 2px;
}

h2 {
    font-family: var(--font-heading);
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    display: inline-block;
    margin-top: 40px;
}

/* CARDS */
.race-card,
.history-card,
.chart-container,
.performer-card,
.stat-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    margin-bottom: 30px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.chart-container {
    position: relative;
    height: 400px;
    /* Default height */
    padding: 15px;
}

@media (max-width: 768px) {
    .chart-container {
        height: 300px;
        /* Smaller height on mobile */
    }
}

.race-card:hover,
.performer-card:hover,
.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

/* GRIDS */
.top-performers-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

/* TABLES */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Force min width to trigger scroll */
}

th,
td {
    padding: 12px;
    /* Slightly reduced padding */
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 0.85em;
    white-space: nowrap;
    /* Prevent headers from wrapping too much */
}

/* STYLES FOR UNRANKED PLAYERS */
tr.is-unranked {
    opacity: 0.6;
}

tr.is-unranked:hover {
    opacity: 1;
}

.unranked-separator td {
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
}

/* ==============================================================
   UTILITIES
   ============================================================== */

/* COLORS */
.text-primary {
    color: var(--primary-color) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-white {
    color: white !important;
}

.bg-danger-soft {
    background-color: rgba(255, 23, 68, 0.1);
}

.bg-success-soft {
    background-color: rgba(0, 230, 118, 0.1);
}

.bg-accent-soft {
    background-color: rgba(255, 149, 0, 0.1);
}

/* LAYOUT & SPACING */
.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-5 {
    gap: 5px;
}

.gap-10 {
    gap: 10px;
}

.gap-15 {
    gap: 15px;
}

.gap-20 {
    gap: 20px;
}

.m-0 {
    margin: 0;
}

.mt-0 {
    margin-top: 0;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-10 {
    padding: 10px;
}

.p-15 {
    padding: 15px;
}

.p-20 {
    padding: 20px;
}

.p-30 {
    padding: 30px;
}

.w-100 {
    width: 100%;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.cursor-pointer {
    cursor: pointer;
}

/* PAGE HEADER (Standardized) */
.page-header {
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.profile-header {
    /* Legacy alias, merged into similar style if needed, but keeping separate for specific gradient backgrounds if defined elsewhere */
    margin-bottom: 30px;
}

.page-title,
.profile-name {
    margin: 0;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 2em;
    color: var(--text-color);
    letter-spacing: 1px;
}

.page-title i,
.profile-name i {
    color: var(--primary-color);
    margin-right: 10px;
}

/* FLOATING NAVIGATION (from competitor.php) */
.nav-floating {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 140px;
    height: 160px;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-floating:hover {
    background: var(--primary-color);
    color: #000;
    width: 90px;
    box-shadow: 0 0 20px var(--primary-color);
    border-color: transparent;
}

.nav-prev {
    left: 0;
    border-radius: 0 12px 12px 0;
    border-left: none;
    padding-left: 5px;
}

.nav-next {
    right: 0;
    border-radius: 12px 0 0 12px;
    border-right: none;
    padding-right: 5px;
}

.nav-info {
    font-size: 0.4em;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
    transform: none;
    margin-top: 10px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    text-align: center;
    width: 100%;
}

.nav-details {
    margin-top: 8px;
    font-size: 0.9em;
    font-weight: normal;
    white-space: normal;
    line-height: 1.3;
    padding: 0 5px;
}

/* Mobile Responsive for Floating Nav */
@media (max-width: 768px) {
    .nav-floating {
        width: 40px;
        height: 80px;
        font-size: 1.5em;
        top: auto;
        bottom: 20px;
        transform: none;
        background: rgba(0, 0, 0, 0.8);
    }

    .nav-prev {
        left: 0;
        width: 100px;
        height: 100px;
    }

    .nav-next {
        right: 0;
        width: 100px;
        height: 100px;
    }

    .nav-info {
        font-size: 0.3em;
    }

    .nav-details {
        display: none;
    }
}

/* UTILS */
.error-message {
    background-color: rgba(255, 23, 68, 0.1);
    color: var(--danger-color);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--danger-color);
    margin-bottom: 20px;
    text-align: center;
}

.notice {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95em;
}

.notice-warning {
    background-color: rgba(255, 149, 0, 0.1);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.notice-danger {
    background-color: rgba(255, 23, 68, 0.1);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.notice i {
    margin-right: 10px;
    font-size: 1.2em;
}

/* TIMELINE (Horizontal) */
.timeline-section {
    position: relative;
    padding: 20px 0;
    margin: 40px 0;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.timeline-section::-webkit-scrollbar {
    display: none;
}

.timeline-container {
    display: flex;
    align-items: flex-start;
    padding: 0 40px;
    min-width: max-content;
    position: relative;
}

.timeline-line {
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--border-color);
    /* Default */
    z-index: 1;
}

.timeline-item {
    position: relative;
    width: 220px;
    margin-right: 40px;
    z-index: 2;
    transition: transform 0.3s;
}

.timeline-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 40px auto 20px;
    position: relative;
    z-index: 2;
    background: var(--bg-color);
    border: 3px solid var(--primary-color);
}

.timeline-date {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.timeline-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    display: block;
    color: inherit;
    text-decoration: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* LANGUAGE & THEME DROPDOWN */
.lang-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 15px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    font-family: var(--font-main);
    font-size: 1rem;
}

.lang-btn:hover {
    color: var(--primary-color);
}

.lang-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--card-bg);
    min-width: 160px;
    box-shadow: var(--shadow-medium);
    z-index: 2000;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}


.lang-item {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s;
}

.lang-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.lang-item.active {
    color: var(--primary-color);
    font-weight: bold;
    background-color: rgba(0, 195, 255, 0.1);
}

/* RACE LIST STYLES (from races.php) */
.race-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.race-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(145deg, var(--card-bg), #252525);
    border: 1px solid var(--border-color);
    border-left: 4px solid transparent;
    /* Prépare la bordure gauche */
    border-radius: 12px;
    padding: 25px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow-small);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
    /* Pour l'animation */
}

/* Stagger animation for items */
.race-list-item:nth-child(1) {
    animation-delay: 0.1s;
}

.race-list-item:nth-child(2) {
    animation-delay: 0.2s;
}

.race-list-item:nth-child(3) {
    animation-delay: 0.3s;
}

.race-list-item:nth-child(4) {
    animation-delay: 0.4s;
}

.race-list-item:nth-child(5) {
    animation-delay: 0.5s;
}

.race-list-item:nth-child(n+6) {
    animation-delay: 0.6s;
}

.race-list-item:hover {
    transform: translateY(-5px);
    border-left-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Effet de lueur au survol */
.race-list-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
    transform: skewX(-20deg) translateX(-150%);
    transition: transform 0.5s;
    pointer-events: none;
}

.race-list-item:hover::after {
    transform: skewX(-20deg) translateX(150%);
}

.race-item-main {
    flex: 1;
    z-index: 1;
}

.race-item-title {
    font-family: var(--font-heading);
    font-size: 1.4em;
    color: white;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.race-list-item:hover .race-item-title {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 195, 255, 0.4);
}

.race-item-meta {
    font-size: 0.95em;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
    align-items: center;
}

.race-item-meta i {
    color: var(--primary-color);
    opacity: 0.8;
}

.race-item-stats {
    background: rgba(255, 149, 0, 0.1);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    color: var(--accent-color);
    border: 1px solid rgba(255, 149, 0, 0.3);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1;
    transition: all 0.3s;
}

.race-list-item:hover .race-item-stats {
    background: rgba(255, 149, 0, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(255, 149, 0, 0.2);
    transform: scale(1.05);
}

.race-item-stats i {
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .race-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .race-item-stats {
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }

    .race-item-main {
        width: 100%;
    }
}

/* PODIUM STYLES (from index.php) */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    margin: 40px 0 60px 0;
    min-height: 250px;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    width: 200px;
    transition: transform 0.3s;
    position: relative;
    box-shadow: var(--shadow-medium);
}

.podium-item:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}

/* 1st Place */
.podium-item.rank-1 {
    height: 280px;
    order: 2;
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.1), var(--card-bg));
    border-color: #ffd700;
    z-index: 2;
}

.podium-item.rank-1 .podium-rank-badge {
    color: #ffd700;
    font-size: 2.5em;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* 2nd Place */
.podium-item.rank-2 {
    height: 240px;
    order: 1;
    border-color: #c0c0c0;
}

.podium-item.rank-2 .podium-rank-badge {
    color: #c0c0c0;
    font-size: 2em;
}

/* 3rd Place */
.podium-item.rank-3 {
    height: 210px;
    order: 3;
    border-color: #cd7f32;
}

.podium-item.rank-3 .podium-rank-badge {
    color: #cd7f32;
    font-size: 2em;
}

.podium-rank-badge {
    margin-bottom: 15px;
    font-family: var(--font-heading);
}

.podium-name {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 5px;
    color: var(--text-color);
}

.podium-nick {
    color: var(--primary-color);
    font-size: 0.9em;
    margin-bottom: 15px;
}

.podium-elo {
    font-family: var(--font-heading);
    font-size: 1.8em;
    color: var(--text-color);
}

.podium-label {
    font-size: 0.8em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ==============================================================
   ADMIN DASHBOARD (Harmonized)
   Shared across all pages containing admin/config tools.
   ============================================================== */
.admin-tabs-container {
    background: rgba(45, 45, 45, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 25px;
}

.admin-tab-header {
    opacity: 0.7;
    transition: all 0.2s;
    user-select: none;
    border-bottom: 3px solid transparent;
}

.admin-tab-header:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

.admin-tab-header.active {
    opacity: 1;
}

/* Tab Colors */
.admin-tab-header.text-primary.active {
    border-bottom-color: var(--primary-color);
}

.admin-tab-header.text-danger.active {
    border-bottom-color: var(--danger-color);
}

.admin-tab-header.text-success.active {
    border-bottom-color: var(--success-color);
}

.admin-tab-header.text-accent.active {
    border-bottom-color: var(--accent-color);
}

.admin-tab-header.active:not(.text-primary):not(.text-danger):not(.text-success):not(.text-accent) {
    border-bottom-color: #fff;
}

.admin-tab-content {
    transition: all 0.3s ease;
}

.admin-info-badge {
    background: rgba(255, 149, 0, 0.15);
    color: var(--accent-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    border: 1px solid rgba(255, 149, 0, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* LEGACY ALIASES (Keep temporarily if needed, but discouraged) */
.admin-panel {
    padding: 15px;
}