/* FF - Système de chronométrage 24h Trail */

:root {
    --ff-primary: #2d6a4f;
    --ff-primary-light: #40916c;
    --ff-primary-dark: #1b4332;
    --ff-accent: #d4a373;
    --ff-success: #52b788;
    --ff-danger: #e63946;
    --ff-warning: #f4a261;
    --ff-bg: #f8f9fa;
    --ff-card-bg: #ffffff;
}

body {
    background-color: var(--ff-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Navbar */
.ff-navbar {
    background: linear-gradient(135deg, var(--ff-primary-dark), var(--ff-primary));
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ff-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

/* Cards */
.ff-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}

.ff-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Stat cards */
.stat-card {
    border: none;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    background: var(--ff-card-bg);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ff-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Bib number badge */
.bib-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 32px;
    padding: 0 8px;
    background: var(--ff-primary);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}

.bib-badge.relay {
    background: var(--ff-accent);
    color: var(--ff-primary-dark);
}

/* Race status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.draft { background: #e9ecef; color: #495057; }
.status-badge.registration_open { background: #d4edda; color: #155724; }
.status-badge.started { background: #cce5ff; color: #004085; }
.status-badge.paused { background: #fff3cd; color: #856404; }
.status-badge.finished { background: #f8d7da; color: #721c24; }

.status-badge .pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* Ranking table */
.ranking-table {
    font-variant-numeric: tabular-nums;
}

.ranking-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom-width: 2px;
}

.ranking-table td {
    vertical-align: middle;
}

.ranking-table .rank-col {
    font-size: 1.1rem;
    font-weight: 700;
    width: 50px;
    text-align: center;
}

.ranking-table .rank-1 { color: #ffd700; }
.ranking-table .rank-2 { color: #c0c0c0; }
.ranking-table .rank-3 { color: #cd7f32; }

.ranking-table .laps-col {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ff-primary);
}

.ranking-table tr.highlight {
    animation: rowHighlight 2s ease-out;
}

@keyframes rowHighlight {
    0% { background-color: rgba(45, 106, 79, 0.15); }
    100% { background-color: transparent; }
}

/* Scan result feedback */
.scan-result {
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.scan-result-success {
    background: linear-gradient(135deg, #d4edda, #b7e4c7);
    border: 2px solid var(--ff-success);
    color: var(--ff-primary-dark);
}

.scan-result-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 2px solid var(--ff-danger);
    color: #721c24;
}

.scan-result .scan-name {
    font-size: 1.8rem;
    font-weight: 700;
}

.scan-result .scan-lap {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

/* Race clock */
.race-clock {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ff-primary);
    letter-spacing: 1px;
}

/* Admin sidebar tabs */
.ff-tab-nav .nav-link {
    color: #495057;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 4px;
    font-weight: 500;
    transition: all 0.2s;
}

.ff-tab-nav .nav-link:hover {
    background: rgba(45, 106, 79, 0.08);
    color: var(--ff-primary);
}

.ff-tab-nav .nav-link.active {
    background: var(--ff-primary);
    color: white;
}

/* Toast container */
.ff-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

/* Login form */
.ff-login-card {
    max-width: 400px;
    margin: 100px auto;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

/* Print styles for QR badges */
@media print {
    body { background: white !important; }
    .no-print { display: none !important; }

    .qr-badge {
        page-break-inside: avoid;
        border: 1px dashed #ccc;
        padding: 15px;
        margin: 10px;
        text-align: center;
        width: 45%;
        display: inline-block;
    }

    .qr-badge img { max-width: 150px; }
    .qr-badge .badge-name { font-size: 1.2rem; font-weight: 700; }
    .qr-badge .badge-bib { font-size: 1.5rem; font-weight: 800; }
    .qr-badge .badge-team { font-size: 0.9rem; color: #666; }
}

/* Burger Menu */
.burger-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    right: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1050;
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.burger-menu-toggle:hover {
    transform: scale(1.1);
}

.burger-menu-toggle.active .fa-bars {
    display: none;
}

.burger-menu-toggle.active .fa-times {
    display: inline;
}

.burger-menu-toggle .fa-times {
    display: none;
}

.burger-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1040;
}

.burger-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.burger-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: linear-gradient(180deg, var(--ff-primary-dark), var(--ff-primary));
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease;
    z-index: 1045;
    overflow-y: auto;
}

.burger-menu.active {
    right: 0;
}

.burger-menu-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.burger-menu-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.burger-menu-nav {
    padding: 1rem 0;
}

.burger-menu-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.burger-menu-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--ff-accent);
    padding-left: 1.75rem;
}

.burger-menu-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: white;
}

.burger-menu-nav a i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.burger-menu-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card .stat-value { font-size: 1.5rem; }
    .race-clock { font-size: 1.8rem; }
    .ranking-table { font-size: 0.85rem; }
}

/* Burger menu toujours visible (pour debug) - À commenter plus tard si nécessaire */
.burger-menu-toggle {
    display: block !important;
}
