/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --rs-primary: #3b82f6;       /* Bleu dynamique */
    --rs-primary-dark: #2563eb;  /* Bleu survol */
    --rs-strava: #fc4c02;        /* Orange Strava */
    --rs-bg-card: #ffffff;
    --rs-bg-page: #f8fafc;
    --rs-text-main: #1e293b;     /* Gris très foncé */
    --rs-text-light: #64748b;    /* Gris moyen */
    --rs-border: #e2e8f0;
    --rs-radius: 12px;
    --rs-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.rs-container, .rs-dashboard, .rs-registration-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--rs-text-main);
    max-width: 1200px;
    margin: 0 auto;
}

/* =========================================
   2. TABLEAU DE BORD (CARDS)
   ========================================= */
.rs-header-card {
    background: linear-gradient(135deg, var(--rs-primary) 0%, #1e40af 100%);
    color: white;
    padding: 30px;
    border-radius: var(--rs-radius);
    margin-bottom: 30px;
    box-shadow: var(--rs-shadow);
}

.rs-header-card h2 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    color: white;
}

.rs-region-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
}

/* Grille des Stats */
.rs-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.rs-stat-card {
    background: var(--rs-bg-card);
    padding: 24px;
    border-radius: var(--rs-radius);
    border: 1px solid var(--rs-border);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rs-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--rs-shadow);
}

.rs-stat-card .rs-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--rs-text-light);
    margin-bottom: 8px;
}

.primary .rs-value {
    color: #ffffff !important;
}

.rs-stat-card .rs-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--rs-text-main);
}

.rs-stat-card.primary .rs-value {
    color: var(--rs-primary) !important;
}

/* =========================================
   3. TABLEAUX (CLASSEMENTS & ACTIVITÉS)
   ========================================= */
.rs-ranking-container, .rs-activities-list {
    background: var(--rs-bg-card);
    padding: 24px;
    border-radius: var(--rs-radius);
    border: 1px solid var(--rs-border);
    margin-bottom: 30px;
    overflow-x: auto; /* Scroll horizontal sur mobile */
}

table {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0;
}

th {
    text-align: left;
    padding: 16px;
    background-color: #f1f5f9;
    color: var(--rs-text-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--rs-border);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--rs-border);
    font-size: 0.95rem;
}

/* Zébrure pour la lisibilité */
tbody tr:hover {
    background-color: #f8fafc;
}

/* Podium Colors */
tr td:first-child { font-weight: bold; }

/* =========================================
   4. FORMULAIRES & BOUTONS
   ========================================= */
.rs-registration-container form p {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--rs-text-main);
}

input[type="text"], input[type="email"], input[type="password"], select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--rs-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box; /* Important pour ne pas dépasser */
}

input:focus, select:focus {
    border-color: var(--rs-primary);
    outline: none;
}

button.button, .rs-strava-btn {
    display: inline-block;
    background-color: var(--rs-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 50px; /* Pill shape */
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

button.button:hover {
    background-color: var(--rs-primary-dark);
    transform: translateY(-2px);
}

.rs-strava-btn {
    background-color: var(--rs-strava) !important; /* Force l'orange */
    box-shadow: 0 4px 6px rgba(252, 76, 2, 0.3);
}

.rs-strava-btn:hover {
    background-color: #e34000 !important;
}

/* Alerts */
.rs-alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}
.rs-alert-error {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.rs-success {
    background-color: #dcfce7;
    color: #15803d;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
}

/* =========================================
   5. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .rs-header-card { padding: 20px; }
    .rs-header-card h2 { font-size: 1.5rem; }
    .rs-stat-card .rs-value { font-size: 2rem; }
    
    /* Tableaux scrollables */
    .rs-ranking-container { padding: 15px; }
    th, td { padding: 12px 10px; font-size: 0.85rem; }
}



/* Médailles dans le tableau */
tr.rs-gold td:first-child { color: #d97706; font-size: 1.2rem; } /* Or */
tr.rs-silver td:first-child { color: #64748b; font-size: 1.2rem; } /* Argent */
tr.rs-bronze td:first-child { color: #b45309; font-size: 1.2rem; } /* Bronze */


/* =========================================
   6. PAGE BADGES / TROPHÉES
   ========================================= */
.rs-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Responsive auto */
    gap: 25px;
    padding-bottom: 40px;
}

.rs-badge-card {
    background: white;
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    border: 1px solid var(--rs-border);
    box-shadow: var(--rs-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* --- Style LOCKED (Grisé) --- */
.rs-badge-locked {
    filter: grayscale(100%); /* Rend tout gris */
    opacity: 0.6;            /* Un peu transparent */
    background: #f1f5f9;
    border-style: dashed;    /* Bordure pointillée pour effet "vide" */
}

/* --- Style UNLOCKED (Coloré) --- */
.rs-badge-unlocked {
    border-bottom: 4px solid var(--rs-primary); /* Petite touche de couleur en bas */
    transform: translateY(0);
}

.rs-badge-unlocked:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Le rond central */
.rs-badge-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid #ddd; /* Sera remplacé par la couleur inline */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    background: white;
    font-size: 2.5rem; /* Taille Emoji */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Textes */
.rs-badge-title {
    margin: 10px 0 5px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--rs-text-main);
}

.rs-badge-desc {
    font-size: 0.85rem;
    color: var(--rs-text-light);
    margin-bottom: 15px;
    line-height: 1.4;
}

.rs-badge-footer {
    font-size: 0.75rem;
    font-weight: 600;
}

.rs-tag-success {
    color: #16a34a;
    background: #dcfce7;
    padding: 4px 10px;
    border-radius: 12px;
}

.rs-tag-locked {
    color: #64748b;
}

/* Petit effet de brillance pour les gagnants */
.rs-badge-unlocked::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(45deg);
    pointer-events: none;
}

/* Titres des catégories de badges */
.rs-badge-cat-title {
    font-size: 1.4rem;
    color: var(--rs-text-main);
    margin: 0 0 20px 0;
    padding-left: 15px;
    border-left: 5px solid var(--rs-primary);
    font-weight: 800;
}




/* BOUTON GLOW */
.rs-btn-glow {
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}
.rs-btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.5);
}


@media (max-width: 768px) {
    .rs-hero-title { font-size: 2.5rem; }
    .rs-hero-stats { flex-direction: column; }
    .rs-stat-card { width: 100%; box-sizing: border-box; }
    .rs-badges-grid { gap: 20px; }
	.rs-step { width:100%;}
}

main { margin-top: 0 !important;}
main > div {padding: 0 !important;}
/* =========================================
   8. TWEAKS THEME (Cache Titre & Menu Flottant)
   ========================================= */

/* 1. Cacher le titre "Accueil" standard de WordPress */
/* On cible les classes les plus courantes utilisées par les thèmes (H1 ou entry-title) */
body.home .entry-title, 
body.home .page-title, 
body.home h1:not(.rs-hero-content h1),
.wp-block-group>h1{ 
    display: none !important; 
}

.entry-content, .alignfull { 
	margin-right:0px !important;
	margin-left:0px !important;
	max-width: 100%;
}

/* On s'assure aussi d'enlever la marge vide laissée par le titre caché */
body.home .site-content, 
body.home #content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* 2. Menu Flottant (Sticky) avec effet Verre Dépoli */
#masthead,          /* Sélecteur standard WordPress */
.site-header,       /* Sélecteur courant (Astra, OceanWP...) */
body header {     /* Autre variante */
    position: sticky;       /* Le rend collant */
    top: 0;                 /* Collé tout en haut */
    z-index: 9999;          /* Passe au-dessus de tout le reste */
    
    /* L'effet "Glass" (Verre) */
    background-color: rgba(255, 255, 255, 0.85) !important; /* Blanc à 85% d'opacité */
    backdrop-filter: blur(10px);  /* Floute l'arrière-plan (Safari/Chrome) */
    -webkit-backdrop-filter: blur(10px);
    
    /* Petite ombre pour le détacher du fond */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    
    /* Transition douce */
    transition: all 0.3s ease;
}

/* =========================================
   9. STYLES DU MENU
   ========================================= */

/* Bouton "Inscription" dans le menu Visiteur */
/* Astuce : Dans Apparence > Menus, activez "Classes CSS" dans les options de l'écran (tout en haut) 
   et ajoutez la classe 'rs-menu-btn' à l'élément Inscription */
.rs-menu-btn a {
    background-color: var(--rs-primary);
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 50px;
    margin-left: 10px;
    transition: background 0.3s;
}

.rs-menu-btn a:hover {
    background-color: var(--rs-primary-dark);
    transform: translateY(-2px);
}

/* Lien Déconnexion (ajouté automatiquement) */
.rs-logout-item a {
    color: #ef4444 !important; /* Rouge */
    font-weight: 500;
}

.rs-logout-item a:hover {
    color: #b91c1c !important;
    text-decoration: underline;
}

/* Style du bouton Inscription (Classe rs-menu-btn) */
.wp-block-navigation .rs-menu-btn a {
    background-color: var(--rs-primary);
    color: white !important;
    padding: 8px 18px !important;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.wp-block-navigation .rs-menu-btn a:hover {
    background-color: var(--rs-primary-dark);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Lien Déconnexion en rouge */
.wp-block-navigation .rs-logout a {
    color: #ef4444 !important;
}

/* Ajustement mobile pour ne pas que le bouton casse tout */
@media (max-width: 768px) {
    .rs-menu-btn a {
        display: inline-block;
        margin-top: 10px;
    }
}
/* =========================================
   10. GESTION DU MENU (Méthode CSS Robuste)
   ========================================= */

/* CAS 1 : L'utilisateur est VISITEUR (Pas connecté) */
/* On cache tous les éléments qui ont la classe "rs-member" */
body:not(.logged-in) .rs-member { 
    display: none !important; 
}

/* CAS 2 : L'utilisateur est MEMBRE (Connecté) */
/* On cache tous les éléments qui ont la classe "rs-guest" */
body.logged-in .rs-guest { 
    display: none !important; 
}

/* =========================================
   11. PIED DE PAGE (FOOTER)
   ========================================= */
.rs-footer {
    background-color: #0f172a; /* Bleu très sombre (Slate 900) */
    color: #f8fafc;
    padding: 60px 0 20px 0;
    margin-top: 80px; /* Espace avec le contenu du dessus */
    border-top: 4px solid var(--rs-primary);
}

.rs-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

/* Colonnes */
.rs-footer-brand {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 15px 0;
    background: -webkit-linear-gradient(45deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rs-footer-desc {
    color: #94a3b8;
    line-height: 1.6;
    font-size: 0.95rem;
}

.rs-footer-col h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Liens */
.rs-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rs-footer-links li {
    margin-bottom: 10px;
}

.rs-footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
}

.rs-footer-links a:hover {
    color: var(--rs-primary);
    padding-left: 5px; /* Petit effet de glissement */
}

/* Bouton Bug */
.rs-bug-btn {
    display: inline-block;
    background: rgba(239, 68, 68, 0.1); /* Fond rouge très léger */
    color: #fca5a5; /* Texte rouge clair */
    border: 1px solid #ef4444;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.rs-bug-btn:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Copyright bas de page */
.rs-footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 20px;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}
/* =========================================
   12. COMPTE À REBOURS (V2)
   ========================================= */

.rs-countdown-box {
    background: rgba(255, 255, 255, 0.05); /* Fond très léger */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 40px;
    backdrop-filter: blur(5px);
}

.rs-countdown-label {
    color: var(--rs-primary); /* Bleu */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.rs-timer-display {
    font-family: 'Courier New', Courier, monospace; /* Police style horloge */
    font-size: 2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5); /* Effet néon bleu */
}

.rs-time-unit {
    display: inline-block;
    padding: 0 5px;
}

/* Ajustement Logo Strava pour qu'il ne colle pas trop */
.rs-footer-col img {
    opacity: 0.8;
    transition: opacity 0.3s;
}
.rs-footer-col img:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .rs-timer-display {
        font-size: 1.5rem;
    }
}


/* =========================================
   13. PAGE HISTORIQUE (ARCHIVES)
   ========================================= */
.rs-history-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.rs-history-title {
    background: var(--rs-primary);
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 1.2rem;
    text-align: center;
}

.rs-history-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0; /* Pas d'espace, bordure au milieu */
}

@media (max-width: 768px) {
    .rs-history-grid { grid-template-columns: 1fr; }
}

.rs-history-col {
    padding: 20px;
    border-right: 1px solid #eee;
}

.rs-history-col:last-child { border-right: none; }

.rs-history-col h4 {
    text-align: center;
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.rs-history-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rs-history-col li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.rs-history-col li:last-child { border-bottom: none; }

.rs-history-col .medal { font-size: 1.2rem; margin-right: 10px; }
.rs-history-col .pts { font-weight: bold; color: var(--rs-primary); font-size: 0.9rem; }


/* =========================================
   14. CLASSEMENTS AVANCÉS (V2)
   ========================================= */

/* --- Les Onglets --- */
.rs-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.rs-tab-btn {
    background-color: white;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
}

.rs-tab-btn:hover {
    border-color: var(--rs-primary);
    color: var(--rs-primary);
}

.rs-tab-btn.active {
    background-color: var(--rs-primary);
    border-color: var(--rs-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* --- Cartes Régions --- */
.rs-region-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.rs-region-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Couleurs Podium */
.rs-region-card.gold-row { border-left: 5px solid #fbbf24; background: linear-gradient(to right, #fffbeb, #ffffff); }
.rs-region-card.silver-row { border-left: 5px solid #94a3b8; background: linear-gradient(to right, #f8fafc, #ffffff); }
.rs-region-card.bronze-row { border-left: 5px solid #d97706; background: linear-gradient(to right, #fff7ed, #ffffff); }

.rs-region-rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: #94a3b8;
    width: 60px;
    text-align: center;
}
.gold-row .rs-region-rank { color: #fbbf24; }
.silver-row .rs-region-rank { color: #94a3b8; }
.bronze-row .rs-region-rank { color: #d97706; }

.rs-region-info {
    flex-grow: 1;
    padding: 0 15px;
}

.rs-region-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: #1e293b;
}

.rs-region-stats {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    gap: 15px;
}

.rs-region-score {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--rs-primary);
    min-width: 100px;
    text-align: right;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .rs-region-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .rs-region-info { width: 100%; }
    .rs-region-stats { justify-content: center; }
    .rs-region-score { text-align: center; }
    .rs-region-rank { width: 100%; border-bottom: 1px solid #eee; padding-bottom: 5px; margin-bottom: 5px;}
}

/* =========================================
   15. FILTRES CLASSEMENTS
   ========================================= */

.rs-filters-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    align-items: center;
}

.rs-filters-bar select {
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    color: #334155;
    font-weight: 500;
    cursor: pointer;
}

.rs-reset-filter {
    color: #ef4444;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.rs-cat-badge {
    background-color: #e2e8f0;
    color: #475569;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.rs-mobile-only-meta {
    display: none;
    font-size: 0.75rem;
    color: #94a3b8;
}

@media (max-width: 600px) {
    .rs-filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .mobile-hide { display: none; }
    .rs-mobile-only-meta { display: block; }
}

/* =========================================
   16. PROFIL : DESIGN STRAVA V2
   ========================================= */

/* La carte globale */
.rs-strava-card {
    border-left: 5px solid #ccc; /* Bordure par défaut */
    transition: all 0.3s ease;
}

.rs-strava-card.is-connected {
    border-left-color: #22c55e; /* Vert quand connecté */
    background: linear-gradient(to right, #f0fdf4, #ffffff);
}

.rs-strava-card.is-disconnected {
    border-left-color: #fc4c02; /* Orange Strava quand déconnecté */
}

/* En-tête avec statut */
.rs-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.rs-card-header h3 {
    margin: 0 !important;
    border: none !important;
    padding: 0 !important;
    color: #1e293b;
}

.rs-status-pill {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
}

.rs-status-pill.online {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
    animation: pulse 2s infinite;
}

.rs-status-pill.offline {
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

/* Partie Connecté */
.rs-user-badge {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.rs-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.rs-user-details {
    display: flex;
    flex-direction: column;
}

.rs-strava-id {
    font-family: monospace;
    color: #64748b;
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    margin: 5px 0;
}

.rs-sync-note {
    font-size: 0.85rem;
    color: #166534;
}

/* Bouton Déconnexion (Rouge élégant) */
.rs-btn-disconnect {
    width: 100%;
    background-color: white;
    color: #ef4444;
    border: 2px solid #fee2e2;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rs-btn-disconnect:hover {
    background-color: #fef2f2;
    border-color: #ef4444;
}

/* Partie Déconnecté */
.rs-promo-text {
    margin-bottom: 20px;
    color: #334155;
    line-height: 1.5;
}

.rs-btn-connect-strava {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #FC4C02; /* Strava Orange Officiel */
    padding: 12px;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(252, 76, 2, 0.2);
    text-decoration: none;
}

.rs-btn-connect-strava:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(252, 76, 2, 0.3);
    background-color: #e34000;
}

.rs-btn-connect-strava img {
    height: 35px; /* Taille ajustée */
    width: auto;
}

.rs-security-note {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 15px;
}

/* Animation de la pastille verte */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Mobile responsive */
@media (max-width: 500px) {
    .rs-user-badge {
        flex-direction: column;
        text-align: center;
    }
    .rs-status-pill {
        font-size: 0.75rem;
    }
}


/* =========================================
   17. BADGES & COLLECTIONS (V2 Dynamique)
   ========================================= */

.page-id-20 .rs-header-card {
    text-align: center;
    margin-bottom: 40px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.page-id-20 .rs-header-card h2, .page-id-20 .rs-header-card p {
	color: #000;
}

/* SECTION COLLECTION */
.page-id-20 .rs-collection-section {
    margin-bottom: 50px;
}

.page-id-20 .rs-collection-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

.page-id-20 .rs-collection-titles h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #1e293b;
}

.page-id-20 .rs-collection-titles span {
    font-size: 0.9rem;
    color: #64748b;
}

/* BARRE DE PROGRESSION */
.rs-collection-progress {
    text-align: right;
    min-width: 150px;
}

.rs-prog-text {
    font-weight: 800;
    color: var(--rs-primary);
    font-size: 0.9rem;
}

.rs-prog-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.rs-prog-bar div {
    height: 100%;
    background: var(--rs-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* GRILLE DES BADGES */
.rs-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Cartes responsive */
    gap: 20px;
}

/* CARTE BADGE */
.page-id-20 .rs-badge-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

/* -- ÉTAT VÉRROUILLÉ -- */
.rs-badge-card.locked {
    opacity: 0.7;
    background: #f8fafc;
    border-style: dashed;
}

.rs-badge-card.locked .rs-badge-icon {
    filter: grayscale(100%); /* Rend l'icône grise */
    opacity: 0.5;
}

/* -- ÉTAT DÉBLOQUÉ -- */
.rs-badge-card.unlocked {
    border-color: var(--badge-color); /* Utilise la couleur définie en DB */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    background: linear-gradient(to right, #ffffff, #fdfdfd);
}

.rs-badge-card.unlocked:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Indicateur de couleur sur le côté */
.rs-badge-card.unlocked::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background-color: var(--badge-color);
}

/* ICONE */
.rs-badge-icon {
    font-size: 2.5rem; /* Taille emoji */
    min-width: 60px;
    text-align: center;
}

/* CONTENU */
.rs-badge-content h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: #334155;
}

.rs-badge-card.unlocked h4 {
    color: #0f172a;
    font-weight: 700;
}

.rs-badge-content p {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

/* META DATA (Date ou Objectif) */
.rs-badge-meta {
    font-size: 0.75rem;
    font-weight: 600;
}

.rs-meta-date {
    color: #166534;
    background: #dcfce7;
    padding: 3px 8px;
    border-radius: 4px;
}

.rs-meta-target {
    color: #64748b;
    background: #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
}

/* ========================================================
   CARTE DE FRANCE (ACCUEIL)
   ======================================================== */
.rs-map-container {
    width: 100%;
    max-width: 600px; /* Taille max sur PC */
    margin: 0 auto;
    position: relative;
    padding: 20px;
}

.rs-france-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.05));
}

/* Infobulle (Tooltip) */
.rs-map-tooltip {
    display: none;
    position: absolute;
    background: #1e293b;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    pointer-events: none; /* La souris passe au travers */
    z-index: 1000;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Sur mobile, on réduit un peu les marges */
@media (max-width: 600px) {
    .rs-map-container { padding: 0; }
}