body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-image: url('fondo_gale.png'); /* Asegúrate de que el archivo esté en la misma carpeta */
    background-size: cover;
    background-attachment: fixed;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    background-color: rgba(255, 255, 255, 0.5);
    width: 100%;
    height: 20px;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h3 {
    margin: 0;
    color: #0056b3;
}

#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); /* 50x50 + padding */
    gap: 10px;
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    justify-content: center;
}

.thumbnail-wrapper {
    width: 50px;
    height: 50px;
    overflow: hidden;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    position: relative;
    opacity: 0; /* Para el efecto de entrada */
    transform: translateY(50px); /* Para el efecto de entrada */
}

.thumbnail-wrapper.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-wrapper:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Fullscreen Overlay */
#fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

#fullscreen-overlay.hidden {
    display: none;
}

#fullscreen-image-container {
    position: relative;
    max-width: 90%;
    max-height: calc(100% - 100px); /* Deja espacio para el carrusel de miniaturas */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

#fullscreen-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Para que la imagen se vea completa */
    border: 3px solid #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.nav-btn {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 1.5em;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    z-index: 1010;
}

.nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

#close-btn {
    top: 10px;
    right: 10px;
    font-size: 1.2em;
    padding: 8px 12px;
}

#prev-btn {
    left: -50px; /* Ajusta la posición del botón */
    top: 50%;
    transform: translateY(-50%);
}

#next-btn {
    right: -50px; /* Ajusta la posición del botón */
    top: 50%;
    transform: translateY(-50%);
}

#play-pause-btn {
    bottom: -50px; /* Posicionado debajo de la imagen */
    left: 50%;
    transform: translateX(-50%);
    top: unset;
}

#thumbnail-carousel {
    display: flex;
    gap: 5px;
    overflow-x: auto; /* Permite desplazamiento horizontal */
    padding: 10px 0;
    max-width: 90%;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.carousel-thumbnail-wrapper {
    flex-shrink: 0; /* Evita que las miniaturas se encojan */
    width: 50px;
    height: 50px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.carousel-thumbnail-wrapper.active {
    border-color: #007bff;
}

.carousel-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-thumbnail-wrapper:hover {
    border-color: #007bff;
}