/* ====================================
   MODALES GENERALES
   ==================================== */

.modal-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 2rem 2.5rem;
    border-radius: var(--border-radius);
    border: var(--glass-border);
    box-shadow: var(--shadow-heavy);
    max-width: 90vw;
    min-width: 320px;
    text-align: center;
    color: var(--text-color);
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    transform: scale(1.1);
}

.modal-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.modal-text {
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 100px;
}

.modal-btn.primary {
    background: var(--gradient-primary);
    color: white;
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 229, 145, 0.3);
}

.modal-btn.secondary {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    color: var(--text-color);
}

.modal-btn.secondary:hover {
    background: var(--glass-hover);
    transform: translateY(-2px);
}

/* ====================================
   MODAL DE CONFIRMACIÓN
   ==================================== */

.confirmation-modal {
    max-width: 400px;
}

.confirmation-modal .modal-title {
    color: #f39c12;
    margin-bottom: 1.5rem;
}

.confirmation-modal .modal-text {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ====================================
   MODAL DE INFORMACIÓN
   ==================================== */

.info-modal {
    max-width: 500px;
}

.info-modal .modal-title {
    color: #3498db;
}

/* ====================================
   MODAL DE ERROR
   ==================================== */

.error-modal {
    max-width: 450px;
}

.error-modal .modal-title {
    color: #e74c3c;
}

.error-modal .modal-text {
    color: #c0392b;
}

/* ====================================
   MODAL DE ÉXITO
   ==================================== */

.success-modal {
    max-width: 400px;
}

.success-modal .modal-title {
    color: #27ae60;
}

.success-modal .modal-text {
    color: #229954;
}

/* ====================================
   EFECTOS ESPECIALES
   ==================================== */

.modal-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 70%, rgba(0, 229, 145, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(0, 102, 255, 0.05) 0%, transparent 50%);
    animation: modalBackgroundPulse 6s ease-in-out infinite alternate;
}

@keyframes modalBackgroundPulse {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

/* ====================================
   RESPONSIVE PARA MODALES
   ==================================== */

@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem 1.8rem;
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.2rem 1.5rem;
        margin: 5px;
        max-width: calc(100% - 10px);
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-text {
        font-size: 0.95rem;
    }
}

/* ====================================
   MODAL DE ERROR
   ==================================== */

.error-card {
    background: linear-gradient(135deg, #f5353583, #ff4a4a67);
    border: 2px solid #ff52525b;
    color: white;
}

.error-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.error-card p {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.btn-retry {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-retry:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}
