/* ============================================================
   Laravel Lessons — Styles (Red Theme)
   Fix: direction LTR forcé sur tous les blocs de code
   ============================================================ */

:root {
    --laravel-red: #FF2D20;
    --laravel-dark: #1a202c;
    --laravel-glass: rgba(255, 45, 32, 0.1);
}

/* ──────────────────────────────────────────────────────────────
   TEXTE GÉNÉRAL
────────────────────────────────────────────────────────────── */

.lesson-content {
    font-family: 'Almarai', sans-serif;
}

.educational-intro {
    line-height: 1.9;
}

.lead-text {
    font-size: 1.2rem;
    color: var(--bs-body-color);
    border-right: 5px solid var(--laravel-red);
    padding-right: 20px;
    line-height: 1.85;
}

section p {
    text-align: justify;
    line-height: 1.9;
    margin-bottom: 1.2rem;
}

section ul,
section ol {
    line-height: 1.85;
}

.laravel-accent-text {
    color: var(--laravel-red);
    font-weight: 800;
}

.laravel-primary-text {
    color: var(--bs-primary);
}

[data-bs-theme="dark"] .laravel-primary-text {
    color: var(--laravel-red);
}

/* ──────────────────────────────────────────────────────────────
   CODE INLINE (dans les paragraphes)
   Direction forcée LTR pour ne pas hériter du RTL de la page
────────────────────────────────────────────────────────────── */

code,
.in-para-inline-code {
    direction: ltr !important;
    unicode-bidi: embed;
    display: inline-block;
    font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace !important;
    font-size: 0.87em;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.4;
    vertical-align: middle;
}

[data-bs-theme="dark"] code,
[data-bs-theme="dark"] .in-para-inline-code {
    color: #ff7b72;
    background-color: rgba(255, 45, 32, 0.12);
    border: 1px solid rgba(255, 99, 71, 0.3);
}

[data-bs-theme="light"] code,
[data-bs-theme="light"] .in-para-inline-code {
    color: #b91c1c;
    background-color: rgba(255, 45, 32, 0.07);
    border: 1px solid rgba(255, 45, 32, 0.2);
}

/* ──────────────────────────────────────────────────────────────
   ARTISAN COMMAND
────────────────────────────────────────────────────────────── */

.artisan-command {
    background: #0d1117;
    color: #c9d1d9;
    padding: 13px 18px;
    border-radius: 8px;
    font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.93rem;

    /* ← Crucial : force LTR malgré le RTL de la page */
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed;

    margin: 14px 0;
    border: 1px solid #30363d;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    overflow-x: auto;
}

.artisan-command::before {
    content: '$';
    color: #3fb950;
    margin-right: 10px;
    font-weight: 700;
}

/* ──────────────────────────────────────────────────────────────
   PRO-CODE-WRAPPER
────────────────────────────────────────────────────────────── */

.pro-code-wrapper {
    border-radius: 10px;
    overflow: hidden;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 45, 32, 0.25) !important;

    /* Force la direction sur le conteneur entier */
    direction: ltr !important;
    unicode-bidi: embed;
}

[data-bs-theme="dark"] .pro-code-wrapper {
    border-color: #30363d !important;
    background: #0d1117;
}

[data-bs-theme="light"] .pro-code-wrapper {
    border-color: rgba(255, 45, 32, 0.2) !important;
    background: #ffffff;
}

/* ──────────────────────────────────────────────────────────────
   PRO-CODE-HEADER (barre de titre avec les dots)
────────────────────────────────────────────────────────────── */

.pro-code-header {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(255, 45, 32, 0.15);

    /* LTR sur le header aussi */
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed;

    display: flex;
    align-items: center;
    gap: 8px;
}

[data-bs-theme="dark"] .pro-code-header {
    background: #161b22 !important;
    border-bottom-color: #30363d;
}

[data-bs-theme="light"] .pro-code-header {
    background: rgba(255, 45, 32, 0.04) !important;
    border-bottom-color: rgba(255, 45, 32, 0.12);
}

.pro-code-header small {
    /* Nom du fichier dans le header = toujours LTR (chemin de fichier) */
    direction: ltr !important;
    unicode-bidi: embed;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.78rem;
}

/* macOS-style dots */
.window-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.window-dot.dot-laravel {
    background: var(--laravel-red);
}

.window-dot.dot-red {
    background: #ff5f56;
}

.window-dot.dot-yellow {
    background: #ffbd2e;
}

.window-dot.dot-green {
    background: #27c93f;
}

/* ──────────────────────────────────────────────────────────────
   PRO-CODE-BODY  (corps du bloc de code)
────────────────────────────────────────────────────────────── */

.pro-code-body {
    /* LTR obligatoire — c'est la règle d'or du code sur une page RTL */
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed;
    overflow-x: auto;
}

[data-bs-theme="dark"] .pro-code-body {
    background: #0d1117;
}

[data-bs-theme="light"] .pro-code-body {
    background: #f6f8fa;
}

/* Le <pre> à l'intérieur */
.pro-code-body pre {
    margin: 0 !important;
    padding: 18px 20px !important;
    font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace !important;
    font-size: 0.91rem !important;
    line-height: 1.75 !important;
    background: transparent !important;

    direction: ltr !important;
    text-align: left !important;
    white-space: pre;
    overflow-x: auto;
    tab-size: 4;
}

/* Le <code> à l'intérieur du <pre> */
.pro-code-body code {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed;
    font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace !important;
    font-size: inherit !important;

    /* Reset du style code inline */
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    vertical-align: baseline;
    display: inline;
    /* pas block ici — on est dans un <pre> */
    line-height: inherit;
}

[data-bs-theme="dark"] .pro-code-body pre,
[data-bs-theme="dark"] .pro-code-body code {
    color: #c9d1d9;
    background: transparent !important;
    border: none !important;
}

[data-bs-theme="light"] .pro-code-body pre,
[data-bs-theme="light"] .pro-code-body code {
    color: #24292f;
    background: transparent !important;
    border: none !important;
}

/* ──────────────────────────────────────────────────────────────
   EDUCATIONAL NOTE
────────────────────────────────────────────────────────────── */

.educational-note {
    background: rgba(255, 45, 32, 0.05);
    border-right: 4px solid var(--laravel-red);
    border-radius: 8px;
    line-height: 1.8;
}

[data-bs-theme="dark"] .educational-note {
    background: rgba(255, 45, 32, 0.1);
    color: #e2e8f0;
}

/* ──────────────────────────────────────────────────────────────
   FEATURE CARDS
────────────────────────────────────────────────────────────── */

.feature-card-laravel {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 16px;
    padding: 25px;
    height: 100%;
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .feature-card-laravel {
    background: #1e242e;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.feature-card-laravel:hover {
    border-color: var(--laravel-red);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(255, 45, 32, 0.15);
}

.feature-icon-laravel {
    font-size: 2rem;
    color: var(--laravel-red);
    margin-bottom: 15px;
}

/* ──────────────────────────────────────────────────────────────
   ACCORDION (dark mode)
────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .accordion-item {
    background-color: #1e242e;
    border-color: #2d3748;
}

[data-bs-theme="dark"] .accordion-button {
    background-color: #1e242e;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: rgba(255, 45, 32, 0.1);
    color: var(--laravel-red);
}

/* ──────────────────────────────────────────────────────────────
   FAQ SECTION
────────────────────────────────────────────────────────────── */

.laravel-faq-section {
    background-color: #f8f9fa;
}

[data-bs-theme="dark"] .laravel-faq-section {
    background-color: #1a202c !important;
    border-color: #2d3748 !important;
}