/* ========================================================
   1. SOCLE COMMUN (Couleurs & Design global)
   S'applique au Mobile ET à l'Ordinateur
   ======================================================== */
:root {
    --rs-primary: #fc4c02;
    --rs-primary-dark: #e34002;
    --rs-dark: #1e293b;
    --rs-gray: #64748b;
    --rs-light: #f1f5f9;
    --rs-success: #16a34a;
    --rs-radius: 12px;
    --rs-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.wp-block-group {
	width:100%;
}

.has-global-padding {
	padding-left: 0px !important;
	padding-right: 0px !important;
}

/* Reset de sécurité pour éviter les débordements */
.rs-dashboard-wrapper, .rs-container, .rs-team-dashboard {
    box-sizing: border-box;
    width: 100%;
}
.rs-dashboard-wrapper *, .rs-container *, .rs-team-dashboard * {
    box-sizing: border-box;
}

/* --- WIDGET CHALLENGE (Design) --- */
.rs-challenge-card {
    background: white; border: 1px solid #e2e8f0; border-radius: var(--rs-radius);
    padding: 20px; margin-bottom: 30px; box-shadow: var(--rs-shadow);
    position: relative; overflow: hidden;
}
.rs-challenge-card.completed { border-color: #fbbf24; background: linear-gradient(to bottom, #ffffff, #fffbeb); }
.rs-challenge-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.rs-challenge-badge { font-size: 0.75em; font-weight: bold; padding: 4px 10px; border-radius: 20px; background: var(--rs-light); color: var(--rs-gray); white-space: nowrap; margin-left:10px; }
.completed .rs-challenge-badge { background: var(--rs-success); color: white; }
.rs-progress-track { height: 10px; background: var(--rs-light); border-radius: 10px; overflow: hidden; margin-top:5px; }
.rs-progress-fill { height: 100%; background: var(--rs-primary); border-radius: 10px; transition: width 1s ease-in-out; }
.completed .rs-progress-fill { background: var(--rs-success); }
.rs-challenge-reward { margin-top: 15px; padding: 10px; background: #ecfdf5; border: 1px dashed #10b981; border-radius: 8px; display: flex; gap: 15px; align-items: center; }

/* --- WIDGET SÉRIES / FLAMME (Design) --- */
.rs-streak-box { position: relative; transition: transform 0.2s; }
.rs-streak-box.rs-fire-on { border: 1px solid #fdba74; background: linear-gradient(to bottom, #fff, #fff7ed); }
.rs-streak-box.rs-fire-on h3 { color: #ea580c; }
.rs-streak-box.rs-fire-off { opacity: 0.8; filter: grayscale(100%); }
.rs-fire-on .rs-fire-anim { display: inline-block; animation: rsPulseFire 1.5s infinite ease-in-out; }
@keyframes rsPulseFire {
    0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(252, 76, 2, 0)); }
    50% { transform: scale(1.2); filter: drop-shadow(0 0 10px rgba(252, 76, 2, 0.4)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(252, 76, 2, 0)); }
}
.rs-tooltip { display: none; position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%); background: #334155; color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.7em; white-space: nowrap; z-index: 10; }
.rs-streak-box:hover .rs-tooltip { display: block; }

/* --- BOUTONS & INPUTS (Global) --- */
.button, button[type="submit"], .rs-btn {
    cursor: pointer; font-weight: 600; border-radius: 50px; transition: transform 0.1s;
}
.button:active { transform: scale(0.98); }


/* ========================================================
   2. VERSION ORDINATEUR (DESKTOP)
   On force la grille à 4 colonnes ici pour ne pas casser l'existant
   ======================================================== */
@media (min-width: 769px) {
    .rs-stat-row {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* 4 Colonnes strictes */
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .rs-content-split {
        display: flex;
        flex-direction: row; /* Côte à côte */
        gap: 40px;
    }

    .rs-col-podium { flex: 1; }
    .rs-col-chat { flex: 1.5; }

    /* On s'assure que les tableaux s'affichent en entier */
    .mobile-hide { display: table-cell !important; }
}


/* ========================================================
   3. VERSION MOBILE (SMARTPHONE)
   Ces règles ne s'activent QUE sur les petits écrans (< 768px)
   ======================================================== */
@media (max-width: 768px) {

    /* ========================================================
       CUSTOMISATION MENU TWENTY TWENTY-FIVE (MOBILE)
       ======================================================== */

    /* 1. Le Conteneur principal (L'écran qui s'ouvre) */
    .wp-block-navigation__responsive-container.is-menu-open {
        position: fixed !important; /* Force le menu à rester fixe */
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important; /* 100% de la largeur de l'écran */
        height: 100vh !important; /* 100% de la hauteur de l'écran */
        background-color: #1e293b !important; /* Bleu Nuit */
        z-index: 100000 !important; /* Passe au-dessus de TOUT */
        padding: 0 !important;
        display: flex !important;
        flex-direction: column;
        justify-content: center; /* Centre verticalement */
        align-items: center; /* Centre horizontalement */
        overflow-y: auto; /* Permet de scroller si le menu est trop long */
    }

    /* Conteneur interne des liens (pour centrer le bloc) */
    .wp-block-navigation__responsive-container-content {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 20px !important; /* Espace entre les liens */
        padding-top: 60px !important; /* Espace pour ne pas toucher la croix */
    }

    /* 2. Les Liens du menu */
    .wp-block-navigation__responsive-container .wp-block-navigation-item {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
    }

    .wp-block-navigation__responsive-container .wp-block-navigation-item__content {
        color: #ffffff !important; /* Texte Blanc */
        font-size: 1.6rem !important; /* Texte lisible */
        font-weight: 700 !important;
        text-transform: uppercase; /* Plus propre */
        text-decoration: none !important;
        display: inline-block !important;
        padding: 10px 0 !important;
        transition: transform 0.2s, color 0.2s;
    }

    /* Effet au survol/touch */
    .wp-block-navigation__responsive-container .wp-block-navigation-item__content:hover,
    .wp-block-navigation__responsive-container .wp-block-navigation-item__content:focus {
        color: #fc4c02 !important; /* Orange */
        transform: scale(1.1);
        background: transparent !important;
    }

    /* 3. Le Bouton "Fermer" (La croix) */
    .wp-block-navigation__responsive-container-close {
        position: absolute !important;
        top: 20px !important;
        right: 20px !important;
        background: transparent !important;
        border: none !important;
        z-index: 100001 !important; /* Au-dessus du fond bleu */
    }

    /* Couleur de la croix */
    .wp-block-navigation__responsive-container-close svg {
        fill: #ffffff !important; /* Croix blanche */
        width: 36px !important; /* Un peu plus gros */
        height: 36px !important;
    }

    /* 4. Le Bouton "Burger" (L'ouverture) - Sécurité */
    .wp-block-navigation__responsive-container-open {
        color: #1e293b !important;
    }

    /* --- FIX LAYOUT GLOBAL SUR MOBILE --- */
    main, .entry-content, footer .wp-block-group {
        padding-right: 0px !important; /* Petite marge de sécu */
        padding-left: 0px !important;
        overflow-x: hidden; /* Évite le scroll horizontal */
    }

    /* --- STATS DASHBOARD --- */
    .rs-stat-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 2 carrés par ligne */
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .rs-stat-box {
        padding: 10px;
        min-height: 100px;
    }
    
    .rs-stat-box h3 { font-size: 1.1rem; margin-bottom: 5px; }
    .rs-icon { font-size: 1.4rem; }

    /* --- TABLEAUX CLASSEMENT --- */
    .rs-table th, .rs-table td { padding: 10px 5px; font-size: 0.85em; }
    .mobile-hide, .rs-cat-badge { display: none !important; }
    .rs-user-cell img { width: 28px; height: 28px; }
    .rs-mobile-only-meta { display: block; font-size: 0.75em; color: #94a3b8; margin-top: 2px; }

    /* --- PAGE ÉQUIPE & CHAT --- */
    .rs-content-split {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }
    .rs-team-header { padding: 20px 10px; }
    .rs-team-header h1 { font-size: 1.6em; }
    .rs-team-badge { font-size: 3em; }
    .rs-chat-box { height: 350px; }

    /* --- FORMULAIRES (Anti-Zoom iPhone) --- */
    input[type="text"], input[type="number"], input[type="date"], select, textarea {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    /* --- PWA BANNER --- */
    .rs-pwa-banner {
        width: 92% !important;
        bottom: 10px !important;
        padding: 12px !important;
        left: 4% !important;
    }
    .rs-pwa-text strong { font-size: 0.9em; }
    .rs-pwa-icon { font-size: 1.2em; }
    
    .rs-ad-content img {
        max-width: 100%;
        height: auto;
    }
	
	/* ========================================================
       GESTION DES SOUS-MENUS (DROPDOWN) MOBILE
       ======================================================== */

    /* 1. Le Conteneur du sous-menu (L'accordéon) */
    .wp-block-navigation__submenu-container {
        position: relative !important; /* On annule le 'absolute' du desktop */
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        min-width: 200px !important;
        background-color: rgba(255, 255, 255, 0.05) !important; /* Fond très léger */
        border: none !important;
        box-shadow: none !important;
        padding: 10px 0 !important;
        margin-top: 10px !important;
        border-radius: 8px !important;
        display: none; /* Caché par défaut */
        flex-direction: column !important;
        gap: 10px !important;
    }

    /* Quand le menu est ouvert (Classe ajoutée par WordPress au clic) */
    .wp-block-navigation-submenu.is-open .wp-block-navigation__submenu-container {
        display: flex !important; /* On affiche */
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
    }

    /* 2. Les Liens du sous-menu */
    .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
        font-size: 1.2rem !important; /* Un peu plus petit que les parents */
        font-weight: 500 !important;
        color: #cbd5e1 !important; /* Gris clair */
        text-transform: none !important; /* Pas de majuscules */
    }

    .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
        color: #fc4c02 !important;
    }

    /* 3. La Flèche / Le Bouton d'ouverture */
    .wp-block-navigation__submenu-icon {
        background-color: rgba(255, 255, 255, 0.1) !important; /* Petit fond pour le repérer */
        border-radius: 50% !important;
        width: 44px !important; /* Taille doigt (Touch target) */
        height: 44px !important;
        margin-left: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
    }

    /* Couleur de la flèche SVG */
    .wp-block-navigation__submenu-icon svg {
        fill: #ffffff !important; /* Blanc pur */
        width: 20px !important;
        height: 20px !important;
        transition: transform 0.3s ease;
    }

    /* Rotation de la flèche quand ouvert */
    .wp-block-navigation-submenu.is-open .wp-block-navigation__submenu-icon svg {
        transform: rotate(180deg) !important;
    }

    /* Alignement Parent + Flèche sur la même ligne */
    .wp-block-navigation-item {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
    }
}