/* ============================================
   SISTEMA DE NOTIFICACIONES TOAST GLOBAL
   ============================================ */

.app-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.app-toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: top right;
    position: relative;
    overflow: hidden;
    /* Ensure visibility against Bootstrap defaults */
    opacity: 1;
    visibility: visible;
}

.app-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
}

.app-toast.app-toast-success {
    color: #10b981;
}

.app-toast.app-toast-error {
    color: #ef4444;
}

.app-toast.app-toast-warning {
    color: #f59e0b;
}

.app-toast.app-toast-info {
    color: #3b82f6;
}

.app-toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
}

.app-toast-success .app-toast-icon {
    background: #d1fae5;
    color: #10b981;
}

.app-toast-error .app-toast-icon {
    background: #fee2e2;
    color: #ef4444;
}

.app-toast-warning .app-toast-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.app-toast-info .app-toast-icon {
    background: #dbeafe;
    color: #3b82f6;
}

.app-toast-content {
    flex: 1;
    min-width: 0;
}

.app-toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.app-toast-message {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.app-toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.app-toast-close:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.app-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: progress linear;
}

/* Animaciones */
@keyframes slideIn {
    from {
        transform: translateX(400px) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateX(400px) scale(0.8);
        opacity: 0;
    }
}

@keyframes progress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

.app-toast.removing {
    animation: slideOut 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Responsive */
@media (max-width: 640px) {
    .app-toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .app-toast {
        min-width: auto;
        max-width: none;
    }
}

/* Variante con acción */
.app-toast-action {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}

.app-toast-action-btn {
    background: transparent;
    border: none;
    color: currentColor;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.app-toast-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Iconos SVG inline */
.app-toast-icon svg {
    width: 16px;
    height: 16px;
}