#lightboxModal {
    z-index: 1001;
    transition: background-color 0.4s ease;
}

.ambient-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12vw;
    height: 12vh;
    transform: translate(-50%, -50%) scale(10);
    background-color: var(--ambient-color, transparent);
    filter: blur(15px);
    opacity: 0.5;
    z-index: 0;
    transition: background-color 0.4s ease;
    pointer-events: none;
    border-radius: 50%;
    will-change: background-color;
}

[data-theme="light"] .ambient-bg {
    opacity: 0.3;
}

.lightbox-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.lightbox-img {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 10px;
    cursor: grab;
    user-select: none;
    opacity: 0;
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
    z-index: 2;
}

#lbThumb {
    z-index: 1;
}

.lightbox-img.loaded {
    opacity: 1;
}

.lightbox-img.panning {
    transition: opacity 0.3s ease;
}

.lightbox-close-btn {
    color: white;
    z-index: 20;
}

.lightbox-compact-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    color: white;
    padding: 40px 30px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 10;
}

@media (hover: hover) {
    .lightbox-wrapper:hover .lightbox-compact-info {
        opacity: 1;
        pointer-events: auto;
    }
}

.lightbox-wrapper.show-similar .lightbox-compact-info {
    transform: translateY(-110px);
}

.lb-title-flex {
    margin: 0;
    line-height: 1.4;
    padding-left: 32px;
    display: block;
}

.lb-fav-wrapper {
    position: relative;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-right: 8px;
    margin-left: -32px;
}

#lbTitle {
    vertical-align: middle;
}

.lb-desc-text {
    margin: 5px 0 0;
    color: #ddd;
}

.lb-location-container {
    color: var(--accent);
    font-size: 14px;
    margin-top: 5px;
    display: none;
    align-items: center;
}

.lb-location-text {
    display: flex;
    align-items: center;
}

.lb-tags-container {
    margin-top: 10px;
}

.lb-bottom-controls {
    display: flex;
    align-items: center;
    position: relative;
}

.lb-date-text {
    color: #ccc;
    font-size: 13px;
    margin-left: 15px;
}

.similar-images-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 110px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 30px;
    gap: 15px;
    overflow-x: auto;
    z-index: 50;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.lightbox-wrapper.show-similar .similar-images-strip {
    transform: translateY(0);
}

.similar-thumb-wrapper {
    position: relative;
    flex-shrink: 0;
}

.similar-match-icon {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent);
    color: white;
    font-size: 10px;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 2;
}

.similar-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
    flex-shrink: 0;
    opacity: 0.8;
}

@media (hover: hover) {
    .similar-thumb:hover {
        border-color: var(--accent);
        transform: translateY(-3px);
        opacity: 1;
    }
}

.similar-empty-msg {
    color: #aaa;
    margin: auto;
    font-size: 14px;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(1);
    background: color-mix(in srgb, var(--ambient-color, rgba(255, 255, 255, 0.3)) 20%, rgba(255, 255, 255, 0.15));
    color: white;
    border: 1px solid color-mix(in srgb, var(--ambient-color, rgba(255, 255, 255, 0.4)) 30%, rgba(255, 255, 255, 0.25));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
}

@media (hover: hover) {
    .lightbox-wrapper:hover .gallery-nav-btn {
        opacity: 1;
    }

    .gallery-nav-btn:hover {
        background: color-mix(in srgb, var(--ambient-color, rgba(255, 255, 255, 0.5)) 40%, rgba(255, 255, 255, 0.3));
        border-color: color-mix(in srgb, var(--ambient-color, white) 50%, rgba(255, 255, 255, 0.6));
        box-shadow: 0 10px 30px color-mix(in srgb, var(--ambient-color, rgba(0, 0, 0, 0.2)) 40%, rgba(0, 0, 0, 0.2));
        transform: translateY(-50%) scale(1.08);
    }
}

.gallery-nav-btn svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.nav-next {
    left: 20px;
}

.nav-prev {
    right: 20px;
}

.exif-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 5px;
    cursor: pointer;
    transition: 0.3s;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) {
    .exif-btn:hover {
        background: transparent;
        outline: none;
        color: var(--accent);
        transform: rotate(90deg);
    }
}

.exif-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.similar-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 5px;
    cursor: pointer;
    transition: 0.3s;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.similar-btn.active {
    background: transparent;
    outline: none;
    color: var(--accent);
    transform: scale(1.1);
}

@media (hover: hover) {
    .similar-btn:hover {
        background: transparent;
        outline: none;
        color: var(--accent);
        transform: scale(1.1);
    }
}

.similar-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.ba-toggle-btn {
    background: var(--surface);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    font-family: inherit;
    font-size: 13px;
    margin-left: 10px;
}

@media (hover: hover) {
    .ba-toggle-btn:hover {
        background: var(--accent);
        border-color: var(--accent);
    }
}

.ba-toggle-btn.active {
    background: var(--accent);
    border-color: white;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.6);
}

.exif-panel {
    position: absolute;
    bottom: 50px;
    left: 0;
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 280px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100;
    
    visibility: hidden;
    opacity: 0;
    transform: translateY(15px) scale(0.98);
    pointer-events: none;
    max-height: 80px;
    overflow: hidden;
    transition: max-height 0.6s ease-in-out, 
                opacity 0.3s ease, 
                transform 0.4s ease-out,
                visibility 0.4s;
}

.exif-panel.show-exif {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.exif-panel.show-exif.loaded,
.exif-panel.loaded {
    max-height: 500px;
}

.exif-panel::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 10px;
    width: 14px;
    height: 14px;
    background: var(--surface-glass);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

[data-theme="light"] .exif-panel {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .exif-panel::after {
    border-color: rgba(0, 0, 0, 0.1);
}

.exif-cam-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .exif-cam-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.exif-cam-icon {
    font-size: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

[data-theme="light"] .exif-cam-icon {
    background: rgba(0, 0, 0, 0.05);
}

.exif-cam-details {
    display: flex;
    flex-direction: column;
}

.exif-cam-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exif-cam-val {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.exif-stats-grid {
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    text-align: center;
}

.exif-stat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

[data-theme="light"] .exif-stat-box {
    background: rgba(0, 0, 0, 0.03);
}

.exif-stat-box .icon {
    font-size: 16px;
    margin-bottom: 2px;
    color: var(--text-muted);
    font-family: "Segoe UI Symbol", sans-serif;
}

.exif-stat-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.exif-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.exif-meta-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.exif-meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.exif-meta-item .label {
    color: var(--text-muted);
}

.exif-meta-item .val {
    color: var(--text);
    font-weight: 500;
}

.top-controls-lb {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
    opacity: 0;
    transition: 0.3s;
}

@media (hover: hover) {
    .lightbox-wrapper:hover .top-controls-lb {
        opacity: 1;
    }
}

.tag-badge {
    background-color: rgba(255, 255, 255, 0.15);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    padding: 5px 12px;
    border-radius: 15px;
    display: inline-block;
    margin: 8px 0 0 5px;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 13px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) {
    .tag-badge:hover {
        background-color: color-mix(in srgb, var(--ambient-color, rgba(255, 255, 255, 0.5)) 40%, rgba(255, 255, 255, 0.3));
        border-color: color-mix(in srgb, var(--ambient-color, white) 50%, rgba(255, 255, 255, 0.6));
        border-top-color: color-mix(in srgb, var(--ambient-color, white) 70%, rgba(255, 255, 255, 0.8));
        transform: translateY(-1px);
        box-shadow: 0 4px 15px color-mix(in srgb, var(--ambient-color, rgba(0, 0, 0, 0.4)) 40%, rgba(0, 0, 0, 0.3));
    }
}

.tag-hidden-state {
    opacity: 0 !important;
    transform: scale(0.8) translateY(10px) !important;
    pointer-events: none !important;
}

.tag-show-more-btn {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    height: 28px;
    padding: 0 12px;
    border-radius: 15px;
    display: inline-block;
    margin: 8px 0 0 5px;
    cursor: pointer;
    transition: all 0.4s ease;
    border: 1px dashed rgba(255, 255, 255, 0.45);
    box-sizing: border-box;
}

@media (hover: hover) {
    .tag-show-more-btn:hover {
        background: color-mix(in srgb, var(--ambient-color, rgba(255, 255, 255, 0.5)) 25%, rgba(255, 255, 255, 0.15));
        border-color: color-mix(in srgb, var(--ambient-color, white) 50%, rgba(255, 255, 255, 0.8));
        border-style: solid;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 15px color-mix(in srgb, var(--ambient-color, rgba(0, 0, 0, 0.4)) 40%, rgba(0, 0, 0, 0.3));
    }
}

.lightbox-wrapper:fullscreen .lightbox-compact-info,
.lightbox-wrapper:-webkit-full-screen .lightbox-compact-info,
.lightbox-wrapper:fullscreen .top-controls-lb,
.lightbox-wrapper:-webkit-full-screen .top-controls-lb,
.lightbox-wrapper:fullscreen .similar-images-strip,
.lightbox-wrapper:-webkit-full-screen .similar-images-strip,
.lightbox-wrapper:fullscreen .exif-panel,
.lightbox-wrapper:-webkit-full-screen .exif-panel {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.lightbox-wrapper:fullscreen .gallery-nav-btn,
.lightbox-wrapper:-webkit-full-screen .gallery-nav-btn {
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 100;
}

.lightbox-wrapper.ui-hidden .lightbox-compact-info,
.lightbox-wrapper.ui-hidden .top-controls-lb,
.lightbox-wrapper.ui-hidden .similar-images-strip,
.lightbox-wrapper.ui-hidden .exif-panel {
    opacity: 0 !important;
    pointer-events: none !important;
}

.share-mobile-text {
    display: none;
}

.share-mobile-item {
    display: none;
}

.lb-high-res-loader {
    position: absolute;
    bottom: 150px;
    right: 25px;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: lbSpin 1s linear infinite;
    z-index: 5;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    pointer-events: none;
}

.lb-high-res-loader.show {
    opacity: 1;
    visibility: visible;
}

@keyframes lbSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

[data-theme="light"] .top-controls-lb button {
    background: rgba(255, 255, 255, 0.85);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

@media (hover: hover) {
    [data-theme="light"] .top-controls-lb button:hover {
        background: var(--surface-hover);
        color: #000;
        border-color: rgba(0, 0, 0, 0.3);
    }

    [data-theme="light"] .lb-share-item:hover {
        background: rgba(0, 0, 0, 0.05);
    }
}

[data-theme="light"] .lb-high-res-loader {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent);
}

.exif-histogram {
    width: 100%;
    height: 80px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}