/* ==========================================
   SISTEMA DE ALERTAS PROFESIONAL
   ========================================== */

/* Contenedor principal de alertas */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    pointer-events: none;
}

/* Alerta individual */
.alert-box {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 320px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    border-left: 4px solid;
}

.alert-box.show {
    opacity: 1;
    transform: translateX(0);
}

.alert-box.hide {
    opacity: 0;
    transform: translateX(400px) scale(0.8);
}

/* Contenido de la alerta */
.alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.alert-content i {
    font-size: 22px;
    flex-shrink: 0;
}

.alert-message {
    font-size: 15px;
    font-weight: 500;
    color: #2d3748;
    line-height: 1.5;
}

/* Botón de cerrar */
.alert-close {
    background: transparent;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.alert-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2d3748;
}

.alert-close i {
    font-size: 14px;
}

/* Tipos de alertas */
.alert-success {
    border-left-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
}

.alert-success .alert-content i {
    color: #48bb78;
}

.alert-error {
    border-left-color: #f56565;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.alert-error .alert-content i {
    color: #f56565;
}

.alert-warning {
    border-left-color: #ed8936;
    background: linear-gradient(135deg, #fffaf0 0%, #ffffff 100%);
}

.alert-warning .alert-content i {
    color: #ed8936;
}

.alert-info {
    border-left-color: #4299e1;
    background: linear-gradient(135deg, #ebf8ff 0%, #ffffff 100%);
}

.alert-info .alert-content i {
    color: #4299e1;
}

/* ==========================================
   MODAL DE CONFIRMACIÓN
   ========================================== */

.alert-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alert-confirm-overlay.show {
    opacity: 1;
}

.alert-confirm-overlay.hide {
    opacity: 0;
}

.alert-confirm-modal {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.alert-confirm-overlay.show .alert-confirm-modal {
    transform: scale(1);
}

.alert-confirm-overlay.hide .alert-confirm-modal {
    transform: scale(0.9);
}

/* Icono del modal */
.alert-confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.alert-confirm-icon.info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.alert-confirm-icon i {
    font-size: 32px;
    color: white;
}

/* Contenido del modal */
.alert-confirm-content {
    text-align: center;
    margin-bottom: 28px;
}

.alert-confirm-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
}

.alert-confirm-content p {
    font-size: 16px;
    color: #718096;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Input para prompt */
.alert-prompt-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    margin-top: 16px;
    transition: all 0.3s ease;
}

.alert-prompt-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Acciones del modal */
.alert-confirm-actions {
    display: flex;
    gap: 12px;
}

.alert-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.alert-btn-cancel {
    background: #f7fafc;
    color: #718096;
    border: 2px solid #e2e8f0;
}

.alert-btn-cancel:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.alert-btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.alert-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.alert-btn:active {
    transform: scale(0.98);
}

/* ==========================================
   TOAST (Notificación pequeña)
   ========================================== */

.alert-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2d3748;
    color: white;
    padding: 14px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.alert-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.alert-toast i {
    font-size: 18px;
}

.alert-toast-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.alert-toast-error {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.alert-toast-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.alert-toast-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .alert-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .alert-box {
        min-width: auto;
        width: 100%;
    }

    .alert-confirm-modal {
        width: 95%;
        padding: 24px;
    }

    .alert-confirm-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 20px;
    }

    .alert-confirm-icon i {
        font-size: 28px;
    }

    .alert-confirm-content h3 {
        font-size: 20px;
    }

    .alert-confirm-content p {
        font-size: 15px;
    }

    .alert-confirm-actions {
        flex-direction: column;
    }

    .alert-btn {
        width: 100%;
    }

    .alert-toast {
        bottom: 20px;
        left: 20px;
        right: 20px;
        transform: translateX(0) translateY(100px);
        border-radius: 12px;
    }

    .alert-toast.show {
        transform: translateX(0) translateY(0);
    }
}

/* Animación de entrada */
@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes alertSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(400px) scale(0.8);
    }
}
