﻿/* ========================== */
/* Backdrop modale scuro */
/* ========================== */
.modal-backdrop,
.modal-backdrop.modal-backdrop-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.7);
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

    .modal-backdrop.show,
    .modal-backdrop.modal-backdrop-fullscreen.show {
        opacity: 1;
    }

/* ========================== */
/* Blur sugli elementi dietro */
/* ========================== */
.modal-blur-element {
    filter: blur(6px) brightness(0.9);
    transition: filter 0.4s ease-in-out;
}

    /* Escludi SweetAlert2 e Toast dal blur */
    .modal-blur-element.swal2-container,
    .modal-blur-element.toast {
        filter: none !important;
    }

/* ========================== */
/* Modale normale */
.modal-normal .modal-dialog {
    width: 80vw;
    max-width: 95vw;
    margin: 2rem auto;
    border-radius: 6px;
    transform-origin: center center;
}

.modal-normal .modal-content {
    display: block;
    max-height: 90vh;
    overflow: hidden;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1), opacity 0.5s ease;
}

.modal-normal .modal-body {
    overflow-y: auto;
    padding: 1rem;
    max-height: 80vh;
}

/* ========================== */
/* Modale fullscreen */
.modal-fullscreen {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: block;
    background: white;
}

    .modal-fullscreen .modal-dialog {
        margin: 0 auto;
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .modal-fullscreen .modal-content {
        display: block;
        height: auto;
        border: 0;
        box-shadow: none;
    }

    .modal-fullscreen .modal-body {
        overflow-y: auto;
        padding: 1rem;
        max-height: calc(100vh - 80px);
    }

/* ========================== */
/* Close button */
.close i,
.modal-header .close i {
    font-size: 40px;
    color: red;
    opacity: 1 !important;
    cursor: pointer;
}

/* ========================== */
/* Animazione apertura modale */
.modal.fade .modal-dialog {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
}

.modal.show .modal-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), opacity 0.4s ease-in-out;
}
