/*
===============================================================================
[Painel] | 05 COMPONENTS MODAL - v1.0 - /src/static/css/05-components/modal.css
===============================================================================
*/

/* =============================================================================
   MODAIS - PAINEL
   =============================================================================
   Modais customizados: confirm, alert, toast
   ============================================================================= */

/* -------------------------------------------------------------------------
   ANIMACOES
   ------------------------------------------------------------------------- */
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes modalOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.95); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(16px); }
}

/* -------------------------------------------------------------------------
   OVERLAY
   ------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--spacing-4);
}

/* -------------------------------------------------------------------------
   CONTAINER
   ------------------------------------------------------------------------- */
.modal-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    animation: modalIn 200ms ease forwards;
}

.modal-container.closing {
    animation: modalOut 150ms ease forwards;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-4) var(--spacing-6);
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-6);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-3);
    padding: var(--spacing-4) var(--spacing-6);
    border-top: 1px solid var(--border-color);
}

/* -------------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .modal-container {
        max-width: 90%;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* -------------------------------------------------------------------------
   TOAST
   ------------------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: var(--spacing-6);
    right: var(--spacing-6);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    z-index: 2100;
    pointer-events: none;
}

.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-3) var(--spacing-4);
    min-width: 280px;
    max-width: 360px;
    pointer-events: auto;
    animation: toastIn 250ms ease forwards;
    overflow: hidden;
    position: relative;
}

.toast.closing {
    animation: toastOut 200ms ease forwards;
}

.toast-message {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    padding-right: var(--spacing-4);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: var(--color-primary);
    transition: width linear;
}

/* Variantes */
.toast-success { border-left: 4px solid var(--color-success); }
.toast-error   { border-left: 4px solid var(--color-error); }
.toast-warning { border-left: 4px solid var(--color-warning); }
.toast-info    { border-left: 4px solid var(--color-info); }

.toast-success .toast-progress { background-color: var(--color-success); }
.toast-error   .toast-progress { background-color: var(--color-error); }
.toast-warning .toast-progress { background-color: var(--color-warning); }
.toast-info    .toast-progress { background-color: var(--color-info); }

/*
===============================================================================
[Painel] | 05 COMPONENTS MODAL - v1.0 - /src/static/css/05-components/modal.css
===============================================================================
*/
