/* ============================================
   MODAL PERSONALIZADO
   ============================================ */
.modal-overlay-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.modal-overlay-custom.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   MODAL CONTENT
   ============================================ */
.modal-custom {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow);
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-custom-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-custom-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
}

.modal-custom-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    padding: 4px;
    line-height: 1;
}

.modal-custom-close:hover {
    color: var(--text-primary);
}

/* ============================================
   ICONOS DEL MODAL
   ============================================ */
.modal-custom-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.modal-custom-icon.warning {
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
}

.modal-custom-icon.danger {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.modal-custom-icon.info {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.modal-custom-icon.success {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

/* ============================================
   MODAL BODY
   ============================================ */
.modal-custom-body {
    padding: 20px 24px;
}

.modal-custom-body p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   MODAL FOOTER
   ============================================ */
.modal-custom-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   BOTONES DEL MODAL
   ============================================ */
.modal-custom-footer .btn {
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    cursor: pointer !important;
    transition: var(--transition);
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    border: none;
}

.modal-custom-footer .btn--outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
}

.modal-custom-footer .btn--outline:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: rgba(108, 59, 224, 0.08);
}

.modal-custom-footer .btn--danger {
    background: #e74c3c;
    color: white;
}

.modal-custom-footer .btn--danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.modal-custom-footer .btn--warning {
    background: #f39c12;
    color: white;
}

.modal-custom-footer .btn--warning:hover {
    background: #d68910;
    transform: translateY(-2px);
}

.modal-custom-footer .btn--info {
    background: #3498db;
    color: white;
}

.modal-custom-footer .btn--info:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.modal-custom-footer .btn--success {
    background: #2ecc71;
    color: white;
}

.modal-custom-footer .btn--success:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

/* Asegurar que todos los elementos del modal sean clickeables */
.modal-custom * {
    pointer-events: auto !important;
}

.modal-custom-footer {
    pointer-events: auto !important;
}

/* Modal de alerta (solo un botón) */
.modal-alert-footer {
    justify-content: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .modal-custom {
        max-width: 100%;
        margin: 16px;
    }

    .modal-custom-header {
        padding: 16px 18px 12px;
    }

    .modal-custom-header h3 {
        font-size: 16px;
    }

    .modal-custom-body {
        padding: 16px 18px;
    }

    .modal-custom-body p {
        font-size: 14px;
    }

    .modal-custom-footer {
        flex-direction: column;
        padding: 12px 18px 16px;
    }

    .modal-custom-footer .btn {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }

    .modal-custom-icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}