/* VSA Gallery Lightbox Styles - Enhanced with Branded Navigation */

/* Enhanced Lightbox Container */
.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: 10000; 
}

.k250-scope .k250-lightbox.active { 
    display: block;
}

/* VSA Branded Navigation Bar */
.k250-scope .vsa-nav-bar {
    position: absolute;
    top: 60px; /* Positioned below typical website navbar */
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.7));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 20px;
    z-index: 10002;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-sizing: border-box;
}

.k250-scope .vsa-nav-brand {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(45deg, #4a90e2, #63b3ed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    user-select: none;
}

.k250-scope .vsa-nav-folder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-align: center;
    white-space: nowrap;
}

.k250-scope .vsa-nav-folder span[id*="folder-name"] {
    font-weight: 600;
    color: #63b3ed;
}

.k250-scope .vsa-nav-divider {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
}

.k250-scope .vsa-nav-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

.k250-scope .vsa-nav-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    outline: none;
}

.k250-scope .vsa-nav-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-1px);
}

.k250-scope .vsa-nav-btn:active {
    transform: translateY(0);
}

.k250-scope .vsa-nav-btn.vsa-nav-close {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.4);
    padding: 8px 12px;
    font-size: 20px;
    line-height: 1;
}

.k250-scope .vsa-nav-btn.vsa-nav-close:hover {
    background: rgba(220, 53, 69, 0.4);
    border-color: rgba(220, 53, 69, 0.6);
}

.k250-scope .vsa-nav-folder span[id*="lightbox-counter"] {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: normal;
}

/* Lightbox Content Area - adjusted for nav bar */
.k250-scope .lightbox-content-wrapper {
    position: absolute;
    top: 110px; /* Account for website navbar (60px) + VSA nav bar (50px) */
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
    box-sizing: border-box;
}

.k250-scope .lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Deep Zoom Viewer Frame */
.k250-scope .deepzoom-viewer {
    width: 100%;
    height: 100%;
    max-width: 95vw;
    max-height: calc(95vh - 110px); /* Adjusted for both navbars */
    border-radius: 8px;
    border: none;
}

/* Info Panel - Desktop only */
@media (min-width: 769px) {
    .k250-scope .lightbox-info {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.8);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 8px;
        padding: 10px 20px;
        color: white;
        max-width: 600px;
        z-index: 10002;
        transition: all 0.3s ease;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    }
}

.k250-scope .lightbox-info.collapsed {
    opacity: 0.7;
    transform: translateX(-50%) translateY(10px);
}

.k250-scope .lightbox-info.expanded {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.k250-scope .lightbox-info-toggle {
    cursor: pointer;
    float: right;
    margin-left: 10px;
    user-select: none;
}

.k250-scope .lightbox-info-content {
    overflow: hidden;
}

.k250-scope .lightbox-title {
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: 500;
}

.k250-scope .lightbox-details {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

/* Loading indicator */
.k250-scope .loading {
    color: white;
    font-size: 16px;
    padding: 20px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    /* Two-line mobile navigation bar */
    .k250-scope .vsa-nav-bar {
        display: flex;
        flex-direction: column;
        padding: 8px 10px;
        height: auto;
        min-height: 90px;
        top: 50px; /* Adjust for mobile navbar height */
        grid-template-columns: none; /* Override grid */
    }
    
    /* Top row: Brand and folder info */
    .k250-scope .vsa-nav-mobile-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .k250-scope .vsa-nav-brand {
        font-size: 13px;
        letter-spacing: 1px;
    }
    
    .k250-scope .vsa-nav-folder {
        font-size: 12px;
        gap: 6px;
        justify-content: flex-end;
        flex: 1;
        text-align: right;
    }
    
    .k250-scope .vsa-nav-folder span[id*="folder-name"] {
        font-size: 13px;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .k250-scope .vsa-nav-folder span[id*="lightbox-counter"] {
        font-size: 11px;
        white-space: nowrap;
    }
    
    /* Bottom row: Large touch-friendly buttons */
    .k250-scope .vsa-nav-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 10px;
        padding-top: 8px;
    }
    
    .k250-scope .vsa-nav-btn {
        flex: 1;
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 600;
        min-height: 44px; /* iOS touch target size */
        border-radius: 8px;
        background: rgba(255,255,255,0.15);
    }
    
    .k250-scope .vsa-nav-btn:active {
        background: rgba(255,255,255,0.25);
        transform: scale(0.98);
    }
    
    .k250-scope .vsa-nav-btn.vsa-nav-close {
        flex: 0 0 auto;
        padding: 12px 16px;
        min-width: 44px;
        background: rgba(220, 53, 69, 0.3);
    }
    
    .k250-scope .lightbox-content-wrapper {
        top: 140px; /* 50px mobile navbar + 90px VSA nav */
        padding: 10px;
    }
    
    .k250-scope .deepzoom-viewer {
        max-height: calc(100vh - 150px);
    }
    
    /* Hide info panel on mobile */
    .k250-scope .lightbox-info {
        display: none !important;
    }
}

/* Ultra-wide screen optimizations */
@media (min-width: 1920px) {
    .k250-scope .vsa-nav-bar {
        padding: 0 40px;
    }
    
    .k250-scope .vsa-nav-brand {
        font-size: 18px;
    }
    
    .k250-scope .vsa-nav-btn {
        padding: 10px 20px;
        font-size: 15px;
    }
    
    .k250-scope .vsa-nav-counter {
        font-size: 15px;
    }
}

/* Keyboard focus styles for accessibility */
.k250-scope .vsa-nav-btn:focus {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: 2px;
}

/* Animation for lightbox opening */
.k250-scope .k250-lightbox.active {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Ensure content doesn't overflow on small screens */
.k250-scope .lightbox-content img,
.k250-scope .lightbox-content iframe {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}