/* Toast Component - Sistema de notificações personalizado usando Toastify */

/* Customização do Toastify para combinar com o design do app */
.toastify {
    padding: 16px 20px;
    border-radius: 12px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
    min-width: 320px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid currentColor;
    backdrop-filter: blur(10px);
    z-index: 99999 !important; /* Acima de modais do Bootstrap (1050-1060) */
}

.toastify-right {
    right: 20px;
}

.toastify-top {
    top: 20px;
}

/* Variantes de cores para Toastify */
.toastify.toast-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left-color: #28a745;
}

.toastify.toast-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left-color: #dc3545;
}

.toastify.toast-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-left-color: #ffc107;
}

.toastify.toast-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* Ícone do toast */
.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: #28a745;
    color: white;
}

.toast-error .toast-icon {
    background: #dc3545;
    color: white;
}

.toast-warning .toast-icon {
    background: #ffc107;
    color: #856404;
}

.toast-info .toast-icon {
    background: #17a2b8;
    color: white;
}

/* Conteúdo do toast */
.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 700;
    font-size: 15px;
    margin: 0;
    line-height: 1.3;
}

.toast-message {
    font-weight: 400;
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
    opacity: 0.9;
}

/* Botão de fechar customizado */
.toastify-close {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.toastify-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

/* Responsivo */
@media (max-width: 768px) {
    .toastify {
        min-width: unset;
        max-width: calc(100vw - 40px);
        margin: 0 10px;
    }

    .toastify-right {
        right: 10px;
    }

    .toastify-top {
        top: 10px;
    }
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999 !important; /* Acima de modais do Bootstrap */
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: all;
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: var(--border-radius, 8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: white;
    animation: toastSlideIn 0.3s ease-out;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
}

.toast:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.toast.toast-removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    margin: 0;
}

.toast-message {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: all 0.2s;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toastProgress 5s linear forwards;
}

/* Variantes de tipo */
.toast-success {
    color: var(--success-color, #28a745);
}

.toast-success .toast-icon {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color, #28a745);
}

.toast-error {
    color: var(--danger-color, #dc3545);
}

.toast-error .toast-icon {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color, #dc3545);
}

.toast-warning {
    color: var(--warning-color, #ffc107);
}

.toast-warning .toast-icon {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color, #ffc107);
}

.toast-info {
    color: var(--primary-color, #007bff);
}

.toast-info .toast-icon {
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary-color, #007bff);
}

/* Animações */
@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }

    @keyframes toastSlideIn {
        from {
            transform: translateY(-100px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes toastSlideOut {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100px);
            opacity: 0;
        }
    }
}
