/* VSA Gallery Styles - Refactored with k250-scope namespace */

/* Scoped styles under .k250-scope to prevent conflicts */
.k250-scope {
    max-width: 1400px;
    margin: 0 auto;
    font-family: 'Poppins', sans-serif;
    color: #ffffff;
}

/* Gallery Header */
.k250-scope .k250-gallery__header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
}

.k250-scope .k250-gallery__stats {
    font-family: 'Poppins', sans-serif;
    color: #888;
    font-size: 14px;
    font-weight: 300;
}

/* Gallery Controls */
.k250-scope .k250-gallery__controls {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.k250-scope .k250-gallery__btn {
    font-family: 'Poppins', sans-serif;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
}

.k250-scope .k250-gallery__btn:hover {
    background: #333;
    border-color: #555;
}

.k250-scope .k250-gallery__search {
    font-family: 'Poppins', sans-serif;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 16px;
    border-radius: 6px;
    width: 300px;
    max-width: 100%;
    font-size: 14px;
}

.k250-scope .k250-gallery__search:focus {
    outline: none;
    border-color: #555;
}

/* Main Gallery Container */
.k250-scope .k250-gallery {
    padding: 20px;
}

/* Folder Sections */
.k250-scope .k250-folder-section {
    margin-bottom: 30px;
}

.k250-scope .k250-folder-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 25px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.k250-scope .k250-folder-header:hover {
    background: #222;
    border-color: #555;
}

.k250-scope .k250-folder-toggle {
    margin-right: 15px;
    font-size: 16px;
    transition: transform 0.3s ease;
    color: #ccc;
}

.k250-scope .k250-folder-toggle.collapsed {
    transform: rotate(-90deg);
}

.k250-scope .k250-folder-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.k250-scope .k250-folder-count {
    font-size: 14px;
    color: #888;
    font-weight: 300;
}

/* Folder Content Grid */
.k250-scope .k250-folder-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 0 10px;
    animation: fadeIn 0.3s ease;
}

.k250-scope .k250-folder-content.collapsed {
    display: none;
}

/* Image Cards */
.k250-scope .k250-image-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.k250-scope .k250-image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: #555;
}

.k250-scope .k250-image-container {
    position: relative;
    aspect-ratio: 1;
    background: #0a0a0a;
    overflow: hidden;
}

/* IMPORTANT: Use contain to prevent cropping of vertical images */
.k250-scope .k250-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;  /* This prevents cropping */
    transition: transform 0.3s ease;
}

.k250-scope .k250-image-card:hover .k250-image-container img {
    transform: scale(1.05);
}

/* Lazy loading placeholder */
.k250-scope img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.k250-scope img.lazy[src] {
    opacity: 1;
}

/* Image Info */
.k250-scope .k250-image-info {
    padding: 15px;
    background: #1a1a1a;
}

.k250-scope .k250-image-title {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.k250-scope .k250-image-path {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges */
.k250-scope .pdf-badge,
.k250-scope .deepzoom-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.k250-scope .pdf-badge {
    background: rgba(255, 59, 48, 0.2);
    border-color: rgba(255, 59, 48, 0.3);
}

.k250-scope .deepzoom-badge {
    background: rgba(52, 199, 89, 0.2);
    border-color: rgba(52, 199, 89, 0.3);
}

/* Lightbox */
.k250-scope .k250-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    animation: fadeIn 0.3s ease;
}

.k250-scope .k250-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.k250-scope .lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s ease;
}

.k250-scope .lightbox-close:hover {
    transform: scale(1.2);
}

.k250-scope .lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 40px;
    box-sizing: border-box;
}

/* IMPORTANT: Lightbox images should also use contain */
.k250-scope .lightbox-content img {
    max-width: 90% !important;
    max-height: 90% !important;
    object-fit: contain !important;  /* Prevents cropping in lightbox */
    border-radius: 4px;
    pointer-events: auto;  /* Image can receive clicks */
    position: relative;
    z-index: 100002;
}

.k250-scope .lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.k250-scope .lightbox-info.expanded {
    transform: translateY(0);
}

.k250-scope .lightbox-info.collapsed {
    transform: translateY(calc(100% - 40px));
}

.k250-scope .lightbox-info-toggle {
    position: absolute;
    top: -40px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
}

.k250-scope .lightbox-info-content {
    max-width: 800px;
    margin: 0 auto;
}

.k250-scope .lightbox-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fff;
}

.k250-scope .lightbox-details {
    font-size: 14px;
    color: #888;
}

/* Navigation Strip */
.k250-scope .lightbox-nav-strip {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 10px 20px;
    z-index: 10001;
}

.k250-scope .lightbox-nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.k250-scope .lightbox-nav-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 20px;
    transition: all 0.3s ease;
}

.k250-scope .lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.k250-scope .lightbox-counter {
    color: #fff;
    font-size: 14px;
    min-width: 80px;
    text-align: center;
}

/* Loading State */
.k250-scope .loading {
    color: #888;
    font-size: 14px;
    text-align: center;
}

/* Deep Zoom Viewer */
.k250-scope .deepzoom-viewer {
    width: 95vw;
    height: 95vh;
    border-radius: 8px;
    border: none;
}

/* PDF Viewer - Now using same approach as images with inline styles */
/* Removed complex CSS since PDFs now use the same container structure as images */

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .k250-scope .k250-gallery__controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .k250-scope .k250-gallery__search {
        width: 100%;
    }
    
    .k250-scope .k250-folder-content {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .k250-scope .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .k250-scope .k250-folder-content {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .k250-scope .k250-folder-header {
        padding: 15px;
    }
    
    .k250-scope .k250-folder-title {
        font-size: 16px;
    }
}

/* Webflow Integration Fixes */

/* Override Webflow's div-block styles that affect gallery */
.div-block.galleryinject .k250-scope,
.w-embed .k250-scope {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
}

/* Fix for technical page's galleryinject container */
.div-block.galleryinject {
    width: 100% !important;  /* Override the 90% width */
    max-width: 100% !important;
    padding: 0 !important;  /* Remove the 20px padding */
}

/* Ensure parallax containers don't affect lightbox positioning */
.parallax-section .k250-lightbox,
.parallax-content1 .k250-lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* Fix z-index issues with Webflow elements */
.k250-scope {
    position: relative;
    z-index: 1;
}

/* Ensure lightbox is above all Webflow elements */
.k250-scope .k250-lightbox {
    z-index: 99999 !important;
}

.k250-scope .lightbox-content {
    z-index: 100000 !important;
}

.k250-scope .pdf-viewer {
    z-index: 100001 !important;
}

/* Reset inherited Webflow styles on gallery container */
.w-embed .k250-scope *,
.code-embed-4 .k250-scope * {
    box-sizing: border-box;
}

/* Ensure controls aren't affected by Webflow container widths */
.k250-scope .k250-gallery__controls {
    width: 100% !important;
    max-width: 100% !important;
}