/**
 * ═══════════════════════════════════════════════════════════════════════════════
 * MODAL GENERAL - Respaldame CRM Político
 * Sistema de modales elegantes para reemplazar alert() y confirm() nativos
 * Estilo: Liquid Blur + Glassmorphism + Startup Minimalista
 * ═══════════════════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════
   CSS VARIABLES - Modal Theme
═══════════════════════════════════════ */
:root {
    --modal-backdrop-blur: 20px;
    --modal-bg-blur: 40px;
    --modal-border-radius: 24px;
    --modal-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    --modal-transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --modal-icon-success: #10b981;
    --modal-icon-error: #ef4444;
    --modal-icon-warning: #f59e0b;
    --modal-icon-info: #540B0E;
    --modal-icon-confirm: #8B7355;
}

/* ═══════════════════════════════════════
   BACKDROP - Liquid Blur Effect
═══════════════════════════════════════ */
.modal-general-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 10, 15, 0.4);
    backdrop-filter: blur(var(--modal-backdrop-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--modal-backdrop-blur)) saturate(180%);
    opacity: 0;
    visibility: hidden;
    transition: var(--modal-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-general-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Liquid blob animation en el fondo - The Dossier Colors */
.modal-general-backdrop::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(84, 11, 14, 0.12) 0%, transparent 70%);  /* Burgundy power */
    border-radius: 50%;
    animation: liquidBlob1 15s ease-in-out infinite;
    pointer-events: none;
}

.modal-general-backdrop::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 115, 85, 0.10) 0%, transparent 70%);  /* Gold subtle */
    border-radius: 50%;
    animation: liquidBlob2 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes liquidBlob1 {
    0%, 100% { transform: translate(-30%, -30%) scale(1); }
    33% { transform: translate(20%, -20%) scale(1.1); }
    66% { transform: translate(-10%, 20%) scale(0.9); }
}

@keyframes liquidBlob2 {
    0%, 100% { transform: translate(30%, 30%) scale(1.1); }
    50% { transform: translate(-20%, -10%) scale(0.95); }
}

/* ═══════════════════════════════════════
   MODAL CONTAINER - Glass Card
═══════════════════════════════════════ */
.modal-general-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: linear-gradient(
        135deg,
        rgba(30, 32, 45, 0.95) 0%,
        rgba(20, 22, 32, 0.98) 100%
    );
    backdrop-filter: blur(var(--modal-bg-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--modal-bg-blur)) saturate(150%);
    border-radius: var(--modal-border-radius);
    box-shadow: var(--modal-shadow);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    transition: var(--modal-transition);
}

.modal-general-backdrop.active .modal-general-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Glow effect superior - The Dossier */
.modal-general-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(84, 11, 14, 0.5),     /* Burgundy power */
        rgba(139, 115, 85, 0.5),   /* Gold subtle */
        transparent
    );
    border-radius: 2px;
}

/* ═══════════════════════════════════════
   MODAL CONTENT
═══════════════════════════════════════ */
.modal-general-content {
    padding: 32px 28px 28px;
    text-align: center;
}

/* Icon Container */
.modal-general-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: iconPulse 2s ease-in-out infinite;
}

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

/* Icon ring animation */
.modal-general-icon::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid transparent;
    animation: iconRing 2s ease-out infinite;
}

@keyframes iconRing {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

.modal-general-icon svg,
.modal-general-icon i {
    font-size: 32px;
    position: relative;
    z-index: 1;
}

/* Icon Types */
.modal-general-icon.icon-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.modal-general-icon.icon-success svg,
.modal-general-icon.icon-success i { color: var(--modal-icon-success); }
.modal-general-icon.icon-success::before { border-color: rgba(16, 185, 129, 0.4); }

.modal-general-icon.icon-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.modal-general-icon.icon-error svg,
.modal-general-icon.icon-error i { color: var(--modal-icon-error); }
.modal-general-icon.icon-error::before { border-color: rgba(239, 68, 68, 0.4); }

.modal-general-icon.icon-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.modal-general-icon.icon-warning svg,
.modal-general-icon.icon-warning i { color: var(--modal-icon-warning); }
.modal-general-icon.icon-warning::before { border-color: rgba(245, 158, 11, 0.4); }

.modal-general-icon.icon-info {
    background: linear-gradient(135deg, rgba(84, 11, 14, 0.2), rgba(84, 11, 14, 0.1));
    border: 1px solid rgba(84, 11, 14, 0.3);
}
.modal-general-icon.icon-info svg,
.modal-general-icon.icon-info i { color: var(--modal-icon-info); }
.modal-general-icon.icon-info::before { border-color: rgba(84, 11, 14, 0.4); }

.modal-general-icon.icon-confirm {
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.2), rgba(139, 115, 85, 0.1));
    border: 1px solid rgba(139, 115, 85, 0.3);
}
.modal-general-icon.icon-confirm svg,
.modal-general-icon.icon-confirm i { color: var(--modal-icon-confirm); }
.modal-general-icon.icon-confirm::before { border-color: rgba(139, 115, 85, 0.4); }

/* Title */
.modal-general-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

/* Message */
.modal-general-message {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 28px;
    max-height: 200px;
    overflow-y: auto;
}

.modal-general-message::-webkit-scrollbar {
    width: 4px;
}

.modal-general-message::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.modal-general-message::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.modal-general-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-general-btn {
    flex: 1;
    max-width: 160px;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.modal-general-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-general-btn:hover::before {
    opacity: 1;
}

/* Primary Button - The Dossier */
.modal-general-btn.btn-primary {
    background: linear-gradient(135deg, #540B0E 0%, #6B0F12 100%);
    color: #F0EBD8;  /* Cream classic */
    box-shadow: 
        0 4px 14px rgba(84, 11, 14, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal-general-btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(84, 11, 14, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal-general-btn.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.modal-general-btn.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-general-btn.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.modal-general-btn.btn-secondary:active {
    transform: translateY(0);
}

/* Danger Button */
.modal-general-btn.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 
        0 4px 14px rgba(239, 68, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal-general-btn.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(239, 68, 68, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Success Button */
.modal-general-btn.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 
        0 4px 14px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal-general-btn.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(16, 185, 129, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Single Button Layout */
.modal-general-buttons.single-button {
    justify-content: center;
}

.modal-general-buttons.single-button .modal-general-btn {
    max-width: 200px;
}

/* ═══════════════════════════════════════
   INPUT FIELD (para prompts)
═══════════════════════════════════════ */
.modal-general-input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.modal-general-input:focus {
    outline: none;
    border-color: rgba(84, 11, 14, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(84, 11, 14, 0.15);
}

.modal-general-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ═══════════════════════════════════════
   CLOSE BUTTON
═══════════════════════════════════════ */
.modal-general-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.modal-general-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    transform: rotate(90deg);
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 480px) {
    .modal-general-container {
        max-width: 95%;
        border-radius: 20px;
    }
    
    .modal-general-content {
        padding: 28px 20px 24px;
    }
    
    .modal-general-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 20px;
    }
    
    .modal-general-icon svg,
    .modal-general-icon i {
        font-size: 28px;
    }
    
    .modal-general-title {
        font-size: 1.2rem;
    }
    
    .modal-general-message {
        font-size: 0.9rem;
    }
    
    .modal-general-buttons {
        flex-direction: column-reverse;
    }
    
    .modal-general-btn {
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════
   ANIMATION VARIANTS
═══════════════════════════════════════ */
/* Shake animation for errors */
@keyframes modalShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.modal-general-container.shake {
    animation: modalShake 0.5s ease-in-out;
}

/* Success checkmark animation */
@keyframes checkmarkDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.modal-general-icon.icon-success svg path.checkmark {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: checkmarkDraw 0.5s ease-out 0.2s forwards;
}

/* ═══════════════════════════════════════
   TOAST NOTIFICATIONS (complementario)
═══════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-notification {
    background: linear-gradient(135deg, rgba(30, 32, 45, 0.95), rgba(20, 22, 32, 0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
    max-width: 420px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-notification.hiding {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-notification.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.toast-notification.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.toast-notification.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.toast-notification.toast-info .toast-icon {
    background: rgba(84, 11, 14, 0.15);
    color: #540B0E;
}

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

.toast-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

/* Toast progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--toast-color), transparent);
    border-radius: 0 0 14px 14px;
    animation: toastProgress var(--toast-duration, 5s) linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.toast-notification.toast-success { --toast-color: #10b981; }
.toast-notification.toast-error { --toast-color: #ef4444; }
.toast-notification.toast-warning { --toast-color: #f59e0b; }
.toast-notification.toast-info { --toast-color: #540B0E; }

@media (max-width: 480px) {
    .toast-container {
        top: auto;
        bottom: 24px;
        left: 16px;
        right: 16px;
    }
    
    .toast-notification {
        min-width: auto;
        max-width: 100%;
    }
}














