/* =============================================================================
   AMÉLIORATIONS ADMINISTRATION — à charger APRÈS style.css
   Ce fichier ne modifie aucune règle existante : il ajoute uniquement les
   styles des éléments nouveaux (bandeau de message, indicateur de
   modification, bouton menu mobile). Rien dans style.css n'a besoin
   d'être touché.
   ============================================================================= */

/* --- Bandeau de message (remplace l'ancienne .message-erreur muette) --- */
.admin-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e6f4ea;
    border: 1px solid #b7dfc4;
    color: #1e6b34;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 16px 24px 0;
    font-weight: 600;
    font-size: 0.95rem;
    animation: adminToastIn 0.3s ease;
}
.admin-toast i:first-child { font-size: 1.1rem; }
.admin-toast span { flex: 1; }
.admin-toast__close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: opacity 0.2s, background-color 0.2s;
}
.admin-toast__close:hover { opacity: 1; background: rgba(0,0,0,0.06); }

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

.admin-toast--out {
    animation: adminToastOut 0.3s ease forwards;
}

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

/* --- Indicateur de modifications non enregistrées --- */
.unsaved-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #997404;
    margin: 0;
    animation: adminToastIn 0.25s ease;
}
.unsaved-indicator i { font-size: 0.85rem; }

/* --- Bouton d'ouverture du menu mobile (header) --- */
.header-btn-menu {
    background-color: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.25);
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
}
.header-btn-menu:hover {
    background-color: rgba(255,255,255,0.22);
    transform: scale(1.05);
}
.header-btn-menu i { font-size: 1.2rem; }

/* --- Overlay derrière la sidebar ouverte sur mobile --- */
@media (max-width: 767.98px) {
    #sidebarMenu.show::after {
        content: "";
    }
    body:has(#sidebarMenu.show)::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1025;
    }
}

/* --- Champs d'upload de photo : zone glisser-déposer + aperçu instantané ---
   Ajouté automatiquement en JS autour de chaque <input type="file"> existant,
   aucun changement de nom de champ ni de comportement d'envoi du formulaire. */
.file-drop {
    position: relative;
    border: 2px dashed #ced4da;
    border-radius: 10px;
    padding: 10px 12px;
    background-color: #f8f9fa;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.file-drop--active {
    border-color: #0d6efd;
    background-color: #eaf2ff;
}
.file-drop input[type="file"] {
    border: none;
    background: transparent;
    padding: 4px 0;
}
.file-drop input[type="file"]:focus {
    box-shadow: none;
}
.file-drop__preview {
    margin-top: 8px;
}
.file-drop__preview-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 4px;
}
.file-drop__preview img {
    max-width: 120px;
    max-height: 120px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    object-fit: cover;
}

/* --- Page de connexion --- */
.login-screen {
    /* min-height: calc(100dvh - 76px); */
    min-height: calc(85dvh - 76px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 15% 20%, rgba(34, 197, 94, 0.08), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(31, 41, 51, 0.06), transparent 45%);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border-radius: 18px;
    padding: 28px 30px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(17, 24, 39, 0.12);
    border: 1px solid #eef0f2;
    animation: adminToastIn 0.35s ease;
}

.login-card__badge {
    width: 50px;
    height: 50px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 10px 22px rgba(34, 197, 94, 0.35);
}

.login-card__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
}

.login-card__subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 18px;
}

.login-card .input-group-text {
    background-color: #f8f9fa;
    border-color: #d1d5db;
    color: #6c757d;
}

.login-card .form-control {
    border-color: #d1d5db;
    padding: 10px 12px;
}

.login-card .form-control:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    z-index: 3;
}

.login-card__submit {
    width: 100%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.3);
    transition: all 0.2s ease;
}

.login-card__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.4);
}

.login-card__forgot {
    font-size: 0.82rem;
    color: #6b7280;
    text-decoration: none;
}

.login-card__forgot:hover {
    color: #22c55e;
    text-decoration: underline;
}

/* --- Bouton "remonter en haut" (onglets longs) --- */
.back-to-top-admin {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 900;
    box-sizing: border-box;
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.9);
    transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out, visibility 0.25s, box-shadow 0.25s ease-in-out;
}
.back-to-top-admin.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.back-to-top-admin:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 26px rgba(34, 197, 94, 0.5);
    color: #fff;
}
.back-to-top-admin i {
    font-size: 1.15rem;
}

/* --- Lien de suppression d'un fichier (icône Bootstrap, remplace l'ancien .gif) --- */
.js-confirm-delete {
    color: #dc3545;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease, transform 0.2s ease;
}
.js-confirm-delete:hover {
    color: #a71d2a;
    transform: scale(1.1);
}
