/* css/modal.css */

/* Modal principal */
.neural-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.neural-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    animation: modalFadeIn 0.3s ease;
}

.neural-modal__container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background: linear-gradient(135deg, rgba(15, 83, 168, 0.95), rgba(10, 50, 100, 0.98));
    border-radius: 24px;
    border: 1px solid rgba(84, 189, 236, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(84, 189, 236, 0.2);
    overflow: hidden;
    pointer-events: auto;
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.neural-modal__close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(84, 189, 236, 0.4);
    color: #54BDEC;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.neural-modal__close:hover {
    background: rgba(84, 189, 236, 0.2);
    transform: scale(1.1);
    color: #fff;
}

.neural-modal__content {
    padding: 32px 28px;
    max-height: calc(80vh - 20px);
    overflow-y: auto;
    color: #e0f0ff;
    scrollbar-width: thin;
}

/* Scroll personalizado */
.neural-modal__content::-webkit-scrollbar {
    width: 6px;
}

.neural-modal__content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.neural-modal__content::-webkit-scrollbar-thumb {
    background: #54BDEC;
    border-radius: 3px;
}

/* Loader */
.neural-modal__loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    text-align: center;
    color: #54BDEC;
}

.neural-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(84, 189, 236, 0.2);
    border-top-color: #54BDEC;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Error state */
.neural-modal__error {
    text-align: center;
    padding: 40px 20px;
}

.neural-modal__error h3 {
    color: #ff6b6b;
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.neural-modal__error p {
    color: #ccc;
    margin-bottom: 24px;
}

.neural-modal__retry {
    background: #54BDEC;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    color: #0F2B4D;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.neural-modal__retry:hover {
    background: #3aa8d8;
    transform: scale(1.02);
}

/* Animaciones */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Clase para el body cuando el modal está abierto */
body.modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .neural-modal__container {
        width: 95%;
        max-height: 85vh;
    }
    
    .neural-modal__content {
        padding: 24px 18px;
    }
    
    .neural-modal__close {
        top: 12px;
        right: 14px;
        width: 32px;
        height: 32px;
    }
}