/* 
 * Modal Improvements
 * Mejoras en el diseño y funcionalidad de los modales
 */

/* Overlay del modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Container del modal mejorado */
.modal_information {
    background: white;
    border-radius: 16px;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(31, 121, 113, 0.1);
}

.modal-overlay.active .modal_information {
    transform: scale(1) translateY(0);
}

/* Header del modal */
.cookie-consent-banner__header {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f7971;
    margin-bottom: 1rem;
    padding: 1.5rem 1.5rem 0;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}

/* Botón de cerrar X */
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(31, 121, 113, 0.1);
    border-radius: 50%;
    color: #1f7971;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.modal-close-btn:hover {
    background: rgba(31, 121, 113, 0.2);
    transform: scale(1.1);
}

/* Contenido del modal */
.cookie-consent-banner__description {
    font-size: 1rem;
    line-height: 1.6;
    color: #4a5568;
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
    text-align: justify;
}

.cookie-consent-banner__description p {
    margin: 1rem 0;
}

/* Botones del modal */
.cookie-consent-banner__actions {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.boton_modal_information {
    background: linear-gradient(45deg, #1f7971, #4CAF50);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(31, 121, 113, 0.2);
    min-width: 80px;
}

.boton_modal_information:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(31, 121, 113, 0.3);
    background: linear-gradient(45deg, #1a6b63, #45a049);
}

.boton_modal_information:active {
    transform: translateY(0);
}

/* Animaciones para entrada/salida */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.8) translateY(-40px);
    }
}

/* Scrollbar personalizada para el modal */
.modal_information::-webkit-scrollbar {
    width: 6px;
}

.modal_information::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal_information::-webkit-scrollbar-thumb {
    background: #1f7971;
    border-radius: 3px;
}

.modal_information::-webkit-scrollbar-thumb:hover {
    background: #1a6b63;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .modal_information {
        width: 95%;
        margin: 20px;
        border-radius: 12px;
    }
    
    .cookie-consent-banner__header {
        font-size: 1.3rem;
        padding: 1rem 1rem 0;
    }
    
    .cookie-consent-banner__description {
        font-size: 0.9rem;
        padding: 0 1rem;
    }
    
    .cookie-consent-banner__actions {
        padding: 0 1rem 1rem;
        flex-direction: column;
    }
    
    .boton_modal_information {
        width: 100%;
        padding: 14px;
    }
    
    .modal-close-btn {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* Estados de accesibilidad */
.modal-overlay:focus {
    outline: none;
}

.boton_modal_information:focus {
    outline: 3px solid rgba(31, 121, 113, 0.5);
    outline-offset: 2px;
}

.modal-close-btn:focus {
    outline: 3px solid rgba(31, 121, 113, 0.5);
    outline-offset: 2px;
}

/* Prevenir scroll del body cuando el modal está abierto */
body.modal-open {
    overflow: hidden;
}

/* Efectos adicionales */
.modal_information::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1f7971, #4CAF50);
    border-radius: 16px 16px 0 0;
}

/* Mejoras para el contenido específico */
.modal_information ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal_information ul li {
    margin: 0.5rem 0;
    color: #4a5568;
    line-height: 1.5;
}

/* Efecto de hover para toda la card del modal */
.modal_information:hover {
    box-shadow: 
        0 25px 30px -12px rgba(0, 0, 0, 0.15),
        0 10px 20px -10px rgba(0, 0, 0, 0.1);
}

/* Transición suave para el cierre */
.modal-overlay.closing .modal_information {
    animation: modalSlideOut 0.3s ease-out forwards;
}

.modal-overlay.closing {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
