﻿/*4.5 toast - Versão Moderna*/

/* Containers */
.toast-container-body {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    color: #f6412a;
    gap: 12px;
}

    .toast-container-body .toast {
        pointer-events: auto;
    }

.toast-container-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    color: #f6412a;
    gap: 12px;
}

    .toast-container-modal .toast {
        pointer-events: auto;
    }

.toast-container-sidebar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    color: #f6412a;
    gap: 12px;
}

    .toast-container-sidebar .toast {
        pointer-events: auto;
    }

/* Toast Principal - Design Moderno */
.toast {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    min-width: 340px;
    max-width: 420px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    /* Barra de progresso animada */
    .toast::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        height: 3px;
        background: linear-gradient(90deg, #6c757d, #495057);
        border-radius: 0 0 16px 16px;
        animation: toastProgress 5s linear;
        width: 100%;
    }

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Hover effects */
.toast:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
}

    .toast:hover::before {
        animation-play-state: paused;
    }

/* Toast Body personalizado */
.toast .toast-body {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    position: relative;
}

    /* Ícones para cada tipo */
    .toast .toast-body::before {
        content: '';
        width: 28px;
        height: 28px;
        border-radius: 50%;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 16px;
        color: white;
        text-align: center;
        line-height: 28px;
    }

/* Toast de Sucesso */
.toast-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
}

    .toast-success::before {
        background: linear-gradient(135deg, #10b981, #059669);
    }

    .toast-success .toast-body::before {
        content: '✓';
        background: linear-gradient(135deg, #10b981, #059669);
    }

    .toast-success .toast-body {
        color: #047857;
    }

/* Toast de Erro */
.toast-error {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

    .toast-error::before {
        background: linear-gradient(135deg, #ef4444, #dc2626);
    }

    .toast-error .toast-body::before {
        content: '✕';
        background: linear-gradient(135deg, #ef4444, #dc2626);
        font-size: 14px;
    }

    .toast-error .toast-body {
        color: #dc2626;
    }

/* Toast de Aviso/Warning */
.toast-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

    .toast-warning::before {
        background: linear-gradient(135deg, #f59e0b, #d97706);
    }

    .toast-warning .toast-body::before {
        content: '!';
        background: linear-gradient(135deg, #f59e0b, #d97706);
        font-weight: 900;
    }

    .toast-warning .toast-body {
        color: #d97706;
    }

/* Botão de fechar moderno */
.toast .btn-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    opacity: 0.6;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

    .toast .btn-close:hover {
        background: rgba(0, 0, 0, 0.1);
        opacity: 1;
        transform: scale(1.1);
    }

    .toast .btn-close:focus {
        box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    }

/* Animações de entrada do Bootstrap melhoradas */
.toast.showing {
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.hide {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .toast-container-body,
    .toast-container-modal,
    .toast-container-sidebar {
        top: 10px;
        right: 10px;
        left: 10px;
        align-items: stretch;
    }

    .toast {
        min-width: unset;
        max-width: unset;
        width: 100%;
        border-radius: 12px;
    }

        .toast .toast-body {
            padding: 16px;
            font-size: 13px;
        }

            .toast .toast-body::before {
                width: 24px;
                height: 24px;
                font-size: 14px;
                line-height: 24px;
            }
}

/* Modo escuro */
@media (prefers-color-scheme: dark) {
    .toast {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
        color: #f3f4f6;
    }

    .toast-success {
        background: linear-gradient(135deg, #064e3b 0%, #1f2937 100%);
    }

        .toast-success .toast-body {
            color: #34d399;
        }

    .toast-error {
        background: linear-gradient(135deg, #7f1d1d 0%, #1f2937 100%);
    }

        .toast-error .toast-body {
            color: #f87171;
        }

    .toast-warning {
        background: linear-gradient(135deg, #78350f 0%, #1f2937 100%);
    }

        .toast-warning .toast-body {
            color: #fbbf24;
        }

    .toast .btn-close {
        background: rgba(255, 255, 255, 0.1);
        color: #f3f4f6;
    }

        .toast .btn-close:hover {
            background: rgba(255, 255, 255, 0.2);
        }
}

/* Efeito de glassmorphism para navegadores compatíveis */
@supports (backdrop-filter: blur(10px)) {
    .toast {
        backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.9);
    }

    .toast-success {
        background: rgba(236, 253, 245, 0.9);
    }

    .toast-error {
        background: rgba(254, 242, 242, 0.9);
    }

    .toast-warning {
        background: rgba(255, 251, 235, 0.9);
    }
}
