/* FullScreen Gallery - Modern & Elegant Design */

/* Reset & Base */
.fsg-modal * {
    box-sizing: border-box;
}

/* Modal Container */
.fsg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.fsg-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content */
.fsg-modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header - Now Fixed */
.fsg-modal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;

    z-index: 20;
    transition: opacity 0.3s ease;
}

.fsg-modal.hide-ui .fsg-modal-header {
    opacity: 0;
    pointer-events: none;
}

.fsg-modal.hide-ui .fsg-modal-header .fsg-close {
    opacity: 1;
    pointer-events: all;
}

/* Counter */
.fsg-counter {
    color: #fff;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    display: none;
}

.fsg-current {
    font-weight: 600;
}

/* Close Button - Always Visible */
.fsg-close {
    width: 48px;
    height: 48px;
    border: none;
    background:#000000;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 1;
}

.fsg-close:hover {
  background:#000000;
    transform: scale(1.1);
}

.fsg-close:active {
    transform: scale(0.95);
}

/* Gallery Wrapper - Modified for full width images */
.fsg-gallery-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 0;
}

/* Navigation Buttons - Fixed position */
.fsg-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
     background:#000000;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 15;
}

.fsg-nav:hover {
    background:#000000;
    transform: translateY(-50%) scale(1.1);
}

.fsg-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.fsg-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.fsg-nav-prev {
    left: 30px;
}

.fsg-nav-next {
    right: 30px;
}

.fsg-modal.hide-ui .fsg-nav {
    opacity: 0;
}

/* Images Container - Modified for scrolling */
.fsg-images-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.fsg-images-track {
    display: flex;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image Wrapper - Modified for scrolling */
.fsg-image-wrapper {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for image wrapper */
.fsg-image-wrapper::-webkit-scrollbar {
    width: 8px;
}

.fsg-image-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.fsg-image-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.fsg-image-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Image - Full width */
.fsg-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    /* Fallback for mobile */
    min-height: 200px;
    background: rgba(255, 255, 255, 0.02);
}

.fsg-image.loaded {
    opacity: 1;
    min-height: auto;
}

.fsg-image.zoomed {
    cursor: zoom-out;
    width: 150%;
    max-width: none;
}

/* Ensure images are visible if JS fails */
.fsg-modal.active .fsg-image[src] {
    opacity: 1;
}

/* Scroll indicator */
.fsg-scroll-indicator {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.fsg-scroll-indicator.visible {
    opacity: 0.6;
}

.fsg-scroll-indicator svg {
    width: 20px;
    height: 20px;
    animation: fsg-bounce 2s infinite;
}

@keyframes fsg-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(5px);
    }
    60% {
        transform: translateY(3px);
    }
}

/* Loader */
.fsg-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.fsg-image-wrapper.loading .fsg-loader {
    display: block;
}

.fsg-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fsg-spin 0.8s linear infinite;
}

@keyframes fsg-spin {
    to { transform: rotate(360deg); }
}

/* Thumbnails - Fixed at bottom */
.fsg-thumbnails {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 70%, transparent 100%);
    padding: 20px 30px 30px;
    transition: opacity 0.3s ease;
    z-index: 15;
    display: none;
}

.fsg-modal.hide-ui .fsg-thumbnails {
    opacity: 0;
    transform: translateY(20px);
}

.fsg-thumbnails-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
    padding: 5px 0;
}

.fsg-thumbnails-track::-webkit-scrollbar {
    height: 4px;
}

.fsg-thumbnails-track::-webkit-scrollbar-track {
    background: transparent;
}

.fsg-thumbnails-track::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.fsg-thumbnail {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.fsg-thumbnail:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.fsg-thumbnail.active {
    border-color: #fff;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

.fsg-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.fsg-thumbnail:hover img {
    transform: scale(1.1);
}

/* Mobile Optimizations */
@media (max-width: 768px) {

    #fsg-modal{
        display: none;
    }


    #.modal{
        display: none;
    }

    .fsg-modal-header {
        padding: 15px 20px;
    }

    .fsg-nav {
        width: 44px;
        height: 44px;
    }

    .fsg-nav-prev {
        left: 10px;
    }

    .fsg-nav-next {
        right: 10px;
    }

    .fsg-thumbnails {
        padding: 15px 20px 20px;
    }

    .fsg-thumbnail {
        width: 60px;
        height: 60px;
    }

    .fsg-scroll-indicator {
        bottom: 120px;
    }
    
    /* Force image loading on mobile */
    .fsg-image {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .fsg-image-wrapper.loading .fsg-image {
        opacity: 0 !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .fsg-nav:hover,
    .fsg-close:hover,
    .fsg-thumbnail:hover {
        transform: none;
    }
}

/* Animations */
.fsg-fade-in {
    animation: fsgFadeIn 0.3s ease forwards;
}

@keyframes fsgFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Focus Styles */
.fsg-close:focus,
.fsg-nav:focus,
.fsg-thumbnail:focus {
    outline: 2px solid #000000;

}

/* No Scroll on Body */
body.fsg-no-scroll {
    overflow: hidden;
}