/* Лайтбокс – общий фон */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.lightbox-overlay.show {
    opacity: 1;
}

/* Контейнер для изображения */
.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    transition: transform 0.2s ease;
    cursor: zoom-in;
}

/* Верхняя панель инструментов */
.lightbox-toolbar {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    border-radius: 40px;
    margin: 0 20px;
    z-index: 10001;
    color: white;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.lightbox-counter {
    font-size: 14px;
    font-weight: 500;
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 30px;
}

.lightbox-center {
    display: flex;
    gap: 20px;
}

.lightbox-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 30px;
    transition: background 0.2s;
}

.lightbox-btn i {
    font-size: 18px;
}

.lightbox-btn:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.lightbox-right .lightbox-btn {
    padding: 6px 10px;
}

.lightbox-close {
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 0;
}

/* Стрелки навигации (по бокам) */
.lightbox-prev, .lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    color: white;
    background: rgba(0,0,0,0.4);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10002;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(0,0,0,0.8);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .lightbox-toolbar {
        margin: 10px 10px;
        padding: 6px 12px;
    }
    .lightbox-btn span {
        display: none;
    }
    .lightbox-btn i {
        font-size: 20px;
    }
    .lightbox-center .lightbox-btn {
        padding: 6px;
    }
    .lightbox-prev, .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 32px;
    }
}

/* Плавный зум с панорамированием (перетаскивание) */
.lightbox-image {
    transition: transform 0.2s ease;
    cursor: grab;
}
.lightbox-image.dragging {
    cursor: grabbing;
}

/* стиль для видео в модалке */
.lightbox-video {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

/* Блок с описанием внизу */
.lightbox-caption {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    color: white;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 14px;
    max-width: 80vw;
    text-align: center;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    z-index: 10001;
    white-space: normal;
    word-break: break-word;
    pointer-events: none; /* чтобы не мешать кликам по кнопкам */
}

@media (max-width: 768px) {
    .lightbox-caption {
        bottom: 20px;
        font-size: 12px;
        padding: 6px 15px;
        max-width: 90vw;
    }
}

.lightbox-tags-block {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    border-radius: 40px;
    padding: 8px 16px;
    color: white;
    font-size: 13px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 10001;
    flex-wrap: wrap;
    justify-content: center;
}
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}
.lightbox-btn-sm {
    background: transparent;
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
}
.lightbox-btn-sm:hover {
    background: rgba(255,255,255,0.2);
}
#lightboxTagsInput {
    width: 200px;
    padding: 4px 8px;
    font-size: 12px;
}
@media (max-width: 768px) {
    .lightbox-tags-block {
        bottom: 80px;
        padding: 5px 12px;
    }
    .tag { font-size: 10px; }
}

.lightbox-tags-block {
    display: flex !important;
}

#lightboxSlideshow {
    background: transparent;
    transition: 0.2s;
}
#lightboxSlideshow:hover {
    background: rgba(255,255,255,0.2);
}

#lightboxShortcutsHelp {
    margin-left: 5px;
}
kbd {
    background: #222;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-weight: bold;
    color: #ffd966;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    display: inline-block;
}

.lightbox-caption.hide-info,
.lightbox-tags-block.hide-info {
    display: none !important;
}