/* Fullscreen Overlay Styles */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: zoom-out;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transition: background var(--transition-speed) ease;
}

.fullscreen-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain; 
    border-radius: 10px;
    touch-action: none;
    transition: object-fit var(--transition-speed) ease;
}

.close-fullscreen {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2200;
    background: rgba(255, 255, 255, 0.2);
    color: var(--dark-text);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background var(--transition-speed), transform 0.2s;
}

.close-fullscreen:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* Light theme adjustments for fullscreen controls */
body.light-theme .close-fullscreen,
body.light-theme .nav-button {
    background: rgba(0, 0, 0, 0.2);
    color: var(--dark-text);
}

body.light-theme .close-fullscreen:hover,
body.light-theme .nav-button:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Navigation Buttons Styles - Updated for fixed position */
.nav-buttons {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2150;
}

.nav-button {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    color: var(--dark-text); /* Always light text for visibility */
    border: none;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    transition: background var(--transition-speed), transform 0.2s;
    touch-action: manipulation;
    margin: 0 20px;
}

/* Fixed positioning for navigation buttons */
#prevButton {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#nextButton {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.nav-button:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1) translateY(-50%);
}

/* Image Counter */
.image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--dark-text);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 2200;
}

body.light-theme .image-counter {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Slideshow Progress Styles */
.slideshow-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    background-color: var(--secondary-color);
    width: 0;
    z-index: 2100;
    animation: slideshowProgress var(--animation-speed) linear;
}

@keyframes slideshowProgress {
    from { width: 0; }
    to { width: 100%; }
}

/* Image Transition Effects */
.fullscreen-image {
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
    opacity: 1;
}

.fullscreen-image.morphing {
    transform: scale(1.1) rotate(2deg);
    opacity: 0.7;
}

.fullscreen-image.morphing-next {
    transform: scale(0.9) rotate(-2deg);
    opacity: 0;
}