/* ===== MODALES ELEGANTES DEL PROBLEMA DEL CABALLO ===== */

/* Bloquear scroll cuando hay modales abiertos */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    touch-action: none !important;
}

/* Modal base con overlay sofisticado */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
    backdrop-filter: blur(12px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: modalOverlayFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Contenedor del modal con diseño moderno */
.modal-content {
    background: linear-gradient(145deg, #1a1a1a 0%, #2a2a2a 50%, #1f1f1f 100%);
    border: 2px solid #C50039;
    border-radius: 20px;
    padding: 0;
    max-width: 450px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(197, 0, 57, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: modalSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 280px;
    min-height: 180px;
}

/* Header del modal con gradiente elegante */
.modal-header {
    background: linear-gradient(135deg, #C50039 0%, #a4002e 100%);
    padding: 25px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    text-align: center;
}

.modal-title {
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Botón de cerrar modal sofisticado */
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
    font-weight: bold;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-close-btn:active {
    transform: scale(0.95) rotate(90deg);
}

/* Contenido del modal con estilo elegante */
.modal-body {
    padding: 30px;
    color: #e0e0e0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0.02) 100%);
}

/* Efectos de brillo y sombras */
.modal-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #C50039, #ff1744, #C50039);
    border-radius: 22px;
    z-index: -1;
    opacity: 0.6;
    animation: borderGlow 2s ease-in-out infinite alternate;
}

/* Animaciones sofisticadas */
@keyframes modalOverlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(12px);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes borderGlow {
    from {
        opacity: 0.4;
        box-shadow: 0 0 20px rgba(197, 0, 57, 0.3);
    }
    to {
        opacity: 0.8;
        box-shadow: 0 0 30px rgba(197, 0, 57, 0.6);
    }
}

/* ===== RESPONSIVIDAD PARA MODALES ===== */

/* Estilos específicos para pantallas pequeñas */
@media only screen and (max-width: 767px) {
    .modal {
        padding: 20px;
    }
    
    .modal-content {
        min-width: 260px;
        min-height: 160px;
        margin: 0;
        max-width: 380px;
        width: calc(100vw - 40px);
    }
    
    .modal-header {
        padding: 20px 25px 15px;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-close-btn {
        width: 30px;
        height: 30px;
        font-size: 18px;
        top: 12px;
        right: 15px;
    }
    
    .modal-body {
        padding: 25px 20px;
        font-size: 1rem;
    }
}

/* Estilos para pantallas muy pequeñas */
@media only screen and (max-width: 480px) {
    .modal {
        padding: 15px;
    }
    
    .modal-content {
        min-width: 240px;
        min-height: 140px;
        max-width: 320px;
        width: calc(100vw - 30px);
    }
    
    .modal-header {
        padding: 18px 20px 12px;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-close-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
        top: 10px;
        right: 12px;
    }
    
    .modal-body {
        padding: 20px 15px;
        font-size: 0.95rem;
    }
}
