﻿

/* ==========================================================================
   TOASTS - MODERN SOFT UI
   - centralizado no topo
   - sem linha lateral
   - fundo suave
   - bolhas decorativas na esquerda
   - ícone em círculo branco
   - animação entrando de cima e saindo para cima
   ========================================================================== */

.toast-master-container {
    position: fixed !important;
    top: 22px;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 1095;
    width: 470px;
    max-width: calc(100dvw - 28px);
    pointer-events: none;
    overflow: visible;
}

    .toast-master-container .toast {
        pointer-events: auto;
        max-width: 100%;
    }

.modern-toast {
    position: relative;
    display: grid;
    grid-template-columns: 72px 1fr 34px;
    align-items: center;
    gap: 12px;
    width: 100% !important;
    min-height: 104px;
    padding: 12px;
    border: 0 !important;
    border-radius: 20px !important;
    overflow: hidden;
    background: var(--toast-bg);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .07) !important;
    color: #0f172a !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

    .modern-toast > * {
        position: relative;
        z-index: 2;
    }

    /* Bolhas decorativas */
    .modern-toast::before,
    .modern-toast::after {
        content: "";
        position: absolute;
        z-index: 1;
        border-radius: 999px;
        pointer-events: none;
    }

    .modern-toast::before {
        width: 152px;
        height: 152px;
        left: -72px;
        top: -52px;
        background: var(--toast-blob-1);
        opacity: .9;
    }

    .modern-toast::after {
        width: 92px;
        height: 92px;
        left: -14px;
        bottom: -48px;
        background: var(--toast-blob-2);
        opacity: .85;
    }

    .modern-toast .toast-icon-wrap,
    .toast-icon-wrap {
        position: relative;
        width: 56px;
        height: 56px;
        min-width: 56px;
        border-radius: 999px;
        display: grid;
        place-items: center;
        background: #ffffff;
        color: var(--toast-accent);
        font-size: 28px;
        box-shadow: 0 6px 16px rgba(15, 23, 42, .10);
        margin-left: 4px;
    }

        .modern-toast .toast-icon-wrap::after,
        .toast-icon-wrap::after {
            content: "";
            position: absolute;
            width: 28px;
            height: 28px;
            right: -14px;
            bottom: -12px;
            border-radius: 999px;
            background: var(--toast-blob-2);
            opacity: .95;
            z-index: -1;
        }

    .modern-toast .toast-content-wrap,
    .toast-content-wrap {
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .modern-toast .toast-header {
        padding: 0 !important;
        margin: 0 0 4px 0 !important;
        border: 0 !important;
        background: transparent !important;
        display: flex;
        align-items: center;
        min-height: auto;
        color: inherit;
    }

        .modern-toast .toast-header strong {
            color: #111827;
            font-size: 18px !important;
            font-weight: 600 !important;
            letter-spacing: -.01em;
            line-height: 1.2;
        }

    .modern-toast .toast-body {
        padding: 0 !important;
        margin: 0 !important;
        color: rgba(17, 24, 39, .78);
        font-size: 14px;
        line-height: 1.45;
        font-weight: 500;
    }

    .modern-toast .btn-close {
        width: 28px;
        height: 28px;
        min-width: 28px;
        padding: 0;
        margin: 0;
        border-radius: 999px;
        background-size: 11px;
        opacity: .38;
        box-shadow: none;
        align-self: start;
        filter: none !important;
        transition: opacity .18s ease, transform .18s ease, background-color .18s ease;
    }

        .modern-toast .btn-close:hover {
            opacity: .72;
            transform: scale(1.04);
            background-color: rgba(15, 23, 42, .05);
        }

    .modern-toast details {
        margin-top: 10px;
    }

        .modern-toast details summary {
            cursor: pointer;
            font-weight: 700;
            color: #334155;
        }

        .modern-toast details pre {
            margin-bottom: 0;
            max-height: 180px;
            overflow: auto;
            font-size: 12px;
            color: #334155;
            border: 1px solid rgba(15, 23, 42, .08);
            background: rgba(255, 255, 255, .55) !important;
        }

    /* ==========================================================================
   TEMAS
   ========================================================================== */

    .modern-toast.theme-success {
        --toast-bg: #cfeccf;
        --toast-accent: #47a86d;
        --toast-blob-1: #9ad9b3;
        --toast-blob-2: #b9e8c8;
    }

    .modern-toast.theme-danger {
        --toast-bg: #efc5cd;
        --toast-accent: #c1273d;
        --toast-blob-1: #e5a8b3;
        --toast-blob-2: #efb7c1;
    }

    .modern-toast.theme-warning {
        --toast-bg: #f5dfb8;
        --toast-accent: #d07a11;
        --toast-blob-1: #efd19a;
        --toast-blob-2: #f3dba8;
    }

    .modern-toast.theme-info {
        --toast-bg: #c8e4f6;
        --toast-accent: #267cb5;
        --toast-blob-1: #a8d4ef;
        --toast-blob-2: #b8def3;
    }

    /* ==========================================================================
   ANIMAÇÕES
   ========================================================================== */

    .animateLateralToast,
    .animateTopToast,
    .modern-toast.show {
        animation: skaToastInDown .58s cubic-bezier(.16, 1, .3, 1) both;
    }

    .modern-toast.ska-toast-out {
        animation: skaToastOutUp .28s cubic-bezier(.4, 0, 1, 1) both !important;
    }

@keyframes skaToastInDown {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes skaToastOutUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-18px) scale(.97);
    }
}

/*.icon-bounce {
    animation: skaToastIconPop .48s cubic-bezier(.22, 1, .36, 1) .05s both;
}*/

@keyframes skaToastIconPop {
    0% {
        transform: scale(.7);
        opacity: 0;
    }

    70% {
        transform: scale(1.08);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* ==========================================================================
   MODAL DE CONFIRMAÇÃO
   ========================================================================== */

.confirm-toast-modal .modal-dialog {
    max-width: 560px;
}

.confirm-toast-modal .modal-content {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 28px;
}

.confirm-toast-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 28px;
    border: 0 !important;
    background: #cfeccf;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .20), 0 2px 8px rgba(15, 23, 42, .08);
}

    .confirm-toast-card::before,
    .confirm-toast-card::after {
        content: "";
        position: absolute;
        border-radius: 999px;
        pointer-events: none;
    }

    .confirm-toast-card::before {
        width: 170px;
        height: 170px;
        left: -78px;
        top: -72px;
        background: #9ad9b3;
        opacity: .9;
    }

    .confirm-toast-card::after {
        width: 95px;
        height: 95px;
        left: -10px;
        bottom: -50px;
        background: #b9e8c8;
        opacity: .9;
    }

    .confirm-toast-card > * {
        position: relative;
        z-index: 2;
    }

.confirm-toast-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, .06);
    color: #64748b;
    display: grid;
    place-items: center;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

    .confirm-toast-close:hover {
        background: rgba(15, 23, 42, .10);
        color: #0f172a;
        transform: scale(1.04);
    }

.confirm-toast-head {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 16px;
    align-items: start;
    padding-right: 34px;
}

.confirm-toast-icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #47a86d;
    font-size: 28px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .10);
}

.confirm-toast-title-wrap {
    min-width: 0;
}

.confirm-toast-title {
    margin: 2px 0 8px 0;
    color: #111827;
    font-size: 22px;
    font-weight: 850;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.confirm-toast-subtitle {
    color: rgba(17, 24, 39, .78);
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
}

    .confirm-toast-subtitle strong {
        color: #111827;
        font-weight: 800;
    }

.confirm-toast-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 0;
}

.btn-confirm-secondary,
.btn-confirm-primary {
    min-height: 38px;
    border-radius: 999px !important;
    padding: 8px 16px !important;
    font-size: 13px;
    font-weight: 800;
    border: 1px solid transparent !important;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.btn-confirm-secondary {
    background: rgba(255, 255, 255, .7) !important;
    color: #334155 !important;
}

    .btn-confirm-secondary:hover {
        background: rgba(255, 255, 255, .95) !important;
        color: #0f172a !important;
        transform: translateY(-1px);
    }

.btn-confirm-primary {
    background: #47a86d !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(71, 168, 109, .25);
}

    .btn-confirm-primary:hover {
        background: #3c915f !important;
        color: #fff !important;
        transform: translateY(-1px);
    }

/* Mantém compatibilidade com botões antigos, caso alguma tela ainda use */
.btn-flat-success {
    background: #47a86d !important;
    color: #fff !important;
    border: 0 !important;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(71, 168, 109, .25);
}

.btn-flat-gray {
    background: rgba(255, 255, 255, .7) !important;
    color: #334155 !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 999px;
}

    .btn-flat-success:hover,
    .btn-flat-gray:hover {
        transform: translateY(-1px);
    }

/* Compatibilidade com temas antigos do modal */
.confirm-theme-success,
.confirm-theme-info,
.confirm-theme-warning,
.confirm-theme-danger {
    border-color: transparent !important;
}

    .confirm-theme-success .confirm-toast-icon {
        color: #47a86d;
    }

    .confirm-theme-info .confirm-toast-icon {
        color: #267cb5;
    }

    .confirm-theme-warning .confirm-toast-icon {
        color: #d07a11;
    }

    .confirm-theme-danger .confirm-toast-icon {
        color: #c1273d;
    }

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */

@media (max-width: 576px) {
    .toast-master-container {
        top: 12px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: calc(100dvw - 24px) !important;
        max-width: 360px !important;
        gap: 20px !important;
        z-index: 1200;
    }

    .modern-toast {
        width: 100% !important;
        max-width: 100% !important;
        grid-template-columns: 65px 1fr 26px;
        min-height: auto;
        padding: 14px 12px;
        gap: 10px;
        border-radius: 18px !important;
    }

        .modern-toast .toast-icon-wrap,
        .toast-icon-wrap {
            width: 44px;
            height: 44px;
            min-width: 44px;
            font-size: 21px;
            margin-left: 0;
        }

        .modern-toast .toast-header strong {
            font-size: 14px !important;
        }

        .modern-toast .toast-body {
            font-size: 13px;
            line-height: 1.35;
        }

        .modern-toast .btn-close {
            width: 26px;
            height: 26px;
            min-width: 26px;
        }

    .confirm-toast-card {
        padding: 24px 20px;
        border-radius: 24px;
    }

    .confirm-toast-head {
        grid-template-columns: 52px 1fr;
        gap: 14px;
        padding-right: 28px;
    }

    .confirm-toast-icon {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .confirm-toast-title {
        font-size: 19px;
    }

    .confirm-toast-actions {
        flex-direction: column-reverse;
    }

    .btn-confirm-secondary,
    .btn-confirm-primary,
    .btn-flat-success,
    .btn-flat-gray {
        width: 100%;
    }
}