/* style.css */

.mentions-legales-settings-page {
    font-family: "Rubik", sans-serif;

    text-align: center;

    padding: 20px;

    border-radius: 8px;
}

.table-shortcodes tr {
    text-align: left;
}

.mentions-legales-settings-page h1,
.mentions-legales-settings-page h2 {
    background: #36304a;

    color: #ffffff !important;

    padding: 15px 20px !important;

    text-align: left;
}

.th-infos {
    background: #a594f9;

    color: #ffffff !important;

    padding: 10px;

    padding: 10px 20px !important;

    width: 20% !important;

    font-weight: 500 !important;

    height: 40px;
}

.thh {
    background: #a594f9;

    color: #ffffff !important;

    padding: 10px;

    padding: 10px 20px !important;

    width: 20% !important;
}

.td-shortcode {
    width: 45%;
}

.mentions-legales-settings-page input[type="text"],
textarea.large-text {
    width: 80%;

    padding: 10px 10px;

    margin: 5px 0;

    border: none;

    box-shadow: 0px 0px 7px 0px rgba(0, 0, 0, 0.1);
}

.mentions-legales-settings-page textarea.large-text,
.mentions-legales-settings-page input[type="text"] {
    color: #717171;
    /* Change the text color to red */
}

.mentions-legales-settings-page ul {
    list-style-type: none;

    padding: 0;
}

.mentions-legales-settings-page li {
    margin: 10px 0;
}

.mentions .button-primary {
    background: #624e88 !important;

    color: #ffffff;

    padding: 15px 60px;

    border: none !important;

    border-radius: 0;
}

.form-table th {
    font-weight: 500 !important;

    padding: 12px 10px 12px 20px !important;
}

.form-table td {
    margin-bottom: 0px !important;

    padding: 0px 0px !important;

    line-height: 1.3 !important;

    vertical-align: middle !important;
}

/* Cellule de la checkbox "Utilisation d'images IA".
   Le wrapper .mentions-legales-settings-page applique text-align:center qui
   est OK pour les inputs (cadrés par width:80%), mais qui décale visuellement
   le label de la checkbox dans le <td colspan="3"> très large. On force
   l'alignement à gauche pour que la checkbox démarre au même X que les
   inputs des autres rangées. */
.mentions-legales-settings-page .form-table td.mls-ia-images-cell {
    text-align: left !important;
    padding-left: 3rem !important;
}

.mentions-legales-settings-page .mls-ia-images-cell label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    line-height: 1.4;
}

.mentions-legales-settings-page .mls-ia-images-cell input[type="checkbox"] {
    margin: 0;
}

body .pg-mp-titre-h1-bg {
    margin-bottom: 20px;
    margin-top: 20px;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

.table-shortcodes {
    border-collapse: collapse;

    width: 100%;

    border-radius: 30px;

    box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1);

    background-color: white;
}

.td-shortcode,
.table-th {
    border: 1px solid #ddd !important;

    padding: 8px !important;
}

.tr-table:nth-child(even) {
    background-color: #f2f2f2 !important;
}

.tr-table:hover {
    background-color: #e7e7e7 !important;
}

.table-th {
    font-weight: 500 !important;

    padding-top: 12px !important;

    padding-bottom: 12px !important;

    text-align: left !important;
}

.form-table th {
    vertical-align: middle !important;
}

.mentions-legales-settings-page form {
    margin: 20px 0px;

    padding: 30px 50px;

    border-radius: 30px;

    box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1);

    background-color: white;
}

.span-infos {
    line-height: 35px;
}

h1.center.pg-mp-titre-h1.fusion-responsive-typography-calculated {
    margin-bottom: -12px !important;

    font-size: 30px !important;
}

@media screen and (max-width: 768px) {
    .thh {
        background: #009fff;

        color: #ffffff !important;

        padding: 10px;

        padding: 10px 20px !important;

        width: 95% !important;

        border-radius: 20px;
    }

    .form-table th {
        margin-top: 20px;
    }
}


@media (min-width: 0px) {
    .container {
        width: auto !important;
    }
}

/* ===========================
   Sections supplémentaires (admin) — palette violette, cohérente avec
   le bloc Coordonnées Client
   =========================== */

.mentions-legales-settings-page .mls-block {
    margin-top: 40px;
    background: #ffffff;
    overflow: hidden;
    text-align: left;
    border-radius: 2px;
}

.mentions-legales-settings-page .mls-block-header {
    background: #a594f9;
    padding: 0px;
    position: relative;
    color: #ffffff;
}

/* Override de la règle générique .mentions-legales-settings-page h2 */
.mentions-legales-settings-page .mls-block-header .mls-block-title {
    background: transparent !important;
    color: #ffffff !important;
    padding: 12px 10px 12px 20px !important;
    margin: 0 !important;
    font-size: 14px !important;
    letter-spacing: 0.2px;
    text-align: left;
    font-weight: 500 !important;
    line-height: 1.3;
}

/* Conteneur de la liste */
.mentions-legales-settings-page #mls-sections-list {
    padding: 24px 24px 20px 24px;
}

.mentions-legales-settings-page #mls-sections-list .wp-switch-editor:focus, .mentions-legales-settings-page #mls-sections-list input:focus, .mentions-legales-settings-page #mls-sections-list textarea:focus {
    box-shadow: none !important;
}

.mentions-legales-settings-page #mls-sections-list .mce-btn.mce-active i, .mentions-legales-settings-page #mls-sections-list .mce-btn.mce-active:hover i {
    color: #50575e;
}

.mentions-legales-settings-page #mls-sections-list .mce-toolbar .mce-btn-group .mce-btn:hover {
    box-shadow: none !important;
    border-color: #50575e;
}

.mentions-legales-settings-page .wp-core-ui .button {
    color: #50575e;
    border-color: #50575e;
}

.mentions-legales-settings-page .quicktags-toolbar {
    padding: 12px 5px 10px 14px;
}

/* État vide */
.mentions-legales-settings-page .mls-empty-state {
    text-align: center;
    padding: 30px 20px;
    background: #a594f90a;
    border: 2px dashed #a594f9a3;
    border-radius: 10px;
    color: #a594f9;
}

.mentions-legales-settings-page .mls-empty-title {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #a594f9;
}

.mentions-legales-settings-page .mls-empty-text {
    margin: 0;
    font-size: 13px;
    color: #5b7a76;
}

/* Carte d'une section (en mode accordéon pliable) */
.mentions-legales-settings-page .mls-section-row {
    position: relative;
    background: #ffffff;
    padding: 0;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #a594f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px -2px rgba(15, 118, 110, 0.10);
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.mentions-legales-settings-page .mls-section-row:hover {
    box-shadow: 0 6px 16px -4px #a594f917;
    border-left-color: #a594f9;
}

.mentions-legales-settings-page .mls-section-row.mls-collapsed {
    box-shadow: 0 1px 3px -1px rgba(15, 118, 110, 0.08);
}

/* En-tête de la section (toujours visible) */
.mentions-legales-settings-page .mls-section-head {
    display: flex;
    align-items: stretch;
    background: #fbfbfd;
}

.mentions-legales-settings-page .mls-section-row:not(.mls-collapsed) .mls-section-head {
    border-bottom: 1px solid #a594f942;
    background-color: #a594f917;
}

/* Bouton qui couvre toute la zone cliquable du header (sauf le X) */
.mentions-legales-settings-page .mls-section-toggle {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: #0f172a;
    transition: background 0.15s ease;
    min-width: 0;
}

.mentions-legales-settings-page .mls-section-toggle:hover {
    background: #a594f917;
}

.mentions-legales-settings-page .mls-section-toggle:focus {
    outline: none;
}

/* Chevron CSS (pas d'image) */
.mentions-legales-settings-page .mls-section-chevron {
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-right: 2px solid #a594f9;
    border-bottom: 2px solid #a594f9;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    margin-right: 4px;
}

.mentions-legales-settings-page .mls-section-row:not(.mls-collapsed) .mls-section-chevron {
    transform: rotate(45deg);
}

/* Aperçu du titre (live) */
.mentions-legales-settings-page .mls-section-preview {
    flex: 1 1 auto;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Bouton X de suppression */
.mentions-legales-settings-page .mls-section-head .mls-remove-section {
    flex: 0 0 auto;
    background: transparent !important;
    color: #b91c1c !important;
    border: none !important;
    border-left: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    padding: 0 18px !important;
    font-size: 22px !important;
    line-height: 1 !important;
    height: auto !important;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    box-shadow: none !important;
}

.mentions-legales-settings-page .mls-section-head .mls-remove-section:hover {
    background: #fef2f2 !important;
    color: #7f1d1d !important;
}

.mentions-legales-settings-page .mls-section-row:not(.mls-collapsed) .mls-remove-section {
    border-left-color: #cffafe !important;
}

/* Corps de la section (champs + éditeur) */
.mentions-legales-settings-page .mls-section-body {
    padding: 18px 22px 16px;
    background: #ffffff;
}

.mentions-legales-settings-page .mls-section-row.mls-collapsed .mls-section-body {
    display: none;
}

.mentions-legales-settings-page .mls-section-body .mls-section-label {
    display: block;
    margin: 0 0 6px 0;
    font-weight: 500;
    color: #1d2327;
    font-size: 14px;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.mentions-legales-settings-page .mls-section-body .mls-section-title {
    width: 100% !important;
    margin: 0 0 16px 0 !important;
    padding: 11px 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    font-size: 14px;
    color: #0f172a !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mentions-legales-settings-page .mls-section-body .mls-section-title:focus {
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18) !important;
    outline: none !important;
}

.mentions-legales-settings-page .mls-section-body .wp-editor-wrap {
    margin-bottom: 4px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.mentions-legales-settings-page .mls-section-body .wp-editor-container {
    border: none;
}

/* Textarea visible avant init TinyMCE (état "data-editor-pending") */
.mentions-legales-settings-page .mls-section-body textarea.mls-section-content {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 12px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    min-height: 160px;
}

/* Bouton « Ajouter une section » — violet pour matcher le header */
.mentions-legales-settings-page .mls-add-section-wrap {
    padding: 4px 24px 22px;
    text-align: right;
}

.mentions-legales-settings-page #mls-add-section {
    background: #624e88 !important;
    color: #ffffff !important;
    padding: 10px 22px !important;
    border: none !important;
    border-radius: 6px !important;
    height: auto !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    cursor: pointer;
    box-shadow: 0 4px 10px -2px rgba(15, 118, 110, 0.35);
    transition: transform 0.12s ease, box-shadow 0.18s ease;
    text-shadow: none !important;
}

.mentions-legales-settings-page #mls-add-section:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -2px #624e8838;
}

.mentions-legales-settings-page #mls-add-section:active {
    transform: translateY(0);
}

/* Responsive */
@media screen and (max-width: 768px) {
    .mentions-legales-settings-page #mls-sections-list,
    .mentions-legales-settings-page .mls-add-section-wrap {
        padding-left: 14px;
        padding-right: 14px;
    }
    .mentions-legales-settings-page .mls-section-toggle {
        padding: 10px 12px;
        gap: 8px;
        font-size: 13px;
    }
    .mentions-legales-settings-page .mls-section-head .mls-remove-section {
        padding: 0 14px !important;
        font-size: 20px !important;
    }
    .mentions-legales-settings-page .mls-section-body {
        padding: 14px 14px 12px;
    }
}

/* ===========================
   Mini-modale de confirmation (suppression de section)
   Remplace window.confirm pour avoir des boutons en français
   (« Annuler » / « Supprimer ») et un design cohérent avec l'admin.
   =========================== */

.mls-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mlsModalFade 0.15s ease;
}

@keyframes mlsModalFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.mls-modal {
    background: #ffffff;
    border-radius: 10px;
    width: 92%;
    max-width: 480px;
    padding: 26px 28px 22px;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.4);
    animation: mlsModalPop 0.18s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@keyframes mlsModalPop {
    from { transform: translateY(-8px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.mls-modal-title {
    font-size: 17px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 10px;
    line-height: 1.3;
}

.mls-modal-body {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 24px;
}

.mls-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.mls-modal-cancel,
.mls-modal-confirm {
    border: none;
    border-radius: 6px;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.mls-modal-cancel {
    background: #f1f5f9;
    color: #334155;
}

.mls-modal-cancel:hover {
    background: #e2e8f0;
}

.mls-modal-confirm {
    background: #0f766e;
    color: #ffffff;
}

.mls-modal-confirm:hover {
    background: #115e59;
}

.mls-modal-confirm--danger {
    background: #dc2626;
    color: #ffffff;
}

.mls-modal-confirm--danger:hover {
    background: #b91c1c;
}

.mls-modal-cancel:focus-visible,
.mls-modal-confirm:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

@media screen and (max-width: 480px) {
    .mls-modal {
        padding: 22px 20px 18px;
    }
    .mls-modal-actions {
        flex-direction: column-reverse;
    }
    .mls-modal-cancel,
    .mls-modal-confirm {
        width: 100%;
    }
}
