/* Simple Gallery Grid - Clean and Minimal */

/* YouTube container styles */
.gallery-main-youtube-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main-youtube-container iframe {
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 16/9;
}

/* YouTube thumbnail overlay */
.youtube-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.youtube-play-button {
    width: 40px;
    height: 40px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

/* Video Overlay Styles */
.video-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    transition: opacity 0.3s ease !important;
}

.video-overlay:hover {
    opacity: 0.8 !important;
}

.play-button {
    width: 40px !important;
    height: 40px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.play-button:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: scale(1.1) !important;
}

/* Thumbnail Video Styles */
.thumbnail-item {
    position: relative !important;
}

.thumbnail-item video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Gallery Main Video Styles */
.gallery-main-image video {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

.gallery-main-video-container {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.5s ease-in-out, opacity 0.3s ease-in-out !important;
}

.gallery-main-video-container video {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

.gallery-main-video-container.slide-active {
    transform: translateX(0) !important;
    opacity: 1 !important;
}

.gallery-main-video-container.slide-out-left {
    transform: translateX(-100%) !important;
    opacity: 0 !important;
}

.gallery-main-video-container.slide-out-right {
    transform: translateX(100%) !important;
    opacity: 0 !important;
}

.gallery-container {
    position: relative !important;
    width: 100% !important;
    height: 80vh !important;
    overflow: hidden !important;
}
.gallery-container::before,
.gallery-container::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    height: 30px !important;
    pointer-events: none !important;
    z-index: 5 !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}
.gallery-container::before {
    top: 0 !important;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%) !important;
}
.gallery-container::after {
    bottom: 0 !important;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%) !important;
}
.gallery-container.show-top-blur::before {
    opacity: 1 !important;
}
.gallery-container.show-bottom-blur::after {
    opacity: 1 !important;
}
.project-gallery-simple-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
    width: 100% !important;
    max-height: 80vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    position: relative !important;
    box-sizing: border-box !important;
    /* Hide scrollbar */
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* Internet Explorer 10+ */
    padding: 5px !important;
}
.project-gallery-simple-grid::-webkit-scrollbar {
    display: none !important; /* WebKit */
}
/* Custom Scroll Arrows */
.gallery-scroll-arrow {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 40px !important;
    height: 40px !important;
    background-color: #f2cd8c !important;
    border: 2px solid #ffffff !important;
    border-radius: 0px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 10 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    transition: all 0.3s ease !important;
}
.gallery-scroll-arrow.up {
    top: 20px !important;
}
.gallery-scroll-arrow.down {
    bottom: 50px !important;
}
.gallery-scroll-arrow i {
    width: 16px !important;
    height: 16px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    filter: brightness(0) invert(1) !important; /* Makes SVG white */
}
.gallery-scroll-arrow.up i {
    background-image: url('chevron-up-solid-full.svg') !important;
}
.gallery-scroll-arrow.down i {
    background-image: url('chevron-down-solid-full.svg') !important;
}
.gallery-simple-item {
    width: 100% !important;
    aspect-ratio: 1.4 / 1 !important;
    position: relative !important;
    min-height: 0 !important;
    overflow: hidden !important;
    transition: transform 0.3s ease-in-out, border 0.3s ease-in-out, box-shadow 0.3s ease-in-out !important;
    border: 1px solid #FFFFFF33 !important;
    cursor: pointer !important;
}
.gallery-simple-item:hover {
    border: 1px solid #f2cd8c !important;
    box-shadow: 3px 3px 0px #ffffff !important;
}
@media (max-width: 768px) {
  .gallery-simple-item:hover {
    border: 1px solid #f2cd8c !important;
    box-shadow: 2px 2px 0px #ffffff !important;
  }
}
.gallery-simple-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}
/* Responsive Design */
@media (max-width: 768px) {
    .project-gallery-simple-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        max-height: 80vh !important;
    }
}

/* iPhone specific fixes */
@media screen and (max-width: 480px) {
    .project-gallery-simple-grid {
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: -ms-flexbox !important;
        display: flex !important;
        -webkit-flex-wrap: wrap !important;
        -ms-flex-wrap: wrap !important;
        flex-wrap: wrap !important;
        -webkit-justify-content: space-between !important;
        -ms-flex-pack: justify !important;
        justify-content: space-between !important;
        width: 100% !important;
        max-height: 75vh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative !important;
        box-sizing: border-box !important;
        padding: 5px !important;
        gap: 0 !important;
    }
    
    .gallery-simple-item {
        width: calc(50% - 5px) !important;
        height: auto !important;
        aspect-ratio: 1.2 / 1 !important;
        position: relative !important;
        min-height: 120px !important;
        max-height: 150px !important;
        overflow: hidden !important;
        transition: transform 0.3s ease-in-out, border 0.3s ease-in-out, box-shadow 0.3s ease-in-out !important;
        border: 1px solid #FFFFFF33 !important;
        cursor: pointer !important;
        box-sizing: border-box !important;
        margin-bottom: 10px !important;
        -webkit-flex-shrink: 0 !important;
        -ms-flex-negative: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .gallery-simple-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    .gallery-container {
        position: relative !important;
        width: 100% !important;
        height: 75vh !important;
        overflow: hidden !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
}

/* Extra small screens (iPhone SE, etc.) */
@media screen and (max-width: 375px) {
    .gallery-simple-item {
        width: calc(50% - 4px) !important;
        min-height: 100px !important;
        max-height: 130px !important;
        margin-bottom: 8px !important;
    }
    
    .gallery-container {
        height: 70vh !important;
    }
    
    .project-gallery-simple-grid {
        padding: 4px !important;
    }
}
/* Gallery Popup Styles */
.gallery-popup {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
    z-index: 1000 !important;
    justify-content: center !important;
    align-items: center !important;
}
.gallery-popup.active {
    display: flex !important;
}
.gallery-popup-content {
    width: 90% !important;
    max-width: 800px !important;
    height: 90% !important;
    max-height: 600px !important;
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
}
.gallery-main-image {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 1.5 / 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    overflow: hidden !important;
}
.gallery-main-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    transition: transform 0.5s ease-in-out, opacity 0.3s ease-in-out !important;
}

/* Slide Animation Classes */
.gallery-main-image img.slide-out-left {
    transform: translateX(-100%) !important;
    opacity: 0 !important;
}
.gallery-main-image img.slide-out-right {
    transform: translateX(100%) !important;
    opacity: 0 !important;
}
.gallery-main-image img.slide-in-left {
    transform: translateX(-100%) !important; /* Start from left side for previous navigation */
    opacity: 0 !important;
}
.gallery-main-image img.slide-in-right {
    transform: translateX(100%) !important; /* Start from right side for next navigation */
    opacity: 0 !important;
}
.gallery-main-image img.slide-active {
    transform: translateX(0) !important;
    opacity: 1 !important;
}

/* Fullscreen Button */
.gallery-fullscreen-btn {
    position: absolute !important;
    bottom: 10px !important;
    right: 10px !important;
    width: 24px !important;
    height: 24px !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 15 !important;
    transition: all 0.3s ease !important;
    opacity: 0.8 !important;
}
.gallery-fullscreen-btn:hover {
    background-color: rgba(0, 0, 0, 0.9) !important;
    opacity: 1 !important;
    transform: scale(1.1) !important;
}
.gallery-fullscreen-btn i {
    width: 16px !important;
    height: 16px !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="white" d="M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V352zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H320zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V352z"/></svg>') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* Fullscreen Mode */
.gallery-popup.fullscreen {
    background-color: rgba(0, 0, 0, 0.98) !important;
}
.gallery-popup.fullscreen .gallery-popup-content {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
}
.gallery-popup.fullscreen .gallery-main-image {
    aspect-ratio: auto !important;
    height: calc(100% - 100px) !important;
}

/* Navigation Arrows for Main Image */
.gallery-nav-arrow {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 30px !important;
    height: 30px !important;
    background-color: #f2cd8c !important;
    border: 2px solid #ffffff !important;
    border-radius: 0px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 10 !important;
    transition: all 0.3s ease !important;
    opacity: 0.7 !important;
}
.gallery-nav-arrow.prev {
    left: 20px !important;
}
.gallery-nav-arrow.next {
    right: 20px !important;
}
.gallery-nav-arrow i {
    width: 16px !important;
    height: 16px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    filter: brightness(0) invert(1) !important; /* Makes SVG white */
}
.gallery-nav-arrow.prev i {
    background-image: url('chevron-left-solid-full.svg') !important;
}
.gallery-nav-arrow.next i {
    background-image: url('chevron-right-solid-full.svg') !important;
}
.gallery-thumbnails {
    height: 100px !important;
    overflow: hidden !important;
    position: relative !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Thumbnail Navigation Arrows */
.thumbnail-nav-arrow {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 25px !important;
    height: 25px !important;
    background-color: #f2cd8c !important;
    border: 1px solid #ffffff !important;
    border-radius: 0px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 15 !important;
    transition: all 0.3s ease !important;
    opacity: 0.8 !important;
}

.thumbnail-nav-arrow.left {
    left: 5px !important;
}

.thumbnail-nav-arrow.right {
    right: 5px !important;
}

.thumbnail-nav-arrow:hover {
    opacity: 1 !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.thumbnail-nav-arrow i {
    width: 12px !important;
    height: 12px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    filter: brightness(0) invert(1) !important;
}

.thumbnail-nav-arrow.left i {
    background-image: url('chevron-left-solid-full.svg') !important;
}

.thumbnail-nav-arrow.right i {
    background-image: url('chevron-right-solid-full.svg') !important;
}

.thumbnail-slider {
    display: flex !important;
    gap: 10px !important;
    height: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 5px 40px !important; /* Add padding for arrows */
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    justify-content: flex-start !important;
    align-items: center !important;
}
.thumbnail-slider::-webkit-scrollbar {
    display: none !important;
}
.thumbnail-item {
    flex-shrink: 0 !important;
    width: 70px !important;
    height: 70px !important;
    cursor: pointer !important;
    opacity: 0.6 !important;
    transition: transform 0.3s ease-in-out !important;
    overflow: hidden !important;
    border: 1px solid #FFFFFF33 !important;
}
.thumbnail-item.active {
  opacity: 1 !important;
  border: 1px solid #f2cd8c !important;
  transform: scale(1.1) !important;
}
.thumbnail-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
/* Mobile Responsive */
@media (max-width: 768px) {
    .gallery-popup {
        padding: 10px !important;
        box-sizing: border-box !important;
    }
    
    .gallery-popup-content {
        width: 100% !important;
        height: auto !important;
        max-height: calc(100vh - 20px) !important;
        max-width: 100% !important;
        margin: auto !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }

    .gallery-main-image {
        aspect-ratio: 1.2 / 1 !important;
        height: auto !important;
        max-height: 60vh !important;
        margin-bottom: 15px !important;
    }

    .gallery-thumbnails {
        height: 60px !important;
        margin-top: auto !important;
    }

    .thumbnail-item {
        width: 50px !important;
        height: 50px !important;
    }
    
    /* Ensure popup content doesn't take full height on mobile */
    .gallery-popup-content {
        min-height: auto !important;
    }
    
    /* Better touch targets for mobile */
    .gallery-nav-arrow {
        width: 40px !important;
        height: 40px !important;
        touch-action: manipulation !important;
    }
    
    .gallery-fullscreen-btn {
        width: 32px !important;
        height: 32px !important;
        bottom: 15px !important;
        right: 15px !important;
    }
}
