html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0; /* Asegura que no haya márgenes indeseados */
    

}

.title{
  font-size: 1.8rem;
  color: #003b6f;
  text-align: center;
  margin: 0px 0 20px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 1.5px;
  position: relative;
}

.title::after {
  content: '';
  display: block;
  width: 70px;
  height: 4px;
  background-color: #0077b6;
  margin: 10px auto 0;
  border-radius: 2px;
}


.containerOutside{
    margin-top: 20px;
    padding: 20px;
    background-color: #f7f7f7;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px; /* Añadimos padding para evitar que los videos toquen los bordes */
}

.square-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px;
}



.square-containerExp {
    display: flex;
    flex-direction: row; /* Asegura que las imágenes se muestren en fila */
    align-items: center;
    margin: 10px;
    justify-content: space-evenly; /* Espaciado entre las imágenes */
    gap: 10px; /* Añadir espacio entre las imágenes */
    flex-wrap: nowrap; /* Asegura que las imágenes no se envuelvan en una nueva fila */
    white-space: nowrap; /* Evita que el contenedor rompa la fila */
}



.square, .squareExpresiones {
    width: 150px;
    height: 150px;
    border: 3px solid #2C7DA0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden; /* Evita que el texto se desborde */
    padding: 10px; /* Añadir un pequeño padding para que el texto no esté pegado a los bordes */
}

.squareExpresiones{
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}



.square:hover, .squareExpresiones:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.square:active, .squareExpresiones:active {
    transform: scale(0.98);
}

.square-container p, .square-containerExp p {
    margin: 10px 0 0;
    text-align: center;
    font-size: 14px;
    color: #333;
    font-weight: bold;
    overflow: hidden; /* Asegura que el texto no se desborde */
    word-wrap: break-word; /* Permite que el texto se ajuste a varias líneas si es necesario */
    word-break: break-all; /* Si el texto es muy largo, se romperá en el borde */
    white-space: normal; /* Permite que el texto se ajuste en varias líneas */
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border: 2px solid #2C7DA0;
    border-radius: 8px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
    margin-top: 20px;
}

.popup img, .popup .empty-square {
    width: 100px;
    height: 100px;
    margin: 5px;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s ease-in-out;
}

.popup p{
    font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.popup img:hover {
    transform: scale(1.1);
}

.popup .row {
    display: flex;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.popup .row:hover {
    background-color: #f0f0f0; /* Color de fondo al hacer hover */
}

/* Cuando el ratón pasa sobre la fila, también aumenta el tamaño de las imágenes dentro de la fila */
.popup .row:hover img {
    transform: scale(1.05); /* Efecto de aumentar el tamaño de las imágenes */
}

.videoContainer {
    
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* <- clave */
    gap: 20px;
    justify-items: center;
}

.video-result {
    width: 100%;         
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    display: block;
}


.texto-video-container {
    grid-column: 1 / -1;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    margin-bottom: 10px;
}



.video-result:hover {
    transform: scale(1.075);
    z-index: 10;
    position: relative;
}


#expressionPopup {
    overflow: hidden; /* Evita una barra de desplazamiento innecesaria en el popup */
}


.video-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 50px;
    padding-bottom: 95px;
    max-height: 80vh;
    overflow-y: auto;
}

.video-wrapper {
    width: 150px;
    cursor: pointer;
}

.video-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ccc;
    transition: transform 0.3s ease, z-index 0.3s;
    z-index: 1;
}

.video-thumb:hover {
    transform: scale(2);
    z-index: 10;
    position: relative;
}

.poster-thumb {
    width: 100%;
}


/* Contenedor principal de imágenes */
.images-wrapper {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 2px solid #2C7DA0;
    border-radius: 10px;
    transition: all 0.3s ease-in-out;
    align-items: center;
}

/* Cada imagen dentro del bloque */
.image-item {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Imagen */
.image-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Cuadrado vacío */
.empty-square {
    background-color: #f0f0f0;
    border: 2px solid #ccc;
}


/* Mostrar botón al pasar el ratón */
.images-wrapper:hover .delete-button {
    opacity: 1;
}

.delete-cross {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 24px;
    font-family: 'Roboto', sans-serif; /* Fuente moderna */
    color: rgba(255, 255, 255, 0.8); /* Blanco con algo de transparencia */
    background-color: rgba(0, 0, 0, 0.4); /* Fondo semi-transparente oscuro */
    border-radius: 50%; /* Círculo perfecto */
    width: 30px; /* Ancho del círculo */
    height: 30px; /* Alto del círculo */
    display: flex;
    justify-content: center;
    align-items: center; /* Centra la "x" dentro del círculo */
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s ease; /* Animación para el fondo */
}

.delete-cross:hover {
    background-color: rgba(0, 0, 0, 0.6); /* Fondo oscuro al hacer hover */
    transform: scale(1.1); /* Agrandar ligeramente al pasar el mouse */
}

.delete-cross:active {
    transform: scale(0.9); /* Efecto de "presionar" cuando haces clic */
}






@media (max-width: 768px) {
    .videoContainer {
        grid-template-columns: 1fr; /* En pantallas pequeñas, los videos estarán en una sola columna */
        margin-left: 5px;
        margin-right: 5px;
    }

    .video {
        max-width: 100%;
        margin-bottom: 10px;
    }

    body, html {
        overflow-x: hidden;
    }
}

/* Estilos adicionales para pantallas grandes (por encima de 1024px) */
@media (min-width: 1024px) {
    .videoContainer {
        grid-template-columns: repeat(2, 1fr); /* Muestra tres videos por fila en pantallas grandes */
    }

    .video {
        max-width: 100%;
        height: 400px; /* Aumentamos la altura del video para pantallas grandes */
    }
}
