/**
 * Estilos para Sistema de Notificaciones Toast
 * Responsive y con animaciones suaves
 */

/* Contenedor de Toasts */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

/* Toast Individual */
.toast {
    pointer-events: all;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 320px;
    max-height: 150px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(400px);
}

/* Icono del Toast */
.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contenido del Toast */
.toast-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    max-height: 120px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.toast-content::-webkit-scrollbar {
    width: 5px;
}

.toast-content::-webkit-scrollbar-track {
    background: transparent;
}

.toast-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Botón Cerrar */
.toast-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1f2937;
}

.toast-close i {
    font-size: 18px;
}

/* Tipos de Toast */
.toast-success {
    border-left-color: #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

/* Animación de progreso (opcional) */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: progress 4s linear;
    border-radius: 0 0 0 12px;
}

@keyframes progress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Modal de Confirmación */
#confirmModal .confirm-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#confirmModal .confirm-icon i {
    font-size: 40px;
    color: #f59e0b;
}

#confirmModal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#confirmModal .modal-body {
    padding: 2rem;
}

#confirmModal h4 {
    font-weight: 700;
    color: #1f2937;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .toast-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        width: 100%;
        max-height: 120px;
        padding: 14px 16px;
        align-items: flex-start;
    }

    .toast-content {
        overflow-y: auto;
        max-height: 90px;
        padding-right: 4px;
        /* Scrollbar personalizado para móviles */
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    }

    .toast-content::-webkit-scrollbar {
        width: 4px;
    }

    .toast-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .toast-content::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }

    .toast-message {
        font-size: 13px;
        line-height: 1.6;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .toast-icon {
        font-size: 20px;
        margin-top: 2px;
    }

    .toast-close {
        margin-top: 2px;
        padding: 2px;
    }

    .toast-close i {
        font-size: 16px;
    }

    .toast.show {
        transform: translateY(0);
    }

    .toast.hide {
        transform: translateY(100px);
    }

    .toast {
        transform: translateY(100px);
    }

    /* Ajustar animación de progreso en móvil */
    .toast::after {
        height: 2px;
    }
}

/* Responsive - Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .toast-container {
        max-width: 350px;
    }

    .toast {
        min-width: 280px;
        max-height: 140px;
    }

    .toast-content {
        overflow-y: auto;
        max-height: 110px;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    }

    .toast-content::-webkit-scrollbar {
        width: 5px;
    }

    .toast-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .toast-content::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }

    .toast-message {
        font-size: 13.5px;
        line-height: 1.55;
    }
}

/* Modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1f2937;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    .toast-message {
        color: #f9fafb;
    }

    .toast-close {
        color: #9ca3af;
    }

    .toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #f9fafb;
    }
}

/* Animaciones adicionales */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Hover effect en toast */
.toast:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Múltiples toasts */
.toast-container .toast:nth-child(n+4) {
    display: none;
}