.gallery_image{
    cursor: pointer; /* Pointer cursor for clickable images */
}

#fullscreen_container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#fullscreen_content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0s ease-out;
    will-change: transform;
}

#carousel_wrapper {
    overflow: hidden;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    flex-grow: 1;
    min-height: 0;
    cursor: grab;
    padding: 0 20px;
    box-sizing: border-box;
}

#carousel_slider {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
    align-items: center;
    width: 100%;
    height: auto;
    min-width: 0;
    flex-wrap: nowrap;
}

#carousel_slider img {
    flex-shrink: 0;
    border-radius: 8px;
    user-select: none;
    display: block;
    object-fit: cover;
    max-height: 80vh;
    margin: 0 10px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -o-user-select: none;
    width: auto;
    height: auto;
}

#carousel_slider .carousel_image {
    flex-grow: 0;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;
    box-sizing: border-box;
    flex-basis: 100%;
    transition: all 0.8s ease;
    max-width: 80%;
}

#carousel_slider .carousel_image.prev_clone,
#carousel_slider .carousel_image.next_clone {
    opacity: 0.7;
    filter: brightness(0.7);
}

#carousel_slider .carousel_image.current_active {
    opacity: 1;
    filter: brightness(1);
}

.nav_button {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: white;
    background: transparent;
    border: none;
    cursor: pointer;
    user-select: none;
    padding: 0 10px;
    z-index: 10;
    transition: color 0.3s;
}

#full-buttons_container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 25px;
    z-index: 10001;
}

#fullerscreen_button,
#play_button,
#closing_button,
#zoom_button {
    background: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    color: white;
    padding: 0;
}

#fullerscreen_button:hover,
#play_button:hover,
#closing_button:hover,
#zoom_buttom:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
}

#fullerscreen_button svg,
#play_button svg,
#closing_button svg,
#zoom_buttom svg {
    display: block;
    width: 60%;
    height: 60%;
}

#fullerscreen_button svg path,
#play_button svg polygon,
#closing_button svg path,
#closing_button svg line,
#zoom_buttom svg line,
#zoom_buttom svg circle {
    fill: currentColor;
    stroke: currentColor;
}

@media screen and (max-width: 768px) {
    #full-buttons_container {
        top: 10px;
        right: 10px;
        gap: 10px;
    }

    #fullerscreen_button,
    #play_button,
    #closing_button {
        width: 38px;
        height: 38px;
    }

    #fullerscreen_button svg,
    #play_button svg,
    #closing_button svg {
        width: 60%;
        height: 60%;
    }
}

#prev_button {
    left: 30px;
}

#next_button {
    right: 30px;
}

.nav_button:hover {
    color: #ddd;
}

#fullscreen_title {
    margin-top: 15px;
    font-size: 1.1rem;
    min-height: 1.4rem;
}

#single_image_area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    max-width: 800px;
    box-sizing: border-box;
}

#single_fullscreen_image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

#single_fullscreen_title {
    margin-top: 15px;
    font-size: 1.1rem;
    min-height: 1.4rem;
    color: white;
    text-align: center;
}

#carousel_area {
    display: none;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#autoplay_progress_bar_container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#autoplay_progress_bar_container.active {
    opacity: 1;
}

#autoplay_progress_bar {
    height: 100%;
    width: 0%;
    background-color: #fff;
    border-radius: 2px;
    transform-origin: left;
}

#play_button .play-icon {
    display: block;
}
#play_button .pause-icon {
    display: none;
}
#play_button.active .play-icon {
    display: none;
}
#play_button.active .pause-icon {
    display: block;
}

#zoom_button .zoom-in-icon {
    display: block;
}
#zoom_button .zoom-out-icon {
    display: none;
}
#zoom_button.active .zoom-in-icon {
    display: none;
}
#zoom_button.active .zoom-out-icon {
    display: block;
}

.carousel_image, #single_fullscreen_image {
    cursor: zoom-in;
    transition: transform 0.2s ease-out;
    transform-origin: center center;
}

.carousel_image.zoomed, #single_fullscreen_image.zoomed {
    cursor: grab;
}

.nav_button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#thumbnail_container.disabled {
    pointer-events: none;
    opacity: 0.5;
}
#play_button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#imageCounter {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    z-index: 1002;
    display: flex;
    align-items: center;
    gap: 5px;
}

@media screen and (max-width: 768px) {
    #fullscreen_content {
        max-width: 100vw;
        max-height: 100vh;
        padding: 10px;
    }

    #carousel_wrapper {
        max-width: 100%;
        height: auto;
        overflow: visible;
        margin: 0 10px;
        cursor: grab;
    }

    #carousel_slider {
        width: 100%;
        justify-content: flex-start;
    }

    #carousel_slider img {
        margin: 0 5px;
        min-height: unset;
        min-width: unset;
    }

    #carousel_slider .carousel_image {
        margin: 0 5px;
        min-width: 100vw;
    }

    #carousel_slider .carousel_image.prev_clone,
    #carousel_slider .carousel_image.next_clone {
        transform: scale(1);
        filter: brightness(0.6);
    }

    #carousel_slider .carousel_image.current_active {
        transform: scale(1);
        filter: brightness(1);
    }

    .nav_button {
        position: fixed;
        font-size: 3rem;
        color: rgba(255, 255, 255, 0.7);
        padding: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }

    #prev_button {
        left: 5px;
    }

    #next_button {
        right: 5px;
    }
}

#thumbnail_container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    padding: 0 10px;
    max-width: 1000px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    z-index: 5;
}

#thumbnail_container::-webkit-scrollbar {
    display: none;
}

.thumbnail_image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin: 0 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
    opacity: 0.7;
}

.thumbnail_image:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.5);
}

.thumbnail_image.active {
    opacity: 1;
    transform: scale(1.1);
    border-color: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

#fullscreen_notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    white-space: nowrap;
}

#fullscreen_notification.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

@media screen and (max-width: 768px) {
    .thumbnail_image {
        width: 50px;
        height: 50px;
        margin: 0 3px;
    }

    #thumbnail_container {
        padding: 0 5px;
    }
}

@media screen and (max-width: 480px) {
    #carousel_slider .carousel_image {
        margin: 0 3px;
    }
    #carousel_slider .carousel_image.prev_clone,
    #carousel_slider .carousel_image.next_clone {
        flex-basis: 20%;
        max-width: 20%;
    }
    
    #carousel_slider .carousel_image.current_active {
        flex-basis: 60%;
        max-width: 60%;
    }
}

@media screen and (max-width: 480px) {
    #carousel_wrapper {
        padding: 0 10px;
    }

    #carousel_slider img {
        max-width: 85vw;
    }
}
