/* ==========================================================================
   PCTAMALOU 2026 – Style des Tutoriels
   Thème : Les Parchemins de la Cité Numérique
   Par Platon-Y – pctamalou.fr & e-of-h.fr
   ========================================================================== */

/* Dépendance : Ce fichier s'appuie sur global.css pour les variables et resets */

/* Blocs de contenu – Les tablettes du savoir */
.tutorial-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-2xl);
    position: relative;
    overflow: hidden;
}

/* Effet subtil de fond pour immersion */
.tutorial-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at top left,
        rgba(0, 212, 255, 0.05) 0%,
        transparent 50%
    );
    pointer-events: none;
    z-index: -1;
}

/* Sous-titres des sections – Les chapitres gravés */
.tutorial-content h3 {
    font-size: var(--font-size-xl);
    font-weight: 500;
    color: var(--text-accent);
    margin: var(--space-md) 0 var(--space-sm) 0;
    padding-left: var(--space-sm);
    border-left: 4px solid var(--accent-primary);
    line-height: var(--line-height-heading);
}

/* Paragraphes – Le récit du Guide */
.tutorial-content p {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin: var(--space-sm) 0;
    line-height: var(--line-height-base);
    max-width: 65ch;
}

/* Blocs de code – Les runes du binaire */
pre {
    position: relative;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin: var(--space-md) 0;
    overflow-x: auto;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    color: var(--code-text);
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--code-bg);
}

/* Barre de défilement stylisée */
pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: var(--code-bg);
    border-radius: var(--radius-sm);
}

pre::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    border: 2px solid var(--code-bg);
}

/* Code inline – Les fragments de runes */
code {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    color: var(--text-accent);
    background: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--code-border);
}

/* Bouton Copier – L'outil du scribe */
.copy-btn {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
    font-family: var(--font-family-mono);
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 2;
    outline: none;
}

.copy-btn:hover,
.copy-btn:focus {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.copy-btn.copied {
    background: var(--text-success);
    color: var(--bg-primary);
    border-color: var(--text-success);
}

.copy-btn.copied::after {
    content: '✔ Copié';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

/* Highlight syntaxique – Les couleurs des runes */
pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

/* Classes basiques pour highlight (extensible avec Prism.js si intégré) */
pre .keyword { color: #ff79c6; } /* Mots-clés */
pre .string { color: #f1fa8c; } /* Chaînes */
pre .number { color: #bd93f9; } /* Nombres */
pre .comment { color: #6272a4; font-style: italic; } /* Commentaires */
pre .function { color: #8be9fd; } /* Fonctions */
pre .operator { color: #ff5555; } /* Opérateurs */

/* Instructions des missions – Les ordres du Guide */
.mission-steps {
    counter-reset: mission-step;
    margin: var(--space-lg) 0;
    padding: 0;
}

.mission-steps li {
    counter-increment: mission-step;
    position: relative;
    padding: var(--space-md) var(--space-md) var(--space-md) var(--space-2xl);
    margin-bottom: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-primary);
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    transition: var(--transition-normal);
}

.mission-steps li:hover {
    background: rgba(0, 212, 255, 0.05);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.mission-steps li::before {
    content: counter(mission-step);
    position: absolute;
    left: var(--space-sm);
    top: var(--space-md);
    background: var(--accent-primary);
    color: var(--bg-primary);
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
    font-family: var(--font-family-mono);
}

/* Ressources externes – Les parchemins référencés */
.resources {
    margin: var(--space-lg) 0;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-secondary);
}

.resources h4 {
    font-size: var(--font-size-lg);
    color: var(--text-accent);
    margin: 0 0 var(--space-sm) 0;
}

.resources ul {
    margin: 0;
    padding: 0;
}

.resources li {
    padding-left: var(--space-md);
    margin-bottom: var(--space-sm);
}

.resources li::before {
    content: '↳';
    color: var(--text-accent);
    font-size: var(--font-size-base);
    font-weight: bold;
}

/* Blocs spéciaux – Les sceaux narratifs */
.note,
.warning,
.defi {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    padding: var(--space-md) var(--space-lg) var(--space-md) var(--space-2xl);
    margin: var(--space-lg) 0;
    border-radius: var(--radius-md);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.note p,
.warning p,
.defi p {
    margin: 0;
    color: var(--text-secondary);
}

/* Objectif de la semaine – Le serment gravé */
.objective {
    background: var(--success-bg);
    border-left: 6px solid var(--text-success);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-2xl) 0;
    border-radius: var(--radius-md);
    font-style: italic;
    color: var(--text-secondary);
    position: relative;
}

.objective::before {
    content: '🎯';
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    font-size: var(--font-size-xl);
    opacity: 0.4;
}

/* Responsive – L'adaptation des parchemins */
@media (max-width: 480px) {
    .tutorial-content {
        padding: var(--space-md);
        border-radius: var(--radius-md);
    }

    .tutorial-content h3 {
        font-size: var(--font-size-lg);
        padding-left: var(--space-xs);
    }

    pre {
        padding: var(--space-sm);
        font-size: var(--font-size-xs);
    }

    .copy-btn {
        padding: var(--space-xs);
        font-size: var(--font-size-xs);
        top: var(--space-xs);
        right: var(--space-xs);
    }

    .mission-steps li {
        padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-lg);
        font-size: var(--font-size-sm);
    }

    .mission-steps li::before {
        width: 1.75rem;
        height: 1.75rem;
        font-size: var(--font-size-xs);
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .tutorial-content {
        padding: var(--space-md);
    }

    pre {
        padding: var(--space-md);
    }

    .mission-steps li {
        padding: var(--space-md) var(--space-md) var(--space-md) var(--space-xl);
    }
}

@media (min-width: 769px) {
    .tutorial-content {
        animation: fadeIn 0.8s var(--transition-slow) ease-out;
    }

    pre:hover {
        box-shadow: var(--shadow-md);
        border-color: var(--accent-primary);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Accessibilité – La clarté pour tous */
@media (prefers-reduced-motion: reduce) {
    .tutorial-content,
    .mission-steps li,
    pre {
        animation: none;
        transition: none;
    }
}

/* Support impression – Les runes sur parchemin */
@media print {
    .tutorial-content {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
    }

    pre {
        background: #f5f5f5;
        border: 1px solid #ddd;
        color: black;
        font-size: 10pt;
    }

    .copy-btn {
        display: none;
    }

    .mission-steps li {
        background: white;
        border-left: 4px solid #000;
    }

    .note,
    .warning,
    .defi,
    .objective {
        border-left: 4px solid #000;
        background: white;
    }
}

/* Fin du fichier – Le sceau de la maîtrise */
/* 
    PCTAMALOU 2026 – tutoriels.css
    Version : 2.0.0
    Créateur : Platon-Y
    Licence : CC BY 4.0 – pctamalou.fr & e-of-h.fr
    
    Ce fichier sculpte les parchemins numériques où sont gravées les leçons.
    Chaque style est une rune, chaque classe un serment vers la maîtrise.
*/