body {
    background-color: #1a1d22;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-image: none;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    overflow-x: hidden;
}

.gallery-message {
    color: #00FF00;
    text-align: center;
    margin: 20px 0;
}

/* Estilos para la galería */
#gallery-container {
    width: 840px;
    margin: 0;
    position: relative;
    background: #111;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    max-height: 100vh;
    max-width: 100vw;
    overflow: auto;
}

#main-image-area {
    position: relative;
    width: 100%;
    height: 580px;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 6px;
    background: #181818;
}

.slide-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide img:focus {
  outline: none;
  box-shadow: none;
}

.slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.slide.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 1;
}

.slide.prev {
    transform: translateX(-100%);
}

.slide.next {
    transform: translateX(100%);
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #0f0;
    cursor: pointer;
    z-index: 10;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.nav-button:hover {
    background: rgba(0, 255, 0, 0.3);
}

.nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#prev-image {
    left: 10px;
}

#next-image {
    right: 10px;
}

#thumbs-carousel {
    position: relative;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#thumbs-wrapper {
    overflow: hidden;
    width: 700px;
    
}

#thumbs {
    display: flex;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}

.thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin: 0 5px;
    cursor: pointer;
    border: 2px solid #333;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.thumb:hover {
    border-color: #0a0;
}

.thumb.active {
    border: 2px solid #0f0;
    box-shadow: 0 0 10px #0f0;
}

.thumb-nav {
    font-size: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #0f0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    transition: all 0.2s;
}

.thumb-nav:hover {
    background: rgba(0, 255, 0, 0.3);
}

.thumb-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#fullscreen-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    padding: 6px 12px;
    font-size: 16px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #0f0;
    color: #0f0;
    border-radius: 4px;
    transition: all 0.2s;
}

#fullscreen-btn:hover {
    background: rgba(0, 255, 0, 0.3);
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* --- NUEVOS ESTILOS PARA FULLSCREEN --- */
#gallery-container.fullscreen-active {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
#gallery-container.fullscreen-active #main-image-area {
    height: calc(100vh - 150px) !important; /* 150px reservado para el carrusel y márgenes */
    min-height: 0 !important;
    max-height: none !important;
}
#gallery-container.fullscreen-active .slide-container {
    height: 100% !important;
    min-height: 0 !important;
}
#gallery-container.fullscreen-active .slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}
#gallery-container.fullscreen-active #thumbs-carousel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: #111;
    z-index: 10000;
    padding-bottom: 10px;
}
#gallery-container.fullscreen-active #thumbs-wrapper {
    width: 90vw !important;
}

@media (max-width: 900px) {
    html, body {
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        box-sizing: border-box;
        background: #111;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }
    #gallery-container {
        width: 100vw !important;
        min-width: 0 !important;
        max-width: 100vw !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0;
        box-shadow: none;
        height: 100vh !important;
        min-height: 100vh !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        max-height: 100vh !important;
        max-width: 100vw !important;
        overflow: auto !important;
    }
    #main-image-area {
        height: calc(100vh - 110px) !important;
        min-height: 120px;
        max-height: none;
        margin-bottom: 0 !important;
    }
    .slide img {
        max-width: 100vw;
        max-height: 100%;
        width: 100vw;
        height: auto;
    }
    #thumbs-carousel {
        flex-direction: row !important;
        margin-top: 0 !important;
        width: 100vw;
        align-items: center;
        justify-content: center;
        position: relative;
        height: 110px;
        min-height: 90px;
        background: #111;
        padding: 0 !important;
    }
    #thumbs-wrapper {
        width: 80vw !important;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow-x: auto;
        overflow-y: hidden;
        height: 100%;
        padding: 0 !important;
        margin: 0 !important;
    }
    #thumbs {
        display: flex;
        align-items: center;
        height: 100%;
    }
    .thumb {
        width: 64px;
        height: 64px;
        margin: 0 4px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .nav-button, .thumb-nav {
        width: 44px;
        height: 44px;
        font-size: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #fullscreen-btn {
        top: 4px;
        left: 4px;
        font-size: 14px;
        padding: 4px 8px;
    }
    #prev-thumbs, #next-thumbs {
        position: static;
        margin: 0 2vw;
        align-self: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    html, body {
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        box-sizing: border-box;
        background: #111;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }
    #main-image-area {
        height: calc(100vh - 80px) !important;
        min-height: 80px;
        max-height: none;
    }
    .slide img {
        max-width: 100vw;
        max-height: 100%;
        width: 100vw;
        height: auto;
    }
    #thumbs-carousel {
        height: 80px;
        min-height: 60px;
    }
    #thumbs-wrapper {
        width: 90vw !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    #thumbs {
        display: flex;
        align-items: center;
        height: 100%;
    }
    .thumb {
        width: 44px;
        height: 44px;
        margin: 0 2px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .nav-button, .thumb-nav {
        width: 32px;
        height: 32px;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #fullscreen-btn {
        font-size: 12px;
        padding: 2px 6px;
    }
    #gallery-container {
        max-height: 100vh !important;
        max-width: 100vw !important;
        overflow: auto !important;
        margin: 0 !important;
    }
}