/* ==========================================================================
   Article editor
   ========================================================================== */
/* ----------------------------------------------------------------------------
   SOUS-SECTION : CRÉATION D'ARTICLES (Espace membre - Éditeur/Admin)
   ----------------------------------------------------------------------------
   Styles pour la page de création/édition d'article dans l'espace membre
   ---------------------------------------------------------------------------- */
.article-builder-card {
    background: #fff;
    border-radius: 26px;
    border: 2px solid transparent;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, var(--red), var(--purple), var(--blue)) border-box;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
    padding: 2rem;
}
.article-form-panel,
.article-preview-panel {
    background: #fff;
    border-radius: 20px;
    padding: 1.5rem;
}
.article-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.article-panel-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}
.article-panel-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
}
.article-admin-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(0, 71, 160, 0.06);
}
.article-admin-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.article-admin-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}
.article-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

/* Formulaire de création - Champs de saisie */
.article-form .form-control,
.article-form .form-select {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    padding: 0.75rem 0.9rem;
}
.article-form .form-control:focus,
.article-form .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.18rem rgba(0, 71, 160, 0.18);
    background-color: #ffffff;
}
.article-form .form-text {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Formulaire de création - Gestion des hashtags */
.hashtags-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    min-height: 44px;
    align-items: center;
    background: #f9fafb;
}
.hashtag {
    background-color: #e5edff;
    color: #1e3a8a;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.hashtag-remove {
    cursor: pointer;
    color: #b91c1c;
    font-weight: 700;
}
.hashtag-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    background: transparent;
}

/* Éditeurs riches Quill + fallback */
.article-form .ql-toolbar.ql-snow,
.article-form .article-fallback-toolbar {
    border: 1px solid #cbd5e1;
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: #f8fafc;
}

.article-form .article-quill-editor.ql-container.ql-snow,
.article-form .article-quill-editor.article-editor--fallback {
    min-height: 220px;
    border: 1px solid #cbd5e1;
    border-radius: 0 0 12px 12px;
    background: #fff;
}

.article-form .article-quill-editor--summary.ql-container.ql-snow,
.article-form .article-quill-editor--summary.article-editor--fallback {
    min-height: 105px;
}

.article-form .article-quill-editor .ql-editor {
    min-height: 220px;
    padding: 12px 14px;
    color: #374151;
    font-size: 0.98rem;
    line-height: 1.7;
}

.article-form .article-quill-editor--summary .ql-editor {
    min-height: 105px;
}

.article-form .article-quill-editor.article-editor--fallback {
    padding: 12px 14px;
    color: #374151;
    font-size: 0.98rem;
    line-height: 1.7;
}

.article-form .article-quill-editor.article-editor--fallback:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.article-form .ql-toolbar.ql-snow:focus-within,
.article-form .article-quill-editor.ql-container.ql-snow:focus-within,
.article-form .article-quill-editor.article-editor--fallback:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.18rem rgba(0, 71, 160, 0.18);
}

.article-form .article-fallback-toolbar {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    flex-wrap: wrap;
}

.article-form .article-fallback-toolbar__button {
    width: 30px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #1f2937;
    line-height: 1;
}

.article-form .article-fallback-toolbar__button:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.article-form .article-fallback-toolbar__button--bold {
    font-weight: 800;
}

.article-form .article-fallback-toolbar__button--italic {
    font-style: italic;
}

.article-form .article-fallback-toolbar__button--underline {
    text-decoration: underline;
}

.article-form .article-fallback-toolbar__button--divider::before,
.article-form .ql-toolbar button.ql-divider::before {
    content: "";
    display: block;
    height: 2px;
    width: 16px;
    margin: 0 auto;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.8;
}

.article-form .ql-toolbar button.ql-divider {
    width: 28px;
}

.article-form .article-fallback-toolbar__colors {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-left: 6px;
    margin-left: 2px;
    border-left: 1px solid #dbe3ef;
}

.article-form .article-fallback-toolbar__swatch {
    width: 22px;
    height: 22px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 999px;
    padding: 0;
}

.article-form .article-fallback-toolbar__swatch:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.article-form .article-quill-editor .ql-editor .article-inline-divider,
.article-form .article-quill-editor.article-editor--fallback .article-inline-divider {
    border: 0;
    height: 2px;
    width: 42%;
    margin: 0.9em auto;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 71, 160, 0), rgba(0, 71, 160, 0.4), rgba(205, 46, 58, 0.4), rgba(205, 46, 58, 0));
}

/* Éditeur Quill (WYSIWYG) - Indentation */
.article-quill-editor .ql-editor .ql-indent-1 {
    padding-left: 3em;
}
.article-quill-editor .ql-editor .ql-indent-2 {
    padding-left: 6em;
}
.article-quill-editor .ql-editor .ql-indent-3 {
    padding-left: 9em;
}
.article-quill-editor .ql-editor .ql-indent-4 {
    padding-left: 12em;
}
.article-quill-editor .ql-editor .ql-indent-5 {
    padding-left: 15em;
}
.article-quill-editor .ql-editor .ql-indent-6 {
    padding-left: 18em;
}
.article-quill-editor .ql-editor .ql-indent-7 {
    padding-left: 21em;
}
.article-quill-editor .ql-editor .ql-indent-8 {
    padding-left: 24em;
}

/* Blocs de code dans l'éditeur Quill */
.article-quill-editor .ql-editor pre.ql-syntax {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 1rem 0;
}

.article-rich-content .course-color-red,
.article-form .course-color-red { color: #e60000; }
.article-rich-content .course-color-orange,
.article-form .course-color-orange { color: #ff9900; }
.article-rich-content .course-color-green,
.article-form .course-color-green { color: #008a00; }
.article-rich-content .course-color-blue,
.article-form .course-color-blue { color: #0066cc; }
.article-rich-content .course-color-purple,
.article-form .course-color-purple { color: #9933ff; }
.article-rich-content .course-color-000000,
.article-form .course-color-000000 { color: #000000; }
.article-rich-content .course-color-ffff00,
.article-form .course-color-ffff00 { color: #ffff00; }
.article-rich-content .course-color-ffffff,
.article-form .course-color-ffffff { color: #ffffff; }
.article-rich-content .course-color-facccc,
.article-form .course-color-facccc { color: #facccc; }
.article-rich-content .course-color-ffebcc,
.article-form .course-color-ffebcc { color: #ffebcc; }
.article-rich-content .course-color-ffffcc,
.article-form .course-color-ffffcc { color: #ffffcc; }
.article-rich-content .course-color-cce8cc,
.article-form .course-color-cce8cc { color: #cce8cc; }
.article-rich-content .course-color-cce0f5,
.article-form .course-color-cce0f5 { color: #cce0f5; }
.article-rich-content .course-color-ebd6ff,
.article-form .course-color-ebd6ff { color: #ebd6ff; }
.article-rich-content .course-color-bbbbbb,
.article-form .course-color-bbbbbb { color: #bbbbbb; }
.article-rich-content .course-color-f06666,
.article-form .course-color-f06666 { color: #f06666; }
.article-rich-content .course-color-ffc266,
.article-form .course-color-ffc266 { color: #ffc266; }
.article-rich-content .course-color-ffff66,
.article-form .course-color-ffff66 { color: #ffff66; }
.article-rich-content .course-color-66b966,
.article-form .course-color-66b966 { color: #66b966; }
.article-rich-content .course-color-66a3e0,
.article-form .course-color-66a3e0 { color: #66a3e0; }
.article-rich-content .course-color-c285ff,
.article-form .course-color-c285ff { color: #c285ff; }
.article-rich-content .course-color-888888,
.article-form .course-color-888888 { color: #888888; }
.article-rich-content .course-color-a10000,
.article-form .course-color-a10000 { color: #a10000; }
.article-rich-content .course-color-b26b00,
.article-form .course-color-b26b00 { color: #b26b00; }
.article-rich-content .course-color-b2b200,
.article-form .course-color-b2b200 { color: #b2b200; }
.article-rich-content .course-color-006100,
.article-form .course-color-006100 { color: #006100; }
.article-rich-content .course-color-0047b2,
.article-form .course-color-0047b2 { color: #0047b2; }
.article-rich-content .course-color-6b24b2,
.article-form .course-color-6b24b2 { color: #6b24b2; }
.article-rich-content .course-color-444444,
.article-form .course-color-444444 { color: #444444; }
.article-rich-content .course-color-5c0000,
.article-form .course-color-5c0000 { color: #5c0000; }
.article-rich-content .course-color-663d00,
.article-form .course-color-663d00 { color: #663d00; }
.article-rich-content .course-color-666600,
.article-form .course-color-666600 { color: #666600; }
.article-rich-content .course-color-003700,
.article-form .course-color-003700 { color: #003700; }
.article-rich-content .course-color-002966,
.article-form .course-color-002966 { color: #002966; }
.article-rich-content .course-color-3d1466,
.article-form .course-color-3d1466 { color: #3d1466; }

.article-rich-content .ql-size-small {
    font-size: 0.85em;
}

.article-rich-content .ql-size-large {
    font-size: 1.15em;
}

.article-rich-content .ql-size-huge {
    font-size: 1.4em;
}

.article-rich-content .ql-align-center {
    text-align: center;
}

.article-rich-content .ql-align-right {
    text-align: right;
}

.article-rich-content .ql-align-justify {
    text-align: justify;
}

.article-rich-content .ql-indent-1 { padding-left: 3em; }
.article-rich-content .ql-indent-2 { padding-left: 6em; }
.article-rich-content .ql-indent-3 { padding-left: 9em; }
.article-rich-content .ql-indent-4 { padding-left: 12em; }
.article-rich-content .ql-indent-5 { padding-left: 15em; }
.article-rich-content .ql-indent-6 { padding-left: 18em; }
.article-rich-content .ql-indent-7 { padding-left: 21em; }
.article-rich-content .ql-indent-8 { padding-left: 24em; }

.preview-summary {
    margin-bottom: 1rem;
    color: #4d5562;
    font-size: 0.95rem;
    line-height: 1.6;
}

.preview-summary p:last-child,
.preview-content p:last-child {
    margin-bottom: 0;
}

/* Formulaire de création - Sections SEO et dates */
.seo-section {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
}
.dates-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

/* Formulaire de création - Aperçu en temps réel */
.article-preview-card {
    border-radius: 20px;
    padding: 1.5rem;
    background: linear-gradient(180deg, #ffffff, #f9fafb);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.preview-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}
.preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #6b7280;
}
.preview-image {
    width: 100%;
    height: 190px;
    background-color: #e5e7eb;
    margin-bottom: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Formulaire de création - Debug JSON */
.json-preview {
    background-color: #0f172a;
    color: #e5e7eb;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    font-family: "Courier New", monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    max-height: 300px;
    overflow: auto;
}

/* Badges de statut (publié, brouillon, archivé) */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.status-published {
    background-color: #16a34a;
    color: #fff;
}
.status-draft {
    background-color: #f59e0b;
    color: #fff;
}
.status-archived {
    background-color: #4b5563;
    color: #fff;
}

/* Notifications flottantes (succès/erreur) */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 0.9rem 1.2rem;
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 1050;
}
.notification.show {
    opacity: 1;
    transform: translateY(0);
}
.notification-success {
    background-color: #16a34a;
}
.notification-error {
    background-color: #dc2626;
}
