/* Estilos específicos para la página "Arma tus Rutinas" */
main {
    padding: 20px;
    flex: 1;
}

/* Sección de acceso restringido */
.access-restricted {
    text-align: center;
    padding: 50px;
    background-color: #333333;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgb(250, 248, 248); /* Sombra refinada */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.access-restricted:hover {
    transform: scale(1.01);
    box-shadow: 0 6px 15px rgb(250, 248, 248); /* Sombra refinada */
}

.access-restricted h2 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ffffff;
}

.access-restricted .cta-button {
    margin: 10px;
    background-color: #457b9d;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

.access-restricted .cta-button:hover {
    background-color: #1d3557;
    transform: scale(1.1);
}

.routine-builder {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filters {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

/* Estilos para el contenedor de la paginación */
#pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Estilo para cada botón de la paginación */
#pagination-container button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 15px;
    margin: 0 5px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Estilo para el botón activo */
#pagination-container button.active {
    background-color: #45a049;
}

/* Efecto al pasar el mouse por encima de los botones */
#pagination-container button:hover {
    background-color: #3e8e41;
    transform: scale(1.1);
}

/* Estilo para los botones de "Anterior" y "Siguiente" */
#pagination-container button.prev,
#pagination-container button.next {
    background-color: #008CBA;
}

/* Efecto al pasar el mouse por encima de los botones "Anterior" y "Siguiente" */
#pagination-container button.prev:hover,
#pagination-container button.next:hover {
    background-color: #007B8A;
}

#category-filter, #search-bar {
    padding: 12px;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.exercise-grid {
    display: grid;
    margin-top: 20px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));  /* Al menos 200px por ejercicio */
    gap: 15px;
}

.exercise-grid div {
    padding: 15px;
    background-color: #333333;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.25); /* Ajuste del sombreado */
    text-align: center;
    transition: transform 0.2s;
}

.exercise-grid div:hover {
    transform: scale(1.05);
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.15); /* Sombra al hacer hover */
}

.exercise-grid div img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.exercise-grid div h3 {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fafbfc;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.exercise-grid div button {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #457b9d;
    color: #f1faee;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.exercise-grid div button:hover {
    background-color: #1d3557;
    transform: scale(1.05);
}

/* Establecer el color blanco para el texto dentro de la alerta */
.swal2-popup {
    color: white !important;
}

.swal2-title {
    color: #f8f9fc;
    margin-top: 5px !important; /* Reducir margen superior */
    padding-top: 0px !important; /* Eliminar espacio extra */
    font-size: 22px;
    font-weight: bold;
}

.swal2-html-container {
    color: white !important;
}

.loading-message, .empty-message {
    text-align: center;
    font-size: 1.2rem;
    color: #6c757d;
    margin-top: 20px;
}

.hidden {
    display: none;
}

.instructions {
    font-size: 1rem;
    color: #333;
    max-width: 500px;
}

/* --- Estilos para el formulario dentro del popup --- */
.exercise-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    max-height: 80vh;
}

.exercise-form label {
    font-size: 1rem;
    font-weight: bold;
    color: #1d3557;
}

.exercise-form input,
.exercise-form select {
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #333333;
}

/* --- Popup de detalles del ejercicio --- */
.popup-header {
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.exercise-title {
    font-size: 1.8rem;
    color: #f8f9fa;
    font-weight: bold;
    margin-bottom: 5%;
}

/* 🔧 Permitir que el popup crezca según el contenido */
.swal2-popup.custom-popup {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    padding: 20px;
}

/* Contenido del popup */
.popup-right {
    background-color: #333333;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgb(248, 246, 246);
}

.popup-right .form-group {
    margin-bottom: 15px;
}

.popup-right label {
    font-size: 1rem;
    font-weight: bold;
    color: #f8f9fc;
}

.popup-right input,
.popup-right select {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
}

.popup-right input:focus,
.popup-right select:focus {
    border-color: #457b9d;
    outline: none;
}

/* Contenedor del contenido principal: video + formulario */
.popup-body {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Contenedor del video */
.video-container {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.video-container iframe,
.video-container video {
    width: 100%;      /* mantengo ancho completo */
    height: 450px;    /* aumento la altura, por ejemplo 450px */
    object-fit: contain; /* para que el video mantenga la proporción sin recortar */
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.15);
}

/* Contenedor del formulario */
.exercise-form-container {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    background-color: #333333;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgb(248, 246, 246);
}
/* Sección de instrucciones debajo */
.popup-instructions {
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    color: white;
    font-size: 1rem;
    line-height: 1.5;
}

/*popup pincipal*/
.custom-popup {
    background-color: #333333;
    width: 900px !important; /* Ajusta el ancho  */
    max-width: 5000px !important; /* Límite máximo de ancho */
    height: 2000px !important; /* Ajusta el alto  */
    max-height: 96vh; /* Límite máximo de alto */    
    overflow: auto; /* Permite scroll si el contenido es mayor al tamaño */
    box-shadow: 0 4px 6px rgba(250, 249, 249, 0.993);
}

/* Contenedor principal del modal */
.swal2-popup {
    background-color: #333333;
    border: 1px solid #e0e0e0;
}

.form-group textarea {
    width: 100%;
    font-family: Arial, sans-serif;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    resize: none; /* Desactiva el redimensionado manual si no es necesario */
    background-color: #f8f9fa;
    box-shadow: inset 0 2px 4px rgb(248, 247, 247);
}

.form-group textarea:focus {
    outline: none;
    font-family: Arial, sans-serif;
    border-color: #457b9d;
    box-shadow: 0 0 5px rgba(69, 123, 157, 0.5);
}

/* Media Query para dispositivos móviles */
@media (max-width: 768px) {
    .popup-header {
        text-align: center;
        padding: 10px 0;
    }

    .exercise-title {
        font-size: 1.5rem;
    }

    /* Contenedor principal: pasa a columna para apilar */
    .popup-body {
        flex-direction: column !important;
        gap: 20px;
    }

    /* Video ocupa todo el ancho y tiene más altura para móvil */
    .video-container {
        max-width: 100% !important;
        min-width: 100% !important;
    }
    .video-container iframe,
    .video-container video {
        width: 100%;
        height: 250px; /* o el alto que prefieras para móvil */
    }

    /* Formulario también a todo el ancho */
    .popup-right {
        max-width: 100% !important;
        min-width: 100% !important;
        padding: 15px;
        border-radius: 8px;
    }

    /* Instrucciones */
    .popup-instructions {
        text-align: left !important; /* más legible en móvil */
        padding-top: 10px;
        font-size: 1rem;
    }

    /* Popup general */
    .custom-popup {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        padding: 20px;
        overflow-y: auto;
    }
}