/**
 * Rankoll - Styles principaux
 * Theme: noir et orange
 */

:root {
    /* Couleurs principales - Orange clair */
    --color-primary: #FF8C5A;      /* Orange clair - couleur principale */
    --color-primary-dark: #FF6B35;
    --color-primary-light: #FFAB85;

    --color-secondary: #FFAB85;    /* Orange très clair */
    --color-secondary-dark: #FF8C5A;
    --color-secondary-light: #FFC9A8;

    --color-accent: #2ECC71;       /* Vert - pour les validations */
    --color-accent-dark: #27AE60;

    /* Couleurs neutres */
    --color-dark: #1A1A2E;
    --color-gray-dark: #2D2D44;
    --color-gray: #4A4A6A;
    --color-gray-light: #8888AA;
    --color-light: #F5F5F7;
    --color-white: #FFFFFF;

    /* Header */
    --color-header: #1A1A2E;       /* Gris-bleu sombre pour le header */
    --color-border: rgba(255, 255, 255, 0.1);

    /* Couleurs d'état */
    --color-error: #E74C3C;
    --color-success: #2ECC71;
    --color-warning: #F39C12;

    /* Typographie */
    --font-primary: 'Poppins', sans-serif;

    /* Espacements */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* Bordures */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-full: 50%;

    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Reset et base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-gray-dark) 100%);
    color: var(--color-light);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

#root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Utilitaires */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-gray-light); }

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--border-radius-full);
}

/* Inputs */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--color-light);
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    background: var(--color-gray-dark);
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    color: var(--color-light);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.3);
}

.form-input::placeholder {
    color: var(--color-gray-light);
}

/* Cards */
.card {
    background: var(--color-gray-dark);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

/* =====================
   SPLASH SCREEN
   ===================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-gray-dark) 100%);
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

.splash-logo {
    width: 120px;
    height: 120px;
    margin-bottom: var(--spacing-lg);
    animation: bounceIn 0.8s ease;
}

.splash-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: var(--spacing-sm);
    animation: slideUp 0.6s ease 0.2s both;
}

.splash-subtitle {
    font-size: 1.1rem;
    color: var(--color-gray-light);
    letter-spacing: 2px;
    animation: slideUp 0.6s ease 0.4s both;
}

/* =====================
   AUTH PAGES
   ===================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-xxl) var(--spacing-md);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-light);
    margin-bottom: var(--spacing-sm);
}

.auth-subtitle {
    color: var(--color-gray-light);
    font-size: 0.95rem;
}

.auth-form {
    flex: 1;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    color: var(--color-gray-light);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-gray);
}

.auth-switch {
    text-align: center;
    margin-top: var(--spacing-xl);
}

.auth-switch a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* =====================
   TOP LIST PAGE
   ===================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: var(--spacing-md);
    background: var(--color-header);
    border-bottom: 1px solid var(--color-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

/* Page liste des tops - fond dégradé */
.top-list-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-gray-dark) 100%);
}

.top-list {
    padding: var(--spacing-md);
    padding-top: calc(76px + var(--spacing-md)); /* Espace pour le header fixe */
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

/* Top Card - Design visuel avec image en fond */
.top-card {
    position: relative;
    height: 200px;
    border-radius: var(--border-radius-lg);
    margin-bottom: var(--spacing-md);
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 3px solid transparent;
}

.top-card:hover {
    transform: scale(1.02);
    border-color: var(--color-primary);
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.4);
}

.top-card.completed {
    border-color: var(--color-accent);
}

.top-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform var(--transition-slow);
}

.top-card:hover .top-card-bg {
    transform: scale(1.1);
}

.top-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(26, 26, 46, 0.95) 0%,
        rgba(26, 26, 46, 0.6) 50%,
        rgba(26, 26, 46, 0.2) 100%
    );
}

.top-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg);
    z-index: 2;
}

.top-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.top-card-desc {
    font-size: 0.9rem;
    color: var(--color-light);
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    opacity: 0.9;
}

.top-card-status {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
}

.top-card-badge {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    z-index: 2;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =====================
   RANKING VIEW
   ===================== */
.ranking-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ranking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--color-gray-dark);
}

.ranking-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.ranking-top-title {
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: center;
    background: linear-gradient(to bottom, var(--color-gray-dark), transparent);
}

.ranking-top-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

.ranking-top-title p {
    font-size: 0.9rem;
    color: var(--color-gray-light);
}

.ranking-list {
    flex: 1;
    padding: var(--spacing-md);
}

/* Ranking Item - Design visuel avec image en fond */
.ranking-item {
    position: relative;
    height: 120px;
    border-radius: var(--border-radius-lg);
    margin-bottom: var(--spacing-md);
    cursor: grab;
    overflow: hidden;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.ranking-item:active {
    cursor: grabbing;
}

.ranking-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.ranking-item.dragging {
    opacity: 0.5;
    border-color: var(--color-primary);
    transform: scale(0.98);
}

.ranking-item.drag-over {
    border-color: var(--color-accent);
}

.ranking-item-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    transition: transform var(--transition-normal);
}

.ranking-item:hover .ranking-item-bg {
    transform: scale(1.05);
}

.ranking-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(26, 26, 46, 0.95) 0%,
        rgba(26, 26, 46, 0.7) 40%,
        rgba(26, 26, 46, 0.3) 100%
    );
}

.ranking-item-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    z-index: 2;
}

.ranking-position {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
    background: rgba(0,0,0,0.5);
    border-radius: var(--border-radius-md);
    margin-right: var(--spacing-md);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.ranking-position.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: var(--color-dark);
}

.ranking-position.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: var(--color-dark);
}

.ranking-position.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: var(--color-white);
}

.ranking-item-info {
    flex: 1;
}

.ranking-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.ranking-item-year {
    font-size: 0.9rem;
    color: var(--color-gray-light);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.ranking-item-handle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius-sm);
    backdrop-filter: blur(4px);
    transition: all var(--transition-fast);
    cursor: grab;
}

.ranking-item-handle:hover {
    color: var(--color-primary);
    background: rgba(255, 140, 90, 0.3);
    transform: scale(1.1);
}

.ranking-item-draggable:active .ranking-item-handle {
    cursor: grabbing;
    color: var(--color-primary);
}

/* =====================
   COOKIE BANNER
   ===================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-gray-dark);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideUp 0.4s ease;
}

.cookie-content {
    max-width: 480px;
    margin: 0 auto;
}

.cookie-text {
    font-size: 0.85rem;
    color: var(--color-gray-light);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.cookie-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.cookie-actions .btn {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
}

/* =====================
   MOCK MODE BANNER
   ===================== */
.mock-banner {
    background: linear-gradient(90deg, var(--color-warning) 0%, var(--color-primary) 100%);
    color: var(--color-dark);
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
}

/* =====================
   ANIMATIONS
   ===================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Crown icon for first place */
.crown-icon {
    color: var(--color-primary);
}

/* =====================
   HEADER BRAND
   ===================== */
.header-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-username {
    color: var(--color-gray-light);
    font-size: 0.9rem;
    margin-right: var(--spacing-sm);
}

/* Header centré */
.page-header-centered {
    display: flex;
    justify-content: center;
    position: relative;
}

.page-header-centered .header-brand-centered {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.page-header-centered .header-actions {
    margin-left: auto;
}

/* =====================
   PAGINATION
   ===================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
}

.pagination-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-dark);
    border: 2px solid var(--color-gray);
    border-radius: var(--border-radius-md);
    color: var(--color-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-light);
    min-width: 60px;
    text-align: center;
}

/* =====================
   LOADING SPINNER
   ===================== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-gray);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================
   COMPACT VIEW - Ranking
   ===================== */
.ranking-list-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.ranking-item-compact {
    height: 80px;
}

.ranking-item-overlay-compact {
    background: linear-gradient(
        to top,
        rgba(26, 26, 46, 0.95) 0%,
        rgba(26, 26, 46, 0.6) 60%,
        rgba(26, 26, 46, 0.3) 100%
    );
}

.ranking-item-content-compact {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: var(--spacing-sm);
}

.ranking-position-compact {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    position: absolute;
    top: var(--spacing-xs);
    left: var(--spacing-xs);
    margin: 0;
}

.ranking-item-info-compact {
    width: 100%;
}

.ranking-item-title-compact {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Responsive */
@media (max-width: 480px) {
    .splash-title {
        font-size: 2.5rem;
    }

    .auth-title {
        font-size: 1.75rem;
    }

    .header-username {
        display: none;
    }

    .ranking-list-compact {
        gap: var(--spacing-xs);
    }

    .ranking-item-compact {
        height: 70px;
    }

    .ranking-item-title-compact {
        font-size: 0.75rem;
    }
}

/* =====================
   HEADER PROFILE BUTTON
   ===================== */
.header-profile-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 6px 12px;
    background: var(--color-gray-dark);
    border: 1px solid var(--color-gray);
    border-radius: var(--border-radius-md);
    color: var(--color-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-profile-btn:hover {
    border-color: var(--color-primary);
    background: rgba(255, 107, 53, 0.2);
}

.header-username-text {
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 400px) {
    .header-username-text {
        display: none;
    }
}

/* =====================
   PROFILE PAGE
   ===================== */
.profile-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.profile-content {
    flex: 1;
    padding: var(--spacing-md);
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

/* Profile Header Card */
.profile-header-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--color-gray-dark);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    margin-bottom: var(--spacing-lg);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--border-radius-full);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-avatar svg {
    color: var(--color-white);
}

.profile-user-info h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-light);
    margin-bottom: 4px;
}

.profile-user-info p {
    font-size: 0.9rem;
    color: var(--color-gray-light);
}

/* Profile Sections */
.profile-section {
    background: var(--color-gray-dark);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
}

.profile-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-gray-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-md);
}

/* Profile Info Rows */
.profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-info-row:last-child {
    border-bottom: none;
}

.profile-info-label {
    font-size: 0.9rem;
    color: var(--color-gray-light);
}

.profile-info-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-light);
}

/* Profile Stats Grid */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.profile-stat-card {
    background: rgba(0, 0, 0, 0.2);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    text-align: center;
}

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

.profile-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-gray-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Danger Button for logout */
.btn-danger {
    background: transparent;
    border: 2px solid var(--color-error);
    color: var(--color-error);
}

.btn-danger:hover {
    background: var(--color-error);
    color: var(--color-white);
}

/* =====================
   HEADER CENTERED LAYOUT
   ===================== */
.page-header-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 76px;
    padding: var(--spacing-md);
    background: var(--color-header);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

.page-header-centered .header-brand-centered {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.page-header-centered .header-actions {
    margin-left: auto;
}

.header-back-btn {
    position: absolute;
    left: 0;
    background: transparent;
    border: none;
    color: var(--color-light);
    padding: var(--spacing-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.header-back-btn:hover {
    color: var(--color-primary);
}

/* =====================
   RANKING TOGGLE & SHARE BUTTONS
   ===================== */
.ranking-toggle-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-md);
    background: var(--color-gray-dark);
    border: 1px solid var(--color-gray);
    color: var(--color-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ranking-toggle-btn:hover {
    border-color: var(--color-primary);
    background: rgba(255, 140, 90, 0.2);
    color: var(--color-primary);
}

.ranking-toggle-btn svg {
    width: 20px;
    height: 20px;
}

/* =====================
   DRAG & DROP VISIBILITY
   ===================== */
.ranking-item-draggable {
    cursor: grab;
    position: relative;
    transition: transform 0.15s ease, margin 0.15s ease, border-color 0.15s ease;
}

.ranking-item-draggable:active {
    cursor: grabbing;
}

/* Element en cours de deplacement */
.ranking-item-draggable.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

/* Curseur pendant le drag sur tout le body */
body.is-dragging {
    cursor: grabbing !important;
}

body.is-dragging * {
    cursor: grabbing !important;
}

/* Indicateurs de drop - ligne d'insertion */
.ranking-item-draggable::before,
.ranking-item-draggable::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
    z-index: 10;
}

.ranking-item-draggable::before {
    top: -6px;
}

.ranking-item-draggable::after {
    bottom: -6px;
}

/* Afficher la ligne au-dessus */
.ranking-item-draggable.drop-above::before {
    opacity: 1;
    box-shadow: 0 0 8px var(--color-primary);
}

/* Afficher la ligne en-dessous */
.ranking-item-draggable.drop-below::after {
    opacity: 1;
    box-shadow: 0 0 8px var(--color-primary);
}

/* Espace visuel pour l'insertion */
.ranking-item-draggable.drop-above {
    margin-top: 12px;
}

.ranking-item-draggable.drop-below {
    margin-bottom: 12px;
}

/* Animation de la ligne d'insertion */
@keyframes dropLinePulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.ranking-item-draggable.drop-above::before,
.ranking-item-draggable.drop-below::after {
    animation: dropLinePulse 0.8s ease-in-out infinite;
}

/* =====================
   RANKING CONTAINER SPACING
   ===================== */
.ranking-container {
    min-height: 100vh;
    padding-top: 76px; /* Espace pour le header fixe */
}

/* =====================
   ARROW MODE BUTTONS
   ===================== */
.ranking-item-arrows {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ranking-arrow-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: var(--border-radius-sm);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all var(--transition-fast);
    backdrop-filter: blur(4px);
}

.ranking-arrow-btn:hover:not(:disabled) {
    background: rgba(255, 140, 90, 0.3);
    color: var(--color-primary);
}

.ranking-arrow-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Mode toggle button active state */
.ranking-toggle-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

/* =====================
   PROFILE PAGE SPACING
   ===================== */
.profile-container {
    min-height: 100vh;
    padding-top: 76px; /* Espace pour le header fixe */
}

/* Profile page title */
.profile-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-light);
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    margin: 0;
}

/* Toggle switch for private/public profile */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--color-gray);
    border-radius: 13px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.toggle-switch.active {
    background: var(--color-primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--color-white);
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

/* Info tooltip */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    background: var(--color-gray);
    border-radius: 50%;
    cursor: help;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-light);
}

.info-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--color-dark);
    color: var(--color-light);
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
    border-radius: var(--border-radius-sm);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 10;
    max-width: 250px;
    white-space: normal;
    text-align: center;
}

.info-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 8px);
}

/* =====================
   MODAL DIALOG
   ===================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-md);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--color-gray-dark);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.modal-icon {
    margin-bottom: var(--spacing-md);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-light);
    margin-bottom: var(--spacing-sm);
}

.modal-text {
    font-size: 0.9rem;
    color: var(--color-gray-light);
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.modal-actions .btn {
    flex: 1;
    max-width: 150px;
}
