/* ============================================
   MODE PROJECTION / TBI (Tableau Blanc Interactif)
   Optimise n'importe quelle page pour la projection
   en classe : cache le chrome (header, footer, FAB,
   sidebar, etc.), zoom le contenu, fond uniforme.

   Active via :
   - URL ?projection=1 (lecture par projection-mode.js)
   - localStorage oplc_projection_mode = '1'
   - Bouton FAB "Mode projection"
   - Raccourci clavier : touche P seule + Shift (Shift+P)
   - Echap pour quitter

   Cree le 2026-05-16 (item roadmap aout 2026 #3).
   ============================================ */

html.oplc-projection-mode body,
body.oplc-projection-mode {
    background: #ffffff !important;
    overflow-x: hidden;
}

/* === ÉLÉMENTS À CACHER === */
html.oplc-projection-mode header,
html.oplc-projection-mode .site-header,
html.oplc-projection-mode .main-header,
html.oplc-projection-mode #mainHeader,
html.oplc-projection-mode footer,
html.oplc-projection-mode .site-footer,
html.oplc-projection-mode .main-footer,
html.oplc-projection-mode #mainFooter,
html.oplc-projection-mode #fab-menu,
html.oplc-projection-mode .fab-menu,
html.oplc-projection-mode #cookie-banner,
html.oplc-projection-mode .cookie-banner,
html.oplc-projection-mode #onboarding-tour,
html.oplc-projection-mode .breadcrumb,
html.oplc-projection-mode .breadcrumbs,
html.oplc-projection-mode .skip-link,
html.oplc-projection-mode .news-banner {
    display: none !important;
}

/* === MAXIMISER LA ZONE DE CONTENU === */
html.oplc-projection-mode main,
html.oplc-projection-mode .main-content,
html.oplc-projection-mode #main-content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    min-height: 100vh !important;
}

/* === ZOOM TEXTE POUR LISIBILITÉ EN CLASSE === */
html.oplc-projection-mode {
    font-size: 110%;
}
html.oplc-projection-mode h1 {
    font-size: 2.5rem !important;
}
html.oplc-projection-mode h2 {
    font-size: 2rem !important;
}
html.oplc-projection-mode p,
html.oplc-projection-mode li,
html.oplc-projection-mode label,
html.oplc-projection-mode td,
html.oplc-projection-mode .hub-card-desc {
    font-size: 1.05rem !important;
    line-height: 1.55 !important;
}

/* === BARRE DE CONTRÔLE PROJECTION === */
.oplc-proj-bar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.85);
    color: white;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    border-radius: 0 0 0 0.75rem;
    font-size: 0.9rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.oplc-proj-bar-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.9;
}
.oplc-proj-bar-label::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: oplcProjPulse 1.6s infinite;
}
@keyframes oplcProjPulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
.oplc-proj-bar-quit {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.35rem 0.75rem;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s;
    font-family: inherit;
}
.oplc-proj-bar-quit:hover,
.oplc-proj-bar-quit:focus-visible {
    background: rgba(255, 255, 255, 0.25);
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* === DARK MODE : adapter la barre === */
[data-theme='dark'] .oplc-proj-bar {
    background: rgba(15, 23, 42, 0.92);
}
html.oplc-projection-mode[data-theme='dark'] body {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}

/* === IMPRESSION EN MODE PROJECTION : tout afficher === */
@media print {
    html.oplc-projection-mode .oplc-proj-bar {
        display: none !important;
    }
}

/* === MOBILE : ajustement du label === */
@media (max-width: 640px) {
    .oplc-proj-bar {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    .oplc-proj-bar-label span {
        display: none;
    }
}
