/*
 * #1500 — Système de modales unifié BySince
 * Harmonise tous les modals Bootstrap de la plateforme :
 *   - Backdrop flouté (verre dépoli)
 *   - Header sobre et accent latéral coloré
 *   - Bord radius doux + ombre profonde
 *   - Animation d'apparition
 */

/* ─── Backdrop flouté ───────────────────────────────────────────── */
.modal-backdrop.show {
    background-color: rgba(20, 33, 54, 0.45);
    opacity: 1 !important;
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
}

/* ─── Conteneur ─────────────────────────────────────────────────── */
.modal-content {
    border: none !important;
    border-radius: 14px !important;
    box-shadow:
        0 24px 48px -8px rgba(20, 33, 54, 0.28),
        0 8px 16px -4px rgba(20, 33, 54, 0.12);
    overflow: hidden;
    background-color: var(--bs-body-bg, #fff);
}

/* ─── Animation d'apparition ────────────────────────────────────── */
.modal.fade .modal-dialog {
    transform: translateY(-12px) scale(0.985);
    transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .2s ease-out;
}
.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

/* ─── Header par défaut : sobre + accent latéral primary ────────── */
.modal-header {
    padding: 1rem 1.5rem !important;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6) !important;
    background: linear-gradient(
        180deg,
        var(--bs-body-bg, #fff) 0%,
        var(--bs-tertiary-bg, #f8f9fa) 100%
    );
    position: relative;
    align-items: center;
}
/* Bande verticale colorée à gauche du header (signature visuelle BySince) */
.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(
        180deg,
        var(--bs-primary, #0d6efd) 0%,
        var(--bs-info, #0dcaf0) 100%
    );
}

.modal-title {
    font-weight: 600;
    color: var(--bs-emphasis-color, #212529);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.modal-title .material-symbols,
.modal-title .material-symbols-outlined {
    color: var(--bs-primary, #0d6efd);
    font-size: 1.4em;
    vertical-align: -3px;
}

/* ─── Variantes contextuelles : conserver le rendu si déjà coloré ─ */
/* Lorsque le dev a explicitement posé bg-danger / bg-success / etc.
   on garde la couleur de fond et on retire l'accent gauche pour
   éviter le double signal visuel. */
.modal-header.bg-primary,
.modal-header.bg-secondary,
.modal-header.bg-success,
.modal-header.bg-info,
.modal-header.bg-warning,
.modal-header.bg-danger,
.modal-header.bg-light,
.modal-header.bg-dark {
    background-image: none;
    border-bottom: none !important;
}
.modal-header.bg-primary::before,
.modal-header.bg-secondary::before,
.modal-header.bg-success::before,
.modal-header.bg-info::before,
.modal-header.bg-warning::before,
.modal-header.bg-danger::before,
.modal-header.bg-light::before,
.modal-header.bg-dark::before {
    display: none;
}
.modal-header.text-white .modal-title,
.modal-header.text-white .modal-title .material-symbols,
.modal-header.text-white .modal-title .material-symbols-outlined {
    color: #fff;
}

/* ─── Corps & footer ────────────────────────────────────────────── */
.modal-body {
    padding: 1.25rem 1.5rem;
}
.modal-footer {
    padding: .9rem 1.5rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

/* ─── Bouton fermer : zone de clic plus accessible ──────────────── */
.modal-header .btn-close {
    padding: .6rem;
    margin: -.5rem -.5rem -.5rem auto;
    opacity: .55;
    transition: opacity .15s ease;
}
.modal-header .btn-close:hover {
    opacity: 1;
}

/* ─── Variantes "soft" : accent latéral seulement, palette douce ─ */
.modal-content.modal-success .modal-header::before {
    background: var(--bs-success, #198754);
}
.modal-content.modal-success .modal-title .material-symbols,
.modal-content.modal-success .modal-title .material-symbols-outlined {
    color: var(--bs-success, #198754);
}

.modal-content.modal-danger .modal-header::before {
    background: var(--bs-danger, #dc3545);
}
.modal-content.modal-danger .modal-title .material-symbols,
.modal-content.modal-danger .modal-title .material-symbols-outlined {
    color: var(--bs-danger, #dc3545);
}

.modal-content.modal-warning .modal-header::before {
    background: var(--bs-warning, #ffc107);
}
.modal-content.modal-warning .modal-title .material-symbols,
.modal-content.modal-warning .modal-title .material-symbols-outlined {
    color: #b58100;
}

.modal-content.modal-info .modal-header::before {
    background: var(--bs-info, #0dcaf0);
}
.modal-content.modal-info .modal-title .material-symbols,
.modal-content.modal-info .modal-title .material-symbols-outlined {
    color: var(--bs-info, #0dcaf0);
}

/* ─── #1500 — Lignes "déjà partagé" dans la modale partage ──────── */
.list-group-item.bysince-share-already {
    background: var(--bs-info-bg-subtle, #cff4fc);
    border-color: var(--bs-info-border-subtle, #9eeaf9);
    cursor: not-allowed;
}
.list-group-item.bysince-share-already strong {
    color: var(--bs-info-text-emphasis, #055160);
}

/* ─── Mode imprimé : neutraliser les effets ─────────────────────── */
@media print {
    .modal-content { box-shadow: none !important; }
    .modal-backdrop.show { backdrop-filter: none !important; }
}
