﻿/* ═══════════════════════════════════════════════════════════════════
   HealthyDiab – Formulaire de contenu éducatif
   À référencer dans App.razor APRÈS le thème Syncfusion :
   <link rel="stylesheet" href="css/contenu-form.css" />
   ═══════════════════════════════════════════════════════════════════ */
:root {
    --cf-primary: #2E7D32;
    --cf-primary-dark: #1B5E20;
    --cf-primary-soft: #E8F5E9;
    --cf-bg: #F4F7F4;
    --cf-border: #E1E8E1;
    --cf-text: #1F2A1F;
    --cf-muted: #6B7A6B;
    --cf-danger: #C62828;
}

/* ── Fenêtre ─────────────────────────────────────────────────────── */
.cf-dialog.e-dialog {
    border-radius: 16px;
    overflow: hidden;
}

.cf-dialog .e-dlg-header-content {
    background: #fff;
    border-bottom: 1px solid var(--cf-border);
    padding: 16px 24px;
}

.cf-dialog .e-dlg-header {
    width: 100%;
    text-align: left;
    font-size: 18px;
    font-weight: 700;
    color: var(--cf-text);
}

.cf-dialog .e-dlg-content {
    background: var(--cf-bg);
    padding: 20px 24px;
}

.cf-dialog .e-footer-content {
    background: #fff;
    border-top: 1px solid var(--cf-border);
    padding: 14px 24px;
}

.cf-scroll {
    max-height: calc(100vh - 230px);
    overflow-y: auto;
    padding: 2px 6px 2px 2px;
}

.cf-body {
    display: grid;
    grid-template-columns: 450px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.cf-side, .cf-main, .cf-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 991px) {
    .cf-body {
        grid-template-columns: 1fr;
    }
}

/* ── Cartes ──────────────────────────────────────────────────────── */
.cf-card {
    background: #fff;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(16, 40, 16, .04);
}

.cf-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    /*margin: 0 0 16px;*/
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--cf-muted);
}

    .cf-card-title .material-icons {
        font-size: 18px;
        color: var(--cf-primary);
    }

.cf-hint {
    font-size: 12px;
    color: var(--cf-muted);
}

    .cf-hint.mb {
        margin: -8px 0 14px;
    }

.cf-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 20px;
    background: var(--cf-primary-soft);
    color: var(--cf-primary-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
}

/* ── Champs ──────────────────────────────────────────────────────── */
.cf-field {
    margin-bottom: 16px;
}

    .cf-field:last-child {
        margin-bottom: 0;
    }

.cf-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--cf-text);
}

    .cf-label .req {
        color: var(--cf-danger);
    }

.cf-input {
    width: 100%;
    height: 35px;
    padding: 0 14px;
    border: 1px solid #CBD5CB;
    border-radius: 5px;
    background: #fff;
    font-size: 14px;
    color: var(--cf-text);
    transition: border-color .15s, box-shadow .15s;
}

    .cf-input::placeholder {
        color: #9AA89A;
    }

    .cf-input:focus {
        outline: none;
        border-color: var(--cf-primary);
        box-shadow: 0 0 0 3px rgba(46, 125, 50, .15);
    }

.cf-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .cf-inline .cf-input {
        flex: 1;
        min-width: 0;
    }

.cf-inputwrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

    .cf-inputwrap .material-icons {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        color: var(--cf-muted);
        pointer-events: none;
    }

.cf-input-icon {
    padding-left: 42px;
}

.validation-message {
    margin-top: 4px;
    font-size: 12px;
    color: var(--cf-danger);
}

/* Listes déroulantes Syncfusion alignées sur les champs */
.cf-dialog .cf-field .e-input-group,
.cf-dialog .cf-field .e-input-group.e-control-wrapper {
    min-height: 44px;
    padding: 0 8px;
    border: 1px solid #CBD5CB;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
}

    .cf-dialog .cf-field .e-input-group::before,
    .cf-dialog .cf-field .e-input-group::after {
        display: none;
    }

    .cf-dialog .cf-field .e-input-group.e-input-focus {
        border-color: var(--cf-primary);
        box-shadow: 0 0 0 3px rgba(46, 125, 50, .15);
    }

    .cf-dialog .cf-field .e-input-group input.e-input {
        min-height: 42px;
        font-size: 14px;
        color: var(--cf-text);
    }

/* ── Statut de publication ───────────────────────────────────────── */
.cf-switch-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cf-switch-title {
    font-size: 14px;
    font-weight: 700;
}

    .cf-switch-title.ok {
        color: var(--cf-primary);
    }

    .cf-switch-title.draft {
        color: #EF6C00;
    }

.cf-lock {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--cf-muted);
}

    .cf-lock .material-icons {
        font-size: 18px;
    }

/* ── Onglets segmentés ───────────────────────────────────────────── */
.cf-tabs {
    display: inline-flex;
    align-self: flex-start;
    gap: 4px;
    padding: 4px;
    background: #E6EDE6;
    border-radius: 12px;
}

.cf-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--cf-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}

    .cf-tab .material-icons {
        font-size: 18px;
    }

    .cf-tab:hover {
        color: var(--cf-text);
    }

    .cf-tab.active {
        background: #6cd7d8;
        color: var(--cf-primary-dark);
        box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
        font-weight:bold;
    }

/* ── Zone de dépôt ───────────────────────────────────────────────── */
.cf-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 26px 20px;
    text-align: center;
    border: 2px dashed #BFD0BF;
    border-radius: 14px;
    background: #FAFCFA;
    transition: border-color .15s, background .15s;
}

    .cf-drop:hover {
        border-color: var(--cf-primary);
        background: var(--cf-primary-soft);
    }

    .cf-drop input[type="file"] {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }

.cf-drop-ico {
    font-size: 34px !important;
    color: var(--cf-primary);
}

.cf-drop-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--cf-text);
}

.cf-drop-sub {
    font-size: 12px;
    color: var(--cf-muted);
}

.cf-drop-sm {
    padding: 16px;
}

.cf-drop.busy {
    pointer-events: none;
    opacity: .75;
}

/* ── Couverture ──────────────────────────────────────────────────── */
.cf-cover {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.cf-cover-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cf-cover-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    background: #EEF2EE;
    color: #9AAA9A;
}

    .cf-cover-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .cf-cover-preview .material-icons {
        font-size: 36px;
    }

@media (max-width: 700px) {
    .cf-cover {
        grid-template-columns: 1fr;
    }
}

/* ── Galerie ─────────────────────────────────────────────────────── */
.cf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.cf-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    background: #EEF2EE;
}

    .cf-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.cf-order {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 9px;
    border-radius: 20px;
    background: rgba(0, 0, 0, .66);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.cf-cover-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 9px;
    border-radius: 20px;
    background: var(--cf-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.cf-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 18px 8px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .65));
    opacity: 0;
    transition: opacity .15s;
}

.cf-thumb:hover .cf-actions, .cf-thumb:focus-within .cf-actions {
    opacity: 1;
}

@media (hover: none) {
    .cf-actions {
        opacity: 1;
    }
}

.cf-ib {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #333;
    cursor: pointer;
}

    .cf-ib .material-icons {
        font-size: 18px;
    }

    .cf-ib:hover {
        background: var(--cf-primary-soft);
        color: var(--cf-primary-dark);
    }

    .cf-ib.danger:hover {
        background: #FDECEA;
        color: var(--cf-danger);
    }

    .cf-ib[disabled] {
        opacity: .4;
        cursor: default;
    }

.cf-ib-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #CBD5CB;
    border-radius: 10px;
    background: #fff;
    color: var(--cf-muted);
    cursor: pointer;
}

    .cf-ib-lg:hover {
        border-color: var(--cf-danger);
        color: var(--cf-danger);
        background: #FDECEA;
    }

/* ── Fichier PDF ─────────────────────────────────────────────────── */
.cf-file {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
}

.cf-file-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: #FDECEA;
    color: #C0392B;
}

.cf-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.cf-file-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
}

.cf-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--cf-primary-soft);
    color: var(--cf-primary-dark);
    font-size: 11px;
    font-weight: 700;
}

    .cf-chip .material-icons {
        font-size: 14px;
    }

/* ── Boutons, alerte, squelette ──────────────────────────────────── */
.cf-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.cf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

    .cf-btn .material-icons {
        font-size: 18px;
    }

.cf-btn-primary {
    background: #1b6ec2;
    color: #fff;
}

  /*  .cf-btn-primary:hover:not([disabled]) {
        background: var(--cf-primary-dark);
    }*/

    .cf-btn-primary[disabled] {
        opacity: .6;
        cursor: default;
    }

.cf-btn-ghost {
    background: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

  /*  .cf-btn-ghost:hover {
        background: #F1F5F1;
    }*/

.cf-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid #F5C6C6;
    border-radius: 12px;
    background: #FDECEA;
    color: #8E1B1B;
    font-size: 13px;
}

    .cf-alert ul {
        margin: 0;
        padding-left: 18px;
    }

.cf-skeleton {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 420px;
    border-radius: 10px;
    background: linear-gradient(90deg, #EEF2EE, #F8FBF8, #EEF2EE);
    background-size: 200% 100%;
    animation: cf-shimmer 1.2s infinite;
    color: var(--cf-muted);
    font-size: 13px;
}

@keyframes cf-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}



/* ── Consultation : informations ─────────────────────────────────── */
.cf-view-title {
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--cf-text);
}

.cf-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.cf-dl {
    margin: 0;
}

    .cf-dl > div {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid var(--cf-border);
        font-size: 13px;
    }

        .cf-dl > div:last-child {
            border-bottom: 0;
        }

    .cf-dl dt {
        margin: 0;
        font-weight: 600;
        color: var(--cf-muted);
    }

    .cf-dl dd {
        margin: 0;
        text-align: right;
        color: var(--cf-text);
    }

        .cf-dl dd.strong {
            font-weight: 700;
            color: var(--cf-primary);
        }

.cf-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.cf-tag {
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--cf-primary-soft);
    color: var(--cf-primary-dark);
    font-size: 12px;
    font-weight: 600;
}

/* ── Consultation : visionneuse d'images ─────────────────────────── */
.cf-viewer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #101810;
}

.cf-viewer-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cf-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(150 232 252 / 92%);
    color: var(--cf-text);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

    .cf-nav:hover {
        background: #fff;
    }

    .cf-nav.prev {
        left: 12px;
    }

    .cf-nav.next {
        right: 12px;
    }

.cf-viewer-count {
    position: absolute;
    right: 12px;
    bottom: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.cf-strip {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-bottom: 4px;
    overflow-x: auto;
}

.cf-strip-item {
    flex: 0 0 76px;
    height: 56px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #EEF2EE;
    opacity: .7;
    cursor: pointer;
    transition: opacity .15s, border-color .15s;
}

    .cf-strip-item:hover {
        opacity: 1;
    }

    .cf-strip-item.active {
        border-color: var(--cf-primary);
        opacity: 1;
    }

    .cf-strip-item img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* ── Consultation : PDF, texte, état vide ────────────────────────── */
.cf-pdf-frame {
    margin-top: 14px;
    overflow: hidden;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
}

.cf-prose {
    font-size: 15px;
    line-height: 1.7;
    color: var(--cf-text);
    overflow-wrap: anywhere;
}

    .cf-prose img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
    }

    .cf-prose h1, .cf-prose h2, .cf-prose h3 {
        margin: 1.1em 0 .5em;
        font-weight: 700;
        line-height: 1.3;
    }

    .cf-prose ul, .cf-prose ol {
        padding-left: 1.4em;
    }

.cf-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    text-align: center;
    color: var(--cf-muted);
    font-size: 14px;
}

    .cf-empty .material-icons {
        font-size: 40px;
        color: #B7C4B7;
    }

/* ── Suppression ─────────────────────────────────────────────────── */
.cf-confirm {
    max-width: 460px;
    margin: 8px auto;
    padding: 12px 0;
    text-align: center;
}

.cf-confirm-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #FDECEA;
    color: var(--cf-danger);
}

    .cf-confirm-ico .material-icons {
        font-size: 38px;
    }

.cf-confirm-title {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 700;
    color: var(--cf-text);
}

.cf-confirm-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding: 14px 16px;
    text-align: left;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    background: #fff;
}

.cf-confirm-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--cf-text);
}

.cf-confirm-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--cf-muted);
}

.cf-btn-danger {
    background: var(--cf-danger);
    color: #fff;
}

    .cf-btn-danger:hover:not([disabled]) {
        background: #B71C1C;
    }

    .cf-btn-danger[disabled] {
        opacity: .6;
        cursor: default;
    }

.cf-pdf-reader {
    max-height: 560px;
    overflow: auto;
    padding: 12px;
    text-align: center;
    background: #525659;
    user-select: none;
    -webkit-user-select: none;
}

    .cf-pdf-reader:empty::before {
        content: "Chargement du document…";
        color: #fff;
        font-size: 13px;
        line-height: 120px;
    }

.cf-pdf-page {
    display: block;
    max-width: 100%;
    margin: 0 auto 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

/* Le document n'est jamais imprimé depuis la page */
@media print {
    .cf-pdf-reader {
        display: none !important;
    }
}