/* ==============================================================================
   PRAGMA STUDY - SISTEMA DE MODALES Y NOTIFICACIONES POPUP PERSONALIZADAS
   ============================================================================== */

/* Contenedor Modal Global */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 16, 16, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal-box {
    background: linear-gradient(145deg, #181715, #121110);
    border: 1px solid rgba(227, 219, 204, 0.2);
    border-radius: 22px;
    padding: clamp(22px, 5vw, 32px);
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.75), 0 0 30px rgba(227, 219, 204, 0.1);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.custom-modal-overlay.active .custom-modal-box {
    transform: scale(1) translateY(0);
}

/* Icono Superior Animado */
.custom-modal-icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    animation: modalPulse 2s infinite ease-in-out;
}

@keyframes modalPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* Variantes de Color por Tipo */
.custom-modal-box.type-success .custom-modal-icon-wrap {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.4));
    border: 1px solid #10b981;
    color: #10b981;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
}

.custom-modal-box.type-error .custom-modal-icon-wrap {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.4));
    border: 1px solid #ef4444;
    color: #ef4444;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
}

.custom-modal-box.type-warning .custom-modal-icon-wrap {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.4));
    border: 1px solid #f59e0b;
    color: #f59e0b;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.3);
}

.custom-modal-box.type-info .custom-modal-icon-wrap {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(6, 182, 212, 0.3));
    border: 1px solid #7c3aed;
    color: #a78bfa;
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.3);
}

.custom-modal-box.type-confirm .custom-modal-icon-wrap {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(245, 158, 11, 0.3));
    border: 1px solid #d4af37;
    color: #d4af37;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.3);
}

/* Textos */
.custom-modal-title {
    font-size: clamp(1.15rem, 4vw, 1.4rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}

.custom-modal-message {
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 22px;
    word-break: break-word;
    white-space: pre-line;
}

/* Botones de Acción */
.custom-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.custom-modal-btn {
    padding: 11px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

.custom-modal-btn.btn-primary-confirm {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}
.custom-modal-btn.btn-primary-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.5);
}

.custom-modal-btn.btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}
.custom-modal-btn.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* TOAST NOTIFICATION CONTAINER */
.custom-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 360px;
    width: calc(100% - 40px);
}

.custom-toast {
    background: linear-gradient(145deg, #141424, #0d0d18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 12px 16px;
    color: #fff;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    pointer-events: auto;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    opacity: 0;
}

.custom-toast.active {
    transform: translateX(0);
    opacity: 1;
}

.custom-toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.custom-toast.type-success .custom-toast-icon { color: #10b981; }
.custom-toast.type-error .custom-toast-icon { color: #ef4444; }
.custom-toast.type-warning .custom-toast-icon { color: #f59e0b; }
.custom-toast.type-info .custom-toast-icon { color: #06b6d4; }

@media (max-width: 480px) {
    .custom-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
    .custom-modal-box {
        padding: 20px 16px;
        border-radius: 18px;
    }
    .custom-modal-actions {
        flex-direction: column;
    }
    .custom-modal-btn {
        width: 100%;
    }
}
