/* stylelint-disable no-descending-specificity declaration-block-single-line-max-declarations declaration-block-no-shorthand-property-overrides no-duplicate-selectors selector-type-no-unknown keyframes-name-pattern */

/* Reset box-sizing pour éviter les débordements */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Fond d'arrière-plan PNG pour toutes les pages */
html {
    background-color: transparent;
    position: relative;
}

html, body {
    background-color: transparent;
    min-height: 100vh;
}

/* ============================================
   PARALLAXE SYSTEM v2 - Modular & Clean
   Contains: 3 base layers + 1 optional landscape layer
   Uses CSS containment to isolate stacking contexts
   ============================================ */

/* Main parallax container - isolates all background layers from topbar */
body {
    position: relative;
    contain: layout;
}

/* Désactiver contain quand une modale est active pour permettre position:fixed */
body.modal-open {
    contain: none;
}

/* LAYER 1 - Deepest background (html::before) - z-index -3 */
html::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--doc-height, 200vh));
    min-height: 200vh;
    background-image: url('../img/background-school-material.png');
    background-repeat: repeat;
    background-size: 20%;
    background-position: 20% 15%;
    opacity: 0.18;
    z-index: -3;
    pointer-events: none;
    /* will-change et transform supprimés pour désactiver l'effet de parallaxe */
    mask-image: 
        linear-gradient(to bottom, 
            black 0%, 
            transparent 15%, 
            black 35%, 
            transparent 55%, 
            black 75%, 
            transparent 100%);
}

/* LAYER 2 - Middle background (body::before) - z-index -2 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--doc-height, 200vh));
    min-height: 200vh;
    background-image: url('../img/background-school-material.png');
    background-repeat: repeat;
    background-size: 20%;
    background-position: top left;
    opacity: 0.25;
    z-index: -2;
    pointer-events: none;
    /* will-change et transform supprimés pour désactiver l'effet de parallaxe */
}

/* LAYER 3 - Foreground background (body::after) - z-index -1 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--doc-height, 200vh));
    min-height: 200vh;
    background-image: url('../img/background-school-material.png');
    background-repeat: repeat;
    background-size: 20%;
    background-position: 15% 10%;
    opacity: 0.2;
    z-index: -1;
    pointer-events: none;
    /* will-change et transform supprimés pour désactiver l'effet de parallaxe */
    mask-image: 
        linear-gradient(to bottom, 
            transparent 0%, 
            black 20%, 
            black 40%, 
            transparent 60%, 
            black 80%, 
            transparent 100%);
}

/* Optional LAYER 4 - Landscape horizontal effect (for future use) */
/* Uncomment and customize when ready for horizontal parallax effect */
/*
main::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--doc-height, 200vh));
    min-height: 200vh;
    background-image: url('../img/background-landscape.png');
    background-repeat: repeat;
    background-size: auto 100%;
    background-position: center;
    opacity: 0.12;
    z-index: -4;
    pointer-events: none;
    will-change: transform;
    transform: translate3d(calc(var(--bg-scroll-x, 0) * -0.3px), 0, 0);
}
*/

/* Ensure main content stays readable above backgrounds */
body > *:not(main, .main-content, footer, .site-footer) {
    position: relative;
    z-index: 1;
}

/* Main content with appropriate z-index */
main, .main-content {
    background-color: rgb(255 255 255 / 95%);
    position: static !important;
    z-index: 0 !important;
}

/* Landing page: transparent main to see background between sections */
body.landing-page main {
    background-color: transparent;
}

/* Pour les pages d'accueil (college, lycee, bac), le main est transparent pour effet de flottement */
main.college-accueil-main,
main.lycee-accueil-main,
main.bac-accueil-main,
.college-accueil-main,
.lycee-accueil-main,
.bac-accueil-main {
    background-color: transparent !important;
    background: transparent !important;
}

/* Landing page avec fond transparent pour voir l'image de fond */
.landing-page {
    background: transparent !important;
}

/* Afficher le fond pour la landing page (il sera visible entre les sections) */
body.landing-page::before {
    display: block !important; /* Afficher le fond pour voir l'image entre les sections */
}

/* Centrage du contenu principal de la landing page */
body.landing-page > main {
    max-width: 900px;
    margin-inline: auto;
    width: 100%;
    box-sizing: border-box;
    padding-left: 2vw;
    padding-right: 2vw;
}

/* Centrage landingpage sur grands écrans uniquement */
@media (width >= 1200px) {
    body.landing-page {
        width: 100vw;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        background: inherit;
    }

    body.landing-page > header,
    body.landing-page > main {
        width: 100%;
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }
}

@media (width >= 2000px) {
    body.landing-page > header,
    body.landing-page > main {
        max-width: 80vw;
    }
}

/* --- Utility helpers added for replacing common inline styles --- */
.hidden { display: none !important; }

/* === Responsive XXL pour landingpage MonCoachScolaire (doit être à la fin du fichier) === */

@media (width >= 1600px) {
    body.landing-page > main,
    body.landing-page > header,
    .landing-page .why-mcs,
    .landing-page .intro,
    .landing-page .reassurance-panel,
    .landing-page .infos {
        max-width: 1500px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .landing-page .niveau-cards {
        grid-template-columns: repeat(3, minmax(380px, 1fr)) !important;
        gap: 3.5rem !important;
    }
}

@media (width >= 2000px) {
    body.landing-page > main,
    body.landing-page > header,
    .landing-page .why-mcs,
    .landing-page .intro,
    .landing-page .reassurance-panel,
    .landing-page .infos {
        max-width: 1700px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .landing-page .niveau-cards {
        grid-template-columns: repeat(3, minmax(420px, 1fr)) !important;
        gap: 4rem !important;
    }
}

/* === Amélioration responsive landingpage MonCoachScolaire === */

.landing-page .niveau-cards {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    justify-items: center;
}

@media (width >= 1200px) {
    .landing-page .niveau-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }

    /* plus de règle ici, centrage géré par body.landing-page > main */
}

.landing-page .niveau-card {
    max-width: 350px;
    min-width: 260px;
}

.landing-page .why-cards {
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
}

.landing-page .reassurance-panel .section {
    flex: 1 1 340px;
    min-width: 320px;
    padding: 40px 32px;
}

@media (width <= 900px) {
    .landing-page .reassurance-panel .section {
        border-right: none !important;
        border-bottom: 1px solid #eaeaea;
        padding: 32px 16px;
    }

    .landing-page .reassurance-panel .section:last-child {
        border-bottom: none;
    }
}

@media (width <= 600px) {
    .landing-page main {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .landing-page .niveau-card {
        min-width: 0;
        max-width: 100%;
        padding: 1.2rem 0.7rem;
    }

    .landing-page .reassurance-panel .section {
        padding: 18px 4px;
    }
}

/* Palette de couleurs MonCoachScolaire - Version équilibrée */

/* Bleu principal: #2563eb (professionnel, confiance) - 40% */

/* Violet secondaire: #7c3aed (innovation, créativité) - 30% */

/* Orange accent: #f59e0b (motivation, énergie) - 20% */

/* Gris neutres: #6b7280, #374151, #f8fafc - 10% */

body {
    font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: transparent; /* Pas de fond direct, géré uniquement par ::before */
    color: #374151;
    position: relative; /* Déjà défini plus haut mais gardé pour cohérence */
}

/* Conteneurs principaux - empêcher débordement */
main, .main-content, .container, section {
    max-width: 100%;
}

/* Images et médias responsifs */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Tables responsives */
table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

/* hide/move sidebar when user toggles it via header */
body.sidebar-hidden .sidebar {
    transform: translateX(-105%);
    transition: transform 0.32s ease;
}

/* When sidebar is hidden, main content should use full width */
body.sidebar-hidden.with-sidebar main, body.sidebar-hidden .main-content, body.sidebar-hidden 

/* header hamburger button */

/* Skip link - accessible but hidden by default */

/* Improved focus-visible styles for interactive elements */
a:focus-visible, button:focus-visible, .cta-btn:focus-visible, .btn:focus-visible {
    outline: 3px solid rgb(59 130 246 / 80%);
    outline-offset: 2px;
}

@media (width >= 900px) {
    /* On wide screens, prefer a subtle always-available hamburger */
}

/* Hide header action buttons on desktop when the sidebar is present */
@media (width >= 900px) {
    body.with-sidebar .site-header .header-actions { display: none !important; }
}

/* Page-level headers (not the site-wide sticky header) */
header:not(.site-header) {
    background: transparent; /* keep page headers subtle and part of content */
    color: #0f172a;
    padding: 1.25rem 1rem;
    text-align: left;
    box-shadow: none;
}

header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgb(0 0 0 / 10%);
}

header p {
    margin: 0.5rem 0 0;
    font-size: 1.2em;
    opacity: 0.9;
}

main {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    background-color: transparent; /* Transparent pour voir le fond entre les sections */
    position: static !important; /* Empêche le main de suivre le scroll */
}

/* Pour la landing page, le main est transparent pour voir le fond entre les sections */
body.landing-page main {
    background-color: transparent;
}

.intro {
    text-align: center;

    /* margin-bottom géré par landingpage.css pour les pages landing */
}

.intro h2 {
    font-size: 2.2em;
    color: #1e293b;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center; /* Centrer par défaut */
}

/* Règles globales pour niveau-cards et niveau-card */

/* Note: Les styles spécifiques pour .college-accueil-main sont définis dans assets/css/pages/college/index.css
   et ont une spécificité plus élevée grâce à .college-accueil-main */
.niveau-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    justify-items: center;
}

.niveau-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgb(0 0 0 / 10%);
    text-align: center;
    max-width: 350px;
    width: 100%;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.niveau-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #7c3aed, #f59e0b);
}

.niveau-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgb(0 0 0 / 15%);
}

.niveau-card.special {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);
    color: white;
    border: 2px solid #7c3aed;
}

.niveau-card.special::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #fcd34d);
}

.niveau-card h3 {
    color: #2563eb;
    font-size: 1.8em;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.niveau-card.special h3 {
    color: white;
    text-shadow: 0 2px 4px rgb(0 0 0 / 20%);
}

.niveau-card p {
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 1.5rem;
    font-size: 1.1em;
}

.niveau-card.special p {
    color: rgb(255 255 255 / 90%);
}

.niveau-card ul {
    text-align: left;
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.niveau-card li {
    margin-bottom: 0.75rem;
    color: #4b5563;
    position: relative;
}

.niveau-card li::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
    position: absolute;
    left: -1.2rem;
    top: -2px;
}

.niveau-card.special li {
    color: rgb(255 255 255 / 90%);
}

.niveau-card.special li::before {
    color: #fbbf24;
}

.auth-links {
    padding-top: 3rem;
    border-top: 2px solid #e5e7eb;
    background: rgb(255 255 255 / 50%);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
}

.auth-links h3 {
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-size: 1.4em;
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
    padding: 0.875rem 2rem;
    text-decoration: none;
    margin: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1em;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgb(37 99 235 / 20%);
}

.btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgb(37 99 235 / 30%);
}

.btn-special {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    box-shadow: 0 4px 6px rgb(245 158 11 / 20%);
}

.btn-special:hover {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    box-shadow: 0 6px 12px rgb(245 158 11 / 30%);
}

.btn-outline {
    background: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
    box-shadow: none;
}

.btn-outline:hover {
    background: #2563eb;
    color: white;
}

.btn-demo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-demo:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgb(102 126 234 / 30%);
}

/* Bouton d'exploration sans compte (ghost) */

.error {
    color: #dc2626;
    background: #fef2f2;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #dc2626;
}

.success {
    color: #059669;
    background: #ecfdf5;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #059669;
}

footer {
    background: transparent;
    color: #1e293b;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    font-size: 0.9em;
    position: relative; /* Assure que le footer reste au-dessus du main */
    z-index: 10 !important; /* Z-index élevé pour rester au-dessus du main */
}

/* Footer inner layout and helpers (replaces inline styles in footer.php) */
.site-footer { 
    /* Fond flouté sur toute la largeur - opacité réduite pour mieux voir l'image de fond */
    background: rgb(255 255 255 / 35%);
    backdrop-filter: blur(10px); /* Support Safari */
    box-shadow: 0 -4px 20px rgb(0 0 0 / 10%);
    color: #1e293b; 
    width: 100%; /* Prend toute la largeur */
    padding: 3rem 0; /* Padding vertical, le horizontal sera géré par inner */
    position: relative; /* Assure que le footer reste au-dessus du main */
    z-index: 10 !important; /* Z-index élevé pour rester au-dessus du main */

    /* Légère ombre portée pour améliorer la lisibilité sur fond clair */
    text-shadow: 0 1px 2px rgb(255 255 255 / 100%);
}

.site-footer .site-footer-inner { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 2rem; 

    /* Pas de fond ici, c'est le footer parent qui a le fond flouté */
}

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

/* Footer responsive - les règles spécifiques sont dans les media queries */
.site-footer h3, .site-footer h4 { 
    color: #1e40af; 
    margin-bottom: 1rem; 
    opacity: 1;
    font-weight: 600;
}

.site-footer h4 a { 
    color: #1e40af; 
    text-decoration: none; 
    opacity: 1;
    font-weight: 600;
}

.site-footer h4 a:hover { 
    text-decoration: underline; 
    opacity: 0.8; 
}

.site-footer p { 
    line-height: 1.6; 
    color: #334155;
    opacity: 0.95; 
}

.site-footer .footer-links-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.site-footer .footer-links-list li { 
    margin-bottom: 0.5rem; 
}

.site-footer .footer-links-list a { 
    color: #475569; 
    text-decoration: none; 
    opacity: 0.95; 
    transition: opacity .15s ease, color .15s ease; 
    font-weight: 500;
}

.site-footer .footer-links-list a:hover { 
    opacity: 1; 
    color: #1e40af;
    text-decoration: underline; 
}

.site-footer 
.site-footer .socials a { 
    color: #1e40af; 
    font-size: 1.5rem; 
    opacity: 0.9;
}

.site-footer .socials a:hover {
    opacity: 1;
}

.site-footer .divider { 
    border: none; 
    border-top: 1px solid rgb(30 41 59 / 30%); 
    margin: 2rem 0; 
}

.site-footer .footer-meta { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 1rem; 
}

.site-footer .footer-meta p { 
    color: #475569;
    opacity: 0.9; 
    margin: 0; 
    font-weight: 500;
}

.site-footer .footer-meta .meta-links a { 
    color: #475569; 
    text-decoration: none; 
    opacity: 0.9; 
    font-size: 0.9rem; 
    margin-left: 1rem;
    transition: opacity .15s ease, color .15s ease;
    font-weight: 500;
}

.site-footer .footer-meta .meta-links a:hover {
    opacity: 1;
    color: #1e40af;
    text-decoration: underline;
}

/* Responsive */
@media (width <= 768px) {
    .niveau-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .niveau-card {
        max-width: 100%;
    }

    header h1 {
        font-size: 2em;
    }

    .intro h2 {
        font-size: 1.8em;
    }
}

/* Nouvelles classes pour la page d'accueil modernisée */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgb(0 0 0 / 30%);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.features-section h2 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

/* Landing page modern layout (no header/sidebar) */
.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 50%);

    /* Section background images for the landing page — subtle, accessible overlays */
    .bg-landing-1, .bg-landing-2, .bg-landing-3, .bg-landing-4, 
    .bg-landing-1::before,
    .bg-landing-2::before,
    .bg-landing-3::before,
    .bg-landing-4::before,
    .bg-landing-5::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 0; /* background layer */
        background-repeat: no-repeat;
        background-size: cover;
        background-position: center center;
        opacity: 0.18; /* subtle */
        filter: saturate(0.95) contrast(0.95);
        pointer-events: none;
    }

    /* specific images chosen for the landing sections (faces & ages selected) */
    .bg-landing-1::before { background-image: url('assets/img/6eme/college capuche.avif'); background-position: 20% 20%; opacity: 0.14; }
    .bg-landing-2::before { background-image: url('assets/img/6eme/photo-1547082634-4886fd241406.avif'); background-position: 80% 30%; opacity: 0.16; }
    .bg-landing-3::before { background-image: url('assets/img/lycee/photo-1507207908229-c59ddb730e40.avif'); background-position: 70% 50%; opacity: 0.14; }
    .bg-landing-4::before { background-image: url('assets/img/bac/premium_photo-1683121368434-61c1ce4e9273.avif'); background-position: 15% 50%; opacity: 0.14; }
    .bg-landing-5::before { background-image: url('assets/img/bac/photo-1686628178356-86d1b9f308b5.avif'); background-position: 50% 60%; opacity: 0.18; }

    /* Keep all landing content above background */
    .bg-landing-1 > *, .bg-landing-2 > *, .bg-landing-3 > *, .bg-landing-4 > *, .bg-landing-5 > * { position: relative; z-index: 1; }

    /* gentle gradient overlays for legibility */
    .bg-landing-1::after,
    .bg-landing-2::after,
    .bg-landing-3::after,
    .bg-landing-4::after,
    .bg-landing-5::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 0.5;
        background: linear-gradient(180deg, rgb(255 255 255 / 0%) 0%, rgb(255 255 255 / 88%) 70%);
        mix-blend-mode: normal;
        pointer-events: none;
    }

    /* reduce or disable heavy background imagery on small screens to save bandwidth */
    @media (width <= 880px) {
        .bg-landing-1::before, .bg-landing-2::before, .bg-landing-3::before, .bg-landing-4::before, .bg-landing-5::before { opacity: 0.06; background-size: 140%; background-position: center top; }
        .bg-landing-1::after, .bg-landing-2::after, .bg-landing-3::after, .bg-landing-4::after, .bg-landing-5::after { background: linear-gradient(180deg, rgb(255 255 255 / 0%) 0%, rgb(255 255 255 / 96%) 80%); }
    }
}

.modern-landing 
.card-content h3 { margin:0; font-size:1.15rem; }
.card-action { display:inline-flex; align-items:center; justify-content:center; width:48px; height:48px; border-radius:50%; background: rgb(255 255 255 / 8%); color:white; text-decoration:none; }

/* responsive landing */

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgb(0 0 0 / 10%);
    text-align: center;
    transition: transform 0.3s ease;
}

/* QCM / Exercises interactions */
.qcm { border: 1px solid var(--border); padding: 1rem; border-radius: 8px; background: #fff; }
.qcm-question { margin-bottom: 0.8rem; }
.qcm-option { padding: 0.6rem 0.8rem; border: 1px dashed #e2e8f0; margin: 0.4rem 0; cursor: pointer; border-radius: 6px; }
.qcm-option:hover { background: rgb(0 0 0 / 3%); }
.qcm-selected { outline: 2px solid #60a5fa; background: rgb(96 165 250 / 6%); }
.qcm-correct { background: rgb(34 197 94 / 12%); border-color: rgb(34 197 94 / 35%); }
.qcm-wrong { background: rgb(239 68 68 / 8%); border-color: rgb(239 68 68 / 35%); }
.qcm-score.visible { display: inline-block; font-weight: 600; }

/* QCM interactifs - Garantir l'affichage vertical des choix */
.qcm-choices {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.qcm-choice {
    display: block !important;
    width: 100% !important;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
    box-sizing: border-box;
}

.qcm-choice:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.qcm-choice input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

.qcm-choice-text {
    user-select: none;
    display: inline-block;
}

/* Print friendly styles for guides */
@media print {
    body { background: white !important; color: #111 !important; }
    body::before { display: none !important; } /* Masquer le fond pour l'impression */

    /* hide site chrome */
    .site-header, #site-sidebar, footer, .header-actions, 
    .content-section, main { max-width: 100% !important; margin: 0; padding: 0; box-shadow: none; }
    .guide-body header { background: transparent !important; color: #111 !important; }
    .btn, .nav-btn, .qcm-check-button, .qcm-save-button { display: none !important; }
    .qcm-option { border: 1px solid #ccc !important; }
}

/* Print button style (small) */
.print-actions 
.print-actions 

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

.niveaux-section {
    padding: 4rem 2rem;
    background: white;
}

.niveaux-container {
    max-width: 1200px;
    margin: 0 auto;
}

.niveaux-section h2 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

.niveaux-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.niveaux-grid-single {
    display: grid;
    place-items: center;
    margin-top: 2rem;
}

.niveaux-grid-single .niveau-card-modern {
    max-width: 400px;
}

.niveau-card-modern {
    color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
}

.niveau-card-modern h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.niveau-card-modern .subtitle {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.niveau-card-modern ul {
    text-align: left;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.niveau-card-modern li {
    margin-bottom: 0.5rem;
}

.niveau-card-modern a {
    background: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    transition: all 0.3s ease;
}

.niveau-college {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.niveau-college a {
    color: #059669;
}

.niveau-lycee {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.niveau-lycee a {
    color: #7c3aed;
}

.niveau-bac {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.niveau-bac a {
    color: #dc2626;
}

.cta-section {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    padding: 3rem 2rem;
    text-align: center;
}

.cta-section h2 {
    color: white;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.cta-section p {
    color: white;
    margin-bottom: 2rem;
    opacity: 0.9;
    font-size: 1.1rem;
}

.parents-section h3 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.parents-section p {
    color: #666;
    line-height: 1.6;
    font-size: 1.1rem;
}

.parents-section a {
    background: #059669;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin-top: 1rem;
}

/* === Header styles moved from header.php === */
.site-header {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #06b6d4 100%);
    background-size: 300% 300%;
    animation: gradientMove 8s ease infinite;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgb(0 0 0 / 10%);
    position: sticky;
    top: 0;
    z-index: 1300; /* put header above the sidebar so header items are not hidden */
}
.logo { font-size: 2rem; font-weight: bold; text-decoration:none; color:white; display:flex; align-items:center; gap:0.5rem; }

@keyframes gradientMove { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Game Mode Indicator */

/* DB unavailable banner inside header: overlay so it doesn't increase header height */

/* .site-header .site-notice { }
@media (max-width: 800px) {
    .site-header .site-notice { }
}

/* Landing page DB notice (when header not present) */

/* .landing-page .site-notice { }
@media (max-width: 800px) {
    .landing-page .site-notice { }
} */

/* --------------------------
   Landing page specific rules
   -------------------------- */

/* On the landing we don't want to reserve space for the app sidebar.
   Force a single-column layout and ensure header/main spacing is correct. */
body.landing-page.with-sidebar, body.landing-page {
    display: block !important; /* cancel the desktop grid */
}

body.landing-page main,
body.landing-page .main-content,
body.landing-page 

/* Make the landing H1 highly readable and ensure it's not visually washed out */
body.landing-page header h1,
body.landing-page header h2 {
    color: #0f172a !important;
    opacity: 1 !important;
    text-shadow: 0 2px 6px rgb(0 0 0 / 6%);
}

/* Slightly increase the hero spacing on landing */
body.landing-page .intro {
    padding-top: 2rem;
}

/* Center hero / landing header for a professional landing look */
body.landing-page header {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 0.5rem;
}

body.landing-page header h1 {
    font-size: clamp(2.2rem, 4.2vw, 3.4rem);
    line-height: 1.05;
    margin-bottom: 0.6rem;
}

/* Center call-to-action buttons inside page header / hero */
body.landing-page header nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

/* Make main hero area centered and reduce left bias */
body.landing-page 

body.landing-page 

/* === STYLES POUR LES ENVIRONNEMENTS IMMERSIFS === */

.immersive-environment {
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 50%, #581c87 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    color: white;
    box-shadow: 0 8px 25px rgb(30 58 138 / 30%);
    border: 2px solid #fbbf24;
}

.environment-header {
    text-align: center;
    margin-bottom: 2rem;
}

.environment-header h3 {
    font-size: 1.8em;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgb(0 0 0 / 30%);
}

.environment-header p {
    font-style: italic;
    font-size: 1.1em;
    opacity: 0.9;
    line-height: 1.6;
}

.game-mechanics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.mechanic-card {
    background: rgb(255 255 255 / 10%);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgb(251 191 36 / 30%);
    backdrop-filter: blur(10px);
}

.mechanic-card h4 {
    color: #fbbf24;
    margin-bottom: 1rem;
    font-size: 1.2em;
}

.mechanic-card p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.narrative-context {
    background: rgb(0 0 0 / 20%);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #fbbf24;
}

.narrative-context p {
    font-style: italic;
    margin: 0;
    color: #e0e7ff;
}

.game-mechanics-exercise {
    background: rgb(251 191 36 / 10%);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #fbbf24;
}

.mechanic-detail {
    margin-bottom: 1rem;
}

.mechanic-detail h4 {
    color: #1e3a8a;
    margin-bottom: 0.5rem;
}

.mechanic-detail p {
    margin: 0.3rem 0;
    font-size: 0.95em;
    color: #374151;
}

.exercise-content {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 2px solid #e2e8f0;
}

.exercise-content p {
    margin: 0.8rem 0;
    font-weight: 500;
}

.hint {
    color: #7c3aed;
    font-style: italic;
    font-size: 0.9em;
}

.reward {
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    color: #1e3a8a;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 1rem;
    display: inline-block;
    box-shadow: 0 2px 4px rgb(245 158 11 / 30%);
}

/* === STYLES POUR LES MESSAGES DE COACH === */

.coach-message {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgb(59 130 246 / 15%);
}

.coach-message strong {
    color: #1e40af;
    font-size: 1.1em;
}

/* === STYLES POUR LA PROGRESSION DES CRISTAUX === */

.progress-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.progress-item {
    background: rgb(255 255 255 / 80%);
    border-radius: 10px;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
}

.progress-item h5 {
    margin: 0 0 1rem;
    color: #374151;
    font-size: 1.1em;
}

.crystal-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.2em;
    font-weight: bold;
    color: #7c3aed;
}

.crystal-icon {
    font-size: 1.5em;
    animation: crystalGlow 2s ease-in-out infinite alternate;
}

.crystal-count {
    font-size: 1.4em;
    color: #fbbf24;
}

.crystal-goal {
    color: #6b7280;
    font-size: 0.9em;
}

.crystal-progress-bar {
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px solid #d1d5db;
}

.crystal-fill {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    transition: width 0.5s ease;
}

.scepter-hint {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 3px solid #f59e0b;
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 6px 20px rgb(245 158 11 / 20%);
    animation: hintAppear 1s ease-out;
}

.hint-content h4 {
    color: #92400e;
    margin-bottom: 1rem;
    text-align: center;
}

.hint-content p {
    margin: 1rem 0;
    line-height: 1.6;
}

.hint-content em {
    color: #78350f;
    font-style: italic;
}

/* Animation pour les cristaux */
@keyframes crystalGlow {
    from {
        text-shadow: 0 0 5px #fbbf24, 0 0 10px #fbbf24, 0 0 15px #fbbf24;
    }

    to {
        text-shadow: 0 0 10px #f59e0b, 0 0 20px #f59e0b, 0 0 30px #f59e0b;
    }
}

@keyframes hintAppear {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Layout variables */
:root {
    --sidebar-width: 260px; /* slightly wider for better readability */
    --sidebar-collapsed-width: 70px;
    --header-height: 72px;
}

/* Ensure the main content is pushed right only when the page actually includes the sidebar */
.with-sidebar main, .with-sidebar .main-content {
    margin-left: var(--sidebar-width);
}

/* Keep page content below the sticky header so nothing sits under the topbar */
main, .main-content {
    padding-top: calc(var(--header-height) + 1rem);
    position: static !important; /* Empêche le main de suivre le scroll et de passer au-dessus du footer */
    z-index: 0 !important; /* Z-index bas pour rester sous le footer */
}

/* Correction spécifique pour les pages d'accueil et guides de remédiation */
body:not(.landing-page) main.main-content,
body:not(.landing-page) .main-content,
body:not(.landing-page) main {
    position: static !important;
    z-index: 0 !important; /* Z-index bas pour rester sous le footer */
    transform: none !important;
    will-change: auto !important;
} 

/* ------------------------------------------------------------------
   Topbar (global shared header) — compact, accessible and responsive
   These rules were previously inline / in dev backups. Move to global CSS
 ------------------------------------------------------------------ */
.topbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgb(0 0 0 / 8%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 9999; /* Keep above ALL page content, modals, and all stacking contexts */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.topbar .topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.22rem 0.9rem; /* compact by default */
    height: var(--header-height);
}
.topbar-left { display:flex; align-items:center; gap:0.45rem; }
.topbar-title { color: #0f172a; font-weight:700; font-size: 0.90rem; line-height:1; }
.topbar-right a.btn.small { padding: 0.30rem 0.75rem; font-size: 0.88rem; border-radius: 8px; }
.topbar-right { display:flex; align-items:center; gap:0.6rem; }

/* Accessible helpers used by topbar */
.sr-only { 
    position: absolute !important; 
    width: 1px; 
    height: 1px; 
    padding: 0; 
    margin: -1px; 
    overflow: hidden; 
    clip: rect(0, 0, 0, 0); 
    white-space: nowrap; 
    border: 0; 
}

.topbar-right .topbar-actions-list { list-style:none; display:flex; gap:0.5rem; margin:0; padding:0; align-items:center; }
.topbar-right .topbar-actions-list li { margin:0; }

/* Focus states for keyboard users */
.topbar a:focus, .topbar button:focus, .topbar a:focus-visible, .topbar button:focus-visible {
    outline: 3px solid rgb(59 130 246 / 35%);
    outline-offset: 2px;
    border-radius: 8px;
}

.topbar-logo { display:flex; align-items:center; gap:0.5rem; text-decoration:none; color:inherit; }
.topbar .logo-icon { font-size: 1.25rem; }
.topbar-logo:focus { text-decoration: none; }
.topbar-title-link { text-decoration: none; color: inherit; display:inline-flex; align-items:center; }
.topbar a.btn.small, .topbar .btn.small { padding: 0.4rem 0.8rem; font-size: 0.92rem; }
.topbar-title-link:hover { text-decoration: underline; }
.topbar-title { margin: 0; }

/* mobile / touch-friendly adjustments */
@media (width <= 600px) {
    .topbar {
        position: static; /* Désactive le sticky sur les petits écrans */
    }
    .topbar .topbar-inner { padding: 0.5rem 0.9rem; height: var(--header-height-mobile); }
    .topbar .logo-icon { font-size: 1.35rem; }
    .topbar a.btn.small, .topbar .btn.small { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
    .topbar-right .topbar-actions-list { gap: 0.2rem; }
}

.topbar-right a.btn.small { box-shadow: 0 2px 6px rgb(37 99 235 / 8%); }

/* Optional shrink state applied by JS when scrolled */
.topbar.shrink .topbar-inner { height: 36px; padding: 0.12rem 0.8rem; }
.topbar.shrink .topbar-title { font-size: 0.88rem; }
.topbar.shrink .logo-icon { font-size: 1.0rem; }
.topbar.shrink .topbar-right a.btn.small { padding: 0.22rem 0.5rem; font-size: 0.84rem; }

/* ============================================
   MODERN LANDING PAGE - Inspirée de Padlet, Khan Academy, Duolingo
   ============================================ */

/* Hero Section - Style Khan Academy / Duolingo */

/* Overlay supprimé - l'image de fond est visible à 100% */

.hero-note i {
    color: #fbbf24;
    filter: drop-shadow(0 0 3px rgb(251 191 36 / 50%));
}

.floating {
    animation: float 3s ease-in-out infinite;
}

.floating.delay-1 {
    animation-delay: 0.5s;
}

.floating.delay-2 {
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* CTA Buttons */

/* Features Section - Style Khan Academy */

.feature-item:hover 

.feature-icon i {
    font-size: 2rem;
    color: #d97706;
}

.feature-item h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.feature-item p {
    color: #64748b;
    line-height: 1.6;
    font-size: 1rem;
}

/* Parcours Section - Style Padlet (Wall) */

.wall-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 0 2px 4px rgb(0 0 0 / 20%);
}

.card-tags li {
    padding: 0.5rem 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0.95;
}

.card-tags li i {
    width: 18px;
    text-align: center;
}

.card-action {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgb(255 255 255 / 20%);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    text-decoration: none;
}

.card-action:hover {
    background: rgb(255 255 255 / 30%);
    transform: scale(1.1) rotate(90deg);
}

/* Card Colors */
.card-college 
.card-lycee 
.card-bac 


/* Card Content */
.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.card-body {
    margin-bottom: 1rem;
}


.card-body p {
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

.card-link i {
    transition: transform 0.3s ease;
}

.card-link:hover i {
    transform: translateX(4px);
}

/* CTA Final Section - Style Duolingo */

.cta-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgb(251 191 36 / 15%) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.cta-box {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

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

.cta-box h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgb(0 0 0 / 20%);
}

.cta-box p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Call-to-action button placeholder to fix syntax */
.btn-cta-main {
    /* styles intentionally left blank */
}

/* Responsive Design */

/* Sidebar base styling (fixed left column) */
.sidebar {
    position: fixed;
    top: var(--header-height); /* start below the top header */
    left: 0;
    height: calc(100vh - var(--header-height));
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #059669 0%, #10b981 40%, #06b6d4 100%);
    background-size: 250% 250%;
    animation: gradientMove 12s linear infinite;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1rem 1rem;
    box-shadow: 2px 0 12px rgb(0 0 0 / 8%);
    z-index: 1200;
}

/* Desktop layout: use a simple grid so the sidebar and main sit side-by-side
   instead of overlapping. On small screens we still keep the fixed/overlay behaviour. */
@media (width >= 900px) {
    body.with-sidebar {
        display: grid;
        grid-template-columns: var(--sidebar-width) 1fr;
        grid-template-rows: var(--header-height) 1fr;
        min-height: 100vh;
        align-items: start;
    }

    /* Header spans across both columns and remains sticky */
    body.with-sidebar .site-header {
        grid-column: 1 / -1;
        grid-row: 1 / 2; /* force header into the top row of the grid */
        position: sticky;
        top: 0;
        z-index: 1400; /* keep header above main and sidebar */
    }

    /* Sidebar becomes sticky in the left column (no overlay) */
    body.with-sidebar .sidebar {
        position: sticky;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        grid-column: 1 / 2;
        grid-row: 2 / -1;
        box-shadow: none; /* keep it flat with the layout */
    }

    /* Main content placed in the second column, no margin-left necessary */
    body.with-sidebar main,
    body.with-sidebar .main-content {
        grid-column: 2 / -1;
        grid-row: 2 / -1;
        margin-left: 0; /* Pas de margin-left car on utilise grid */
        position: relative; /* Assure que le main ne suit pas le scroll */
    }
}
.sidebar-logo { font-size: 1.5em; font-weight: bold; margin-bottom: 2.5rem; text-decoration: none; color: white; display:flex; align-items:center; gap:0.5rem; }
.sidebar-nav { display:flex; flex-direction:column; gap:2rem; width:100%; flex: 1; }
.sidebar-link { font-size:1.15em; color: white; text-decoration:none; padding:0.7rem 1.2rem; border-radius:12px; transition: background 0.2s, transform 0.2s, box-shadow 0.2s, opacity 0.25s; font-weight:500; display:flex; align-items:center; gap:0.7rem; }
.sidebar-link:hover, .sidebar-link.active { background: rgb(255 255 255 / 13%); color: #e8f5e8; transform: translateX(6px); box-shadow: 0 8px 18px rgb(0 0 0 / 12%); opacity: 1; }
.sidebar-link .icon-glow { display:inline-block; transition: text-shadow 0.2s ease; }

/* Footer de la sidebar avec déconnexion */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgb(255 255 255 / 10%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-user-info {
    padding: 0 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.demo-badge {
    font-size: 0.9rem;
    color: #fbbf24;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.user-name {
    font-size: 0.95rem;
    color: rgb(255 255 255 / 90%);
    font-weight: 500;
}

.demo-hint {
    font-size: 0.75rem;
    color: rgb(255 255 255 / 70%);
    margin: 0;
}

/* ============================================
   SYSTÈME RESPONSIVE - BREAKPOINTS STANDARDS
   ============================================
   Basé sur les standards du marché pour une compatibilité maximale
   Mobile First Approach avec progressive enhancement
   ============================================ */

/* ============================================
   MOBILE - max-width: 768px
   Smartphones et tablettes en mode portrait
   ============================================ */
@media only screen and (width <= 768px) {
    /* Container principal - pleine largeur */
    .main-content,
    main {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Header responsive */
    .site-header {
        padding: 0.75rem 1rem;
    }

    .site-header .header-actions {
        gap: 0.5rem;
    }

    /* Typographie adaptée */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Boutons - pleine largeur sur mobile */
    .btn,
    button.btn {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    /* Cards - empilées verticalement */
    .niveau-cards,
    .cards-grid,
    .features-grid-modern {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Sidebar - overlay sur mobile */
    .sidebar {
        width: 85%;
        max-width: 320px;
    }

    /* Formulaires */
    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        font-size: 16px; /* Évite le zoom sur iOS */
    }

    /* Navigation */
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Espacements réduits */
    section {
        padding: 2rem 1rem;
    }

    /* Images responsives */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Footer responsive */
    .site-footer {
        padding: 2rem 0;
    }

    .site-footer .site-footer-inner {
        padding: 0 1rem;
    }

    .site-footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Topbar responsive */
    .topbar {
        padding: 0.5rem 1rem;
    }

    .topbar-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Cards responsive */
    .niveau-card,
    .card {
        padding: 1.5rem 1rem;
    }
}

/* ============================================
   TABLETTE PORTRAIT - 767px à 991px
   Tablettes en mode portrait
   ============================================ */
@media only screen and (width >= 767px) and (width <= 991px) {
    .main-content,
    main {
        max-width: 100%;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* Grid adaptatif - 2 colonnes max */
    .niveau-cards,
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    /* Typographie intermédiaire */
    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.875rem;
    }

    /* Boutons - largeur adaptative */
    .btn {
        min-width: 200px;
        max-width: 100%;
    }

    /* Sidebar - peut rester visible */
    .sidebar {
        width: 280px;
    }

    /* Footer - 2 colonnes */
    .site-footer .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   TABLETTE PAYSAGE / PETIT DESKTOP - 992px à 1023px
   Tablettes en mode paysage et petits écrans desktop
   ============================================ */
@media only screen and (width >= 992px) and (width <= 1023px) {
    .main-content,
    main {
        max-width: 960px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* Grid - 2-3 colonnes selon le contexte */
    .niveau-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Typographie desktop */
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    /* Footer - 3 colonnes */
    .site-footer .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   DESKTOP - min-width: 1024px
   Ordinateurs de bureau et écrans larges
   ============================================ */
@media only screen and (width >= 1024px) {
    .main-content,
    main {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 3rem;
        padding-right: 3rem;
    }

    /* Grid desktop - 3 colonnes */
    .niveau-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }

    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Typographie desktop complète */
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    h3 {
        font-size: 1.875rem;
    }

    /* Boutons - taille normale */
    .btn {
        min-width: auto;
        width: auto;
        padding: 0.875rem 1.75rem;
    }

    /* Sidebar - largeur fixe */
    .sidebar {
        width: var(--sidebar-width, 280px);
    }

    /* Footer - 4 colonnes sur grand écran */
    .site-footer .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   DESKTOP LARGE - min-width: 1200px
   Grands écrans desktop
   ============================================ */
@media only screen and (width >= 1200px) {
    .main-content,
    main {
        max-width: 1400px;
    }

    .niveau-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 3.5rem;
    }
}

/* ============================================
   DESKTOP TRÈS LARGE - min-width: 1600px
   Écrans très larges et 4K
   ============================================ */
@media only screen and (width >= 1600px) {
    .main-content,
    main {
        max-width: 1500px;
    }

    .niveau-cards {
        grid-template-columns: repeat(3, minmax(380px, 1fr));
        gap: 4rem;
    }
}

/* ============================================
   ULTRA WIDE - min-width: 2000px
   Écrans ultra-larges
   ============================================ */
@media only screen and (width >= 2000px) {
    .main-content,
    main {
        max-width: 80vw;
    }
}

/* ============================================
   UTILITAIRES RESPONSIVE GLOBAUX
   ============================================ */

/* Masquer sur mobile */
@media only screen and (width <= 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Masquer sur desktop */
@media only screen and (width >= 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Afficher uniquement sur mobile */
@media only screen and (width <= 768px) {
    .show-mobile {
        display: block !important;
    }
}

/* Afficher uniquement sur desktop */
@media only screen and (width >= 769px) {
    .show-desktop {
        display: block !important;
    }
}

/* Flex direction responsive */
@media only screen and (width <= 768px) {
    .flex-responsive {
        flex-direction: column;
    }
}

@media only screen and (width >= 769px) {
    .flex-responsive {
        flex-direction: row;
    }
}

/* ============================================
   OPTIMISATIONS TOUCH / MOBILE
   ============================================ */
@media only screen and (width <= 768px) {
    /* Zone de touch minimale recommandée : 44x44px */
    a,
    button,
    .btn,
    input[type="button"],
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Espacement entre éléments cliquables */
    .btn + .btn {
        margin-top: 1rem;
    }

    /* Scroll horizontal désactivé par défaut */
    body {
        overflow-x: hidden;
    }

    /* Textes lisibles sans zoom */
    body {
        font-size: 16px;
    }

    /* Viewport fixe pour éviter le zoom automatique */
    input,
    textarea,
    select {
        font-size: 16px;
    }
}

/* ============================================
   ORIENTATION SPECIFIC
   ============================================ */
@media only screen and (width <= 768px) and (orientation: landscape) {
    /* Optimisations pour mode paysage mobile */
    .main-content {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }
}

.sidebar-logout {
    font-size: 1.05em;
    color: white;
    text-decoration: none;
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: rgb(239 68 68 / 20%);
    border: 1px solid rgb(239 68 68 / 30%);
    margin: 0 0.5rem 0.5rem;
}

.sidebar-logout:hover {
    background: rgb(239 68 68 / 35%);
    border-color: rgb(239 68 68 / 50%);
    transform: translateX(4px);
    box-shadow: 0 6px 16px rgb(239 68 68 / 20%);
}

.sidebar-logout .icon-glow {
    display: inline-block;
    transition: text-shadow 0.2s ease;
}

/* ============================================
   COURS LI�S DANS LES EXERCICES
   ============================================ */

.linked-courses-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.linked-courses-section h4 {
    color: #495057;
    font-size: 1.1em;
    margin: 0 0 1rem;
    font-weight: 600;
}

.linked-courses-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.linked-course-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #212529;
    transition: all 0.2s ease;
}

.linked-course-item:hover {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-color: #357abd;
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgb(74 144 226 / 30%);
}

.linked-course-item .course-icon {
    font-size: 1.3em;
}

.linked-course-item .course-title {
    flex: 1;
    font-weight: 500;
}

.linked-course-item .course-badge {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s ease;
}

.linked-course-item:hover .course-badge {
    background: rgb(255 255 255 / 20%);
    color: white;
}

.linked-courses-hint {
    margin: 1rem 0 0;
    color: #6c757d;
    font-size: 0.9em;
    font-style: italic;
}

/* ============================================
   STYLES POUR LES CARTES DE COURS (cours.php)
   ============================================ */

.cours-item-preview {
    padding: 1rem 0;
    color: #495057;
    line-height: 1.6;
}

.cours-exercises-count {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e9ecef;
    border-radius: 8px;
    font-size: 0.9em;
    color: #495057;
    margin-left: 1rem;
}

.no-cours-message {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.no-cours-message p {
    margin: 0.5rem 0;
    color: #495057;
}

.no-cours-message strong {
    color: #212529;
}

.no-cours-message small {
    color: #6c757d;
}

/* Admin badges */
.badge { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 8px; font-size: 0.85em; }
.badge-ok { background: #e6ffed; color: #046b1a; border: 1px solid #b7f7c8; }
.badge-warn { background: #fff6e6; color: #9a5a00; border: 1px solid #ffdfb5; }
.badge-muted { background: #eef1f4; color: #4a5568; border: 1px solid #d6dbe2; }
.text-muted { color: #6b7280; }
.text-error { color: #b91c1c; }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #e5e7eb; text-align: left; }
.admin-table thead th { background: #f9fafb; font-weight: 600; }
.table-wrapper { overflow-x: auto; }
.badge-danger { background: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }
.admin-table-actions { margin-top: 10px; display: flex; gap: 8px; }

/* ============================================
   Navigation des cours — Effet "Accent Slide"
   Appliqué aux boutons .exercise-navigation .nav-btn
   ============================================ */
.exercise-navigation .nav-btn {
    position: relative;
    overflow: hidden; /* Contenir l'accent dans le bouton */
}

.exercise-navigation .nav-btn::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 8px;
    height: 3px;
    background: rgb(255 255 255 / 90%); /* Accent lumineux sur fond dégradé */
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 180ms ease;
    pointer-events: none;
}

.exercise-navigation .nav-btn:hover::after,
.exercise-navigation .nav-btn:focus-visible::after {
    transform: scaleX(1); /* Accent qui "slide" de gauche à droite */
}

.exercise-navigation .nav-btn:focus-visible {
    outline: none; /* Laisser l'accent servir de repère de focus visuel */
}

@media (prefers-reduced-motion: reduce) {
    .exercise-navigation .nav-btn::after {
        transition: none;
        transform: none; /* Accent statique pour réduire l'animation */
    }
}

/* Micro-lift et shadow cohérents via CSS (remplace inline JS) */
.exercise-navigation .nav-btn {
    transition: transform 180ms ease, box-shadow 180ms ease;
    box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
}

.exercise-navigation .nav-btn:hover,
.exercise-navigation .nav-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgb(0 0 0 / 18%);
}

/* Accueil navigation: même approche sans JS inline */
.accueil-navigation-tool .nav-accueil-btn {
    transition: transform 180ms ease, box-shadow 180ms ease;
    box-shadow: 0 4px 12px rgb(0 0 0 / 12%);
}

.accueil-navigation-tool .nav-accueil-btn:hover,
.accueil-navigation-tool .nav-accueil-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgb(0 0 0 / 20%);
}

/* ==================================================
   RESPONSIVE MOBILE - Ajustements mineurs
   ================================================== */
@media (max-width: 768px) {
    /* Réduire padding sur petits écrans */
    .topbar .topbar-inner {
        padding: 0.22rem 0.6rem;
    }
    
    .site-footer .site-footer-inner {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    /* Padding minimal sur très petits écrans */
    .topbar .topbar-inner {
        padding: 0.22rem 0.4rem;
        gap: 0.4rem;
    }
    
    .site-footer .site-footer-inner {
        padding: 0 0.75rem;
    }
    
    .main-content {
        padding: 1rem 0.75rem;
    }
    
    /* Réduire font-size pour éviter débordement */
    .topbar-title {
        font-size: 0.8rem;
    }
    
    /* Boutons plus compacts */
    .topbar-right a.btn.small {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* stylelint-enable no-descending-specificity declaration-block-single-line-max-declarations declaration-block-no-shorthand-property-overrides no-duplicate-selectors selector-type-no-unknown keyframes-name-pattern */
