/* ==========================================================
   Charte des modules de formation — extraite de module1-introduction.html
   ========================================================== */

/* ---------- Base : variables, slides, boîtes, tableaux, navigation ---------- */
/* Style inspiré OpenShift + AWS */
:root {
    --seanergy-blue: #0066cc;
    --seanergy-dark-blue: #003d7a;
    --seanergy-light-blue: #4d94ff;
    --seanergy-orange: #ff6b35;
    --seanergy-green: #00d084;
    --seanergy-yellow: #ffd93d;
    --bg-color: #ffffff;
    --bg-secondary: #f7f9fc;
    --text-color: #232f3e;
    --border-color: #d5dbdb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: linear-gradient(135deg, #f7f9fc 0%, #e8ecef 100%);
    color: var(--text-color);
    overflow: hidden;
}

.slide-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.slide {
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    padding: 3rem;
    display: none;
    flex-direction: column;
    position: relative;
}

.slide.active { display: flex; animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

.slide-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.slide-title {
    font-size: 2.2rem;
    color: var(--seanergy-dark-blue);
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.slide-subtitle {
    font-size: 1.2rem;
    color: #546e7a;
    font-weight: 400;
}

.slide-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 300px;
    scrollbar-width: thin;
    scrollbar-color: var(--seanergy-blue) var(--bg-secondary);
}

.slide-content::-webkit-scrollbar { width: 8px; }
.slide-content::-webkit-scrollbar-track { background: var(--bg-secondary); border-radius: 4px; }
.slide-content::-webkit-scrollbar-thumb { background: var(--seanergy-blue); border-radius: 4px; }

h2 {
    font-size: 1.6em;
    color: var(--seanergy-dark-blue);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
}

h3 {
    font-size: 1.2em;
    color: var(--seanergy-blue);
    margin: 1.2rem 0 0.8rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

p, li {
    font-size: 0.95em;
    line-height: 1.7;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

ul { margin-left: 2rem; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Boxes style AWS/OpenShift */
.content-box {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.content-box:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--seanergy-light-blue);
}

.warning-box {
    background: #fff8f0;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--seanergy-orange);
    border-right: 1px solid #ffd9b3;
    border-top: 1px solid #ffd9b3;
    border-bottom: 1px solid #ffd9b3;
    box-shadow: var(--shadow-sm);
}

.success-box {
    background: #f0fdf4;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--seanergy-green);
    border-right: 1px solid #bbf7d0;
    border-top: 1px solid #bbf7d0;
    border-bottom: 1px solid #bbf7d0;
    box-shadow: var(--shadow-sm);
}

.info-box {
    background: #f0f9ff;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--seanergy-light-blue);
    border-right: 1px solid #bae6fd;
    border-top: 1px solid #bae6fd;
    border-bottom: 1px solid #bae6fd;
    box-shadow: var(--shadow-sm);
}

.command-box {
    background: #1a1d23;
    color: #22d3ee;
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    margin: 1rem 0;
    border: 1px solid #374151;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    font-size: 0.9em;
}

.command-box code { color: #22d3ee; }

/* Tables style AWS */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: linear-gradient(180deg, #f7f9fc 0%, #e8ecef 100%);
    color: var(--seanergy-dark-blue);
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr { transition: all 0.2s ease; }
tbody tr:hover {
    background: #f0f9ff;
    transform: scale(1.01);
}

tbody tr:last-child td { border-bottom: none; }

svg {
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Navigation style OpenShift */
.slide-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 1000;
}

.nav-btn {
    background: linear-gradient(135deg, var(--seanergy-blue) 0%, var(--seanergy-dark-blue) 100%);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.1);
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.nav-btn:active {
    transform: translateY(-1px);
}

.nav-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.slide-counter {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: var(--bg-color);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    font-weight: 600;
    color: var(--seanergy-blue);
    font-size: 0.95rem;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Badges et labels */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    background: var(--seanergy-green);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Fragment styling */
.fragment {
    list-style: none;
    margin-left: 0;
}
    

/* ---------- Navigation entre modules ---------- */
.module-navigation {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 999;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.nav-home {
    background: rgba(255, 255, 255, 0.95);
    color: var(--seanergy-blue);
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-home:hover {
    background: var(--seanergy-blue);
    color: white;
    transform: translateY(-2px);
}

.nav-next-prev {
    display: flex;
    gap: 0.5rem;
}

.nav-module-btn {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-color);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-module-btn:hover {
    background: var(--seanergy-light-blue);
    color: white;
    transform: translateY(-2px);
}

.nav-module-btn.nav-next {
    background: linear-gradient(135deg, var(--seanergy-green), #059669);
    color: white;
    border: none;
}

.nav-module-btn.nav-next:hover {
    transform: translateY(-2px) scale(1.05);
}

/* Responsive : empiler sur petits écrans */
@media (max-width: 768px) {
    .module-navigation {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------- Quiz interactif ---------- */
.quiz-interactive {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.quiz-question {
    font-size: 1.1em;
    margin-bottom: 1rem;
    color: var(--seanergy-dark-blue);
}

.quiz-options {
    list-style: none;
    margin-left: 0;
}

.quiz-option {
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 6px;
    border: 2px solid transparent;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    border-color: var(--seanergy-light-blue);
    background: #f0f9ff;
}

.quiz-option.revealed.correct {
    background: #f0fdf4;
    border-color: var(--seanergy-green);
    font-weight: 600;
}

.quiz-option.revealed.correct::before {
    content: "✓ ";
    color: var(--seanergy-green);
    font-weight: bold;
    margin-right: 0.5rem;
}

.quiz-option.revealed.incorrect {
    opacity: 0.6;
}

.reveal-answer-btn {
    background: var(--seanergy-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.reveal-answer-btn:hover {
    background: var(--seanergy-dark-blue);
    transform: translateY(-2px);
}

.reveal-answer-btn.revealed {
    background: var(--seanergy-green);
    cursor: default;
}

/* ---------- Export PDF et impression ---------- */
.export-pdf-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: #e53e3e;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.3rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(255,255,255,0.2);
}

.export-pdf-btn:hover {
    background: #c53030;
    transform: translateY(-3px) scale(1.05);
}

/* Mode impression PDF optimisé */
@media print {
    /* Masquer navigation */
    .slide-nav, .nav-btn, .slide-counter, .module-navigation, .export-pdf-btn {
        display: none !important;
    }

    /* Réinitialiser le body */
    body {
        background: white !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .slide-container {
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Afficher toutes les slides */
    .slide {
        display: block !important;
        page-break-after: always;
        page-break-inside: avoid;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 297mm; /* A4 height */
        padding: 2cm !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        position: relative;
    }

    .slide:last-child {
        page-break-after: auto;
    }

    /* Header avec logo Seanergy */
    .slide::before {
        content: '';
        position: absolute;
        top: 1cm;
        right: 1cm;
        width: 120px;
        height: 40px;
        background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjQwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdodD0iNDAiIGZpbGw9IiMwMDY2Y2MiIHJ4PSI1Ii8+PHRleHQgeD0iNjAiIHk9IjI2IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmb250LWZhbWlseT0iQXJpYWwiIGZvbnQtc2l6ZT0iMjAiIGZvbnQtd2VpZ2h0PSJib2xkIiBmaWxsPSJ3aGl0ZSI+U2VhbmVyZ3k8L3RleHQ+PC9zdmc+') no-repeat;
        background-size: contain;
    }

    /* Footer avec numéro de page */
    .slide::after {
        content: "Page " counter(page);
        position: absolute;
        bottom: 1cm;
        right: 1cm;
        font-size: 10pt;
        color: #666;
    }

    /* Optimiser le contenu pour l'impression */
    .slide-header {
        border-bottom: 2px solid #0066cc !important;
        margin-bottom: 1.5rem !important;
        padding-bottom: 1rem !important;
    }

    .slide-title {
        font-size: 1.8rem !important;
        color: #003d7a !important;
    }

    .slide-subtitle {
        font-size: 1.1rem !important;
        color: #0066cc !important;
    }

    .slide-content {
        overflow: visible !important;
        height: auto !important;
        padding: 0 !important;
    }

    /* Éviter les coupures dans les boxes */
    .content-box, .warning-box, .success-box, .info-box, .command-box {
        page-break-inside: avoid;
    }

    /* Optimiser les tableaux */
    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    /* SVG responsive */
    svg {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Éviter orphelins/veuves */
    p {
        orphans: 3;
        widows: 3;
    }

    h2, h3 {
        page-break-after: avoid;
    }
}

/* Classe pour mode impression */
body.print-mode .slide {
    display: block !important;
}

/* ==========================================================
   Ajouts pour la génération depuis Markdown
   (composants absents du rendu d'origine, dans la même charte)
   ========================================================== */

/* Espacement vertical entre les blocs générés */
.slide-content > * + * { margin-top: 1.2rem; }
.slide-content > h3 { margin-top: 1.8rem; }
.slide-content ul ul { margin-top: 0.4rem; }
ol { margin-left: 2rem; }
code {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.9em;
    background: #eef2f7;
    color: var(--seanergy-dark-blue);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}
th code, td code { white-space: nowrap; }
td { font-size: 0.9em; line-height: 1.5; }

/* Tableaux larges : défilement horizontal dans la slide */
.table-wrap { overflow-x: auto; }
.table-wrap table { margin: 0; }

/* Formule d'accroche (« Concept = A + B ») */
.formula-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-left: 4px solid var(--seanergy-blue);
    border-radius: 8px;
    padding: 0.9rem 1.5rem;
    text-align: center;
}
.formula-box code {
    background: none;
    padding: 0;
    font-size: 1.05em;
    font-weight: 600;
    color: var(--seanergy-dark-blue);
}
.formula-box code + br + code { display: inline-block; margin-top: 0.4rem; }

/* Blocs de code : commandes (sombre) et sorties (clair) */
.command-box pre, .output-box pre {
    margin: 0;
    white-space: pre;
    overflow-x: auto;
    line-height: 1.55;
}
.command-box pre code { background: none; padding: 0; color: #22d3ee; font-size: 1em; }
.code-lang {
    display: block;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 0.6rem;
}
.output-box {
    background: #f8fafc;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    font-size: 0.9em;
}
.output-box pre code { background: none; padding: 0; color: #334155; font-size: 1em; }

/* Encadrés : titres et paragraphes compacts */
.warning-box h3, .success-box h3, .info-box h3, .content-box h3 { margin-top: 0; }
.warning-box p:last-child, .success-box p:last-child,
.info-box p:last-child, .content-box p:last-child { margin-bottom: 0; }

/* Diagrammes Mermaid */
pre.mermaid {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    color: transparent; /* masque le code source avant rendu */
    /* même police que la page : Mermaid mesure le texte avec cette police */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    font-size: 16px;
    white-space: pre-wrap;
}
pre.mermaid[data-processed] { color: inherit; }
pre.mermaid svg { margin: 0 auto; filter: none; }
/* neutralise les styles p/li de la charte dans les libellés Mermaid */
pre.mermaid p, pre.mermaid li { margin: 0; font-size: inherit; line-height: 1.5; color: inherit; }

/* Slide de titre du module : métadonnées */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.meta-grid .content-box { padding: 1rem 1.2rem; }
.meta-grid h3 { font-size: 1em; margin: 0 0 0.4rem 0; }
.meta-grid p { margin: 0; font-size: 0.9em; }

/* Slide de séquence */
.slide.sequence-slide .slide-content {
    display: flex;
    flex-direction: column;
}
/* centrage vertical sans rogner le haut quand le sommaire est long */
.slide.sequence-slide .slide-content > :first-child { margin-top: auto; }
.slide.sequence-slide .slide-content > :last-child { margin-bottom: auto; }
.sequence-duration { margin-left: 0.6rem; vertical-align: middle; }
.sequence-agenda { list-style: none; margin: 0 auto; max-width: 700px; width: 100%; counter-reset: agenda; }
.sequence-agenda li {
    counter-increment: agenda;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.55rem 1.2rem;
    margin-bottom: 0.55rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.sequence-agenda li::before {
    content: counter(agenda);
    background: var(--seanergy-blue);
    color: white;
    min-width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Quiz : correction */
.quiz-explanation {
    display: none;
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-left: 4px solid var(--seanergy-green);
    background: #f0fdf4;
    border-radius: 6px;
    font-size: 0.9em;
}
.quiz-interactive.is-revealed .quiz-explanation { display: block; }
.quiz-option .quiz-letter { font-weight: 700; margin-right: 0.4rem; color: var(--seanergy-blue); }

@media print {
    pre.mermaid { page-break-inside: avoid; }
    .quiz-explanation { display: block; }
}

/* Quiz compact : 2 questions par slide sans défilement (export PDF) */
.quiz-interactive { padding: 1rem 1.2rem; margin: 0 0 1rem 0; }
.quiz-question { margin-bottom: 0.5rem; font-size: 1em; }
.quiz-option { padding: 0.35rem 0.8rem; margin: 0.25rem 0; line-height: 1.4; }
.reveal-answer-btn { padding: 0.45rem 1rem; margin-top: 0.6rem; font-size: 0.85em; }
.quiz-explanation { margin-top: 0.6rem; padding: 0.5rem 0.8rem; }

/* ---------- Logos en pied de page (footer_logos du formation.yaml) ---------- */
/* La slide est en flex colonne : le pied de page est un élément du flux, sous
   .slide-content (flex: 1). Sa place est réservée, le contenu ne passe jamais dessous. */
.slide.has-footer { padding-bottom: 1.25rem; }

.slide-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 44px;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-color);
}

.slide-footer img {
    height: 32px;          /* hauteur fixe + largeur auto : rendu fiable avec html2canvas */
    width: auto;
    max-width: 200px;
    display: block;
}

.slide-footer .logo-left { margin-right: auto; }
.slide-footer .logo-right { margin-left: auto; }
.slide-footer .logo-left + .logo-left { margin-left: 1.5rem; margin-right: auto; }
.slide-footer .logo-right + .logo-right { margin-left: 1.5rem; }

@media print {
    .slide-footer {
        position: absolute;
        left: 2cm;
        right: 3.5cm;      /* laisse la place au numéro de page (.slide::after) */
        bottom: 0.8cm;
    }
}

/* Export PDF : aucune animation pendant la capture html2canvas */
body.pdf-export .slide { animation: none !important; }

/* Images locales des slides (![légende](images/x.svg), intégrées en data: par build.py) */
.slide-content img.slide-img {
    display: block;
    max-width: 100%;
    max-height: 9.5cm;   /* ≈ 8 unités du budget de hauteur (rendu-slides.md § 2) */
    margin: 0.4rem auto;
    object-fit: contain;
}

/* Page de garde du document complet : sommaire sur deux colonnes au-delà de 8 modules */
.sequence-agenda.cover-agenda { max-width: 1150px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 0.8rem; grid-auto-flow: column; grid-template-rows: repeat(var(--cover-rows, 7), auto); }
.sequence-agenda.cover-agenda li { font-size: 0.85em; padding: 0.4rem 0.9rem; margin-bottom: 0.4rem; }
