/* Le Petit Fetard - Main Styles */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --gold: #ffc107;
    --gold-light: #ffd54f;
    --gold-dark: #ff8f00;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --card-bg: rgba(22, 33, 62, 0.85);
    --card-border: rgba(255, 193, 7, 0.15);
    --border-color: rgba(255, 255, 255, 0.1);
    --danger: #ff5252;
    --success: #4caf50;
    --font-family: 'Poppins', sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-light); }

img { max-width: 100%; height: auto; }

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px;
    padding-top: 80px; /* navbar height */
    min-height: calc(100vh - 100px);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-logo-img { width: 28px; height: 28px; }

.nav-logo-content { display: flex; flex-direction: column; line-height: 1.2; }

.nav-tagline {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-separator {
    display: block;
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 8px;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--text-primary); }
.nav-link-active {
    color: var(--gold) !important;
    position: relative;
}
.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
    border-radius: 1px;
}
.nav-link-muted { color: var(--text-muted); font-size: 0.85rem; }

.nav-user, .nav-auth { display: flex; align-items: center; gap: 10px; }

.nav-user-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.nav-user-link {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

.nav-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    background: rgba(255, 193, 7, 0.14);
    color: var(--gold);
    border: 1px solid rgba(255, 193, 7, 0.28);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}
.nav-badge.status-rank-1 { color: #90caf9; border-color: rgba(144, 202, 249, 0.35); background: rgba(144, 202, 249, 0.16); }
.nav-badge.status-rank-2 { color: #81c784; border-color: rgba(129, 199, 132, 0.35); background: rgba(129, 199, 132, 0.16); }
.nav-badge.status-rank-3 { color: #fff176; border-color: rgba(255, 241, 118, 0.35); background: rgba(255, 241, 118, 0.16); }
.nav-badge.status-rank-4 { color: #ffb74d; border-color: rgba(255, 183, 77, 0.35); background: rgba(255, 183, 77, 0.16); }
.nav-badge.status-rank-5 { color: #ff8a65; border-color: rgba(255, 138, 101, 0.35); background: rgba(255, 138, 101, 0.16); }
.nav-badge.status-rank-6 { color: #e57373; border-color: rgba(229, 115, 115, 0.35); background: rgba(229, 115, 115, 0.16); }
.nav-badge.status-rank-7 { color: #ba68c8; border-color: rgba(186, 104, 200, 0.35); background: rgba(186, 104, 200, 0.16); }
.nav-badge.status-rank-8 { color: #7986cb; border-color: rgba(121, 134, 203, 0.35); background: rgba(121, 134, 203, 0.16); }
.nav-badge.status-rank-9 { color: #4dd0e1; border-color: rgba(77, 208, 225, 0.35); background: rgba(77, 208, 225, 0.16); }
.nav-badge.status-rank-10 { color: #ffd700; border-color: rgba(255, 215, 0, 0.40); background: rgba(255, 215, 0, 0.16); }
.nav-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.nav-user-mobile {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .nav-tagline {
        display: block;
        max-width: 140px;
        font-size: 0.55rem;
    }
    .nav-logo-text { font-size: 0.95rem; }
    .nav-links { display: none; }
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(26, 26, 46, 0.98);
        padding: 16px;
        gap: 12px;
        border-bottom: 1px solid var(--card-border);
    }
    .nav-links.active .nav-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    .nav-links.active .nav-separator {
        width: 100%;
        height: 1px;
        margin: 4px 0;
    }
    .nav-toggle { display: block; }
    .nav-user-desktop { display: none; }
    .nav-user-mobile { display: flex; }
    .nav-user-mobile .nav-user-link { font-size: 0.75rem; }
    .nav-badge-mobile { font-size: 0.55rem; padding: 1px 6px; line-height: 1.3; }
    .nav-user, .nav-auth { flex-direction: column; width: 100%; }
}

/* Page Titles */
.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.footer-text { color: var(--text-muted); font-size: 0.85rem; }
.footer-brand { color: var(--gold); font-weight: 600; }
.footer-sub { color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; }

/* Messages */
.messages-container {
    max-width: 800px;
    margin: 70px auto 0;
    padding: 0 16px;
}

.message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.message-success { background: rgba(76, 175, 80, 0.15); border: 1px solid rgba(76, 175, 80, 0.3); color: #b5f6c8; }
.message-error { background: rgba(255, 82, 82, 0.15); border: 1px solid rgba(255, 82, 82, 0.3); color: #ffc0c0; }
.message-warning { background: rgba(255, 193, 7, 0.15); border: 1px solid rgba(255, 193, 7, 0.3); color: #ffd86b; }
.message-info { background: rgba(33, 150, 243, 0.15); border: 1px solid rgba(33, 150, 243, 0.3); color: #90caf9; }

/* Error Pages */
.error-page {
    text-align: center;
    padding: 60px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.error-icon { font-size: 4rem; margin-bottom: 10px; }
.error-code { font-size: 5rem; font-weight: 700; color: var(--gold); margin: 0; }
.error-message { font-size: 1.3rem; margin: 10px 0; }
.error-sub { color: var(--text-muted); margin-bottom: 25px; }

/* Loading */
.loading-sentinel { padding: 30px; text-align: center; }
.loading-spinner { color: var(--text-muted); font-size: 0.9rem; }
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--card-border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 3rem; margin-bottom: 10px; }
.empty-text { color: var(--text-muted); margin-bottom: 16px; }
