/**
 * ================================================================
 * SCHNEIDERLEICHT - Lightbox Gallery
 * ================================================================
 * Elegante Bildbetrachtung für Galerien
 * ================================================================
 */

/* Lightbox Overlay */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

/* Lightbox Content Container */
.lightbox__container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}

@media (max-width: 768px) {
    .lightbox__container {
        padding: 60px 16px;
    }
}

/* Main Image */
.lightbox__image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__image {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Close Button */
.lightbox__close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox__close .material-icons-outlined {
    font-size: 28px;
    color: white;
}

/* Navigation Arrows */
.lightbox__nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox__nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox__nav:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
}

.lightbox__nav .material-icons-outlined {
    font-size: 32px;
    color: white;
}

.lightbox__prev {
    left: 20px;
}

.lightbox__next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox__nav {
        width: 44px;
        height: 44px;
    }

    .lightbox__prev {
        left: 8px;
    }

    .lightbox__next {
        right: 8px;
    }

    .lightbox__nav .material-icons-outlined {
        font-size: 28px;
    }
}

/* Header with Info */
.lightbox__header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 80px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
}

@media (max-width: 768px) {
    .lightbox__header {
        padding: 16px;
    }
}

.lightbox__title {
    color: white;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.lightbox__counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Footer with Actions */
.lightbox__footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 80px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 5;
}

@media (max-width: 768px) {
    .lightbox__footer {
        padding: 16px;
        gap: 12px;
    }
}

.lightbox__action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lightbox__action:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox__action .material-icons-outlined {
    font-size: 20px;
}

/* Thumbnail Strip */
.lightbox__thumbnails {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    max-width: calc(100% - 40px);
    overflow-x: auto;
    z-index: 5;
}

.lightbox__thumbnails::-webkit-scrollbar {
    height: 4px;
}

.lightbox__thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.lightbox__thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.lightbox__thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.lightbox__thumb:hover {
    opacity: 0.8;
}

.lightbox__thumb.active {
    opacity: 1;
    border-color: white;
}

/* Loading State */
.lightbox__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
}

.lightbox__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: lightboxSpin 0.8s linear infinite;
}

@keyframes lightboxSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Zoom functionality */
.lightbox__image.zoomed {
    cursor: zoom-out;
    max-width: none;
    max-height: none;
}

.lightbox__image:not(.zoomed) {
    cursor: zoom-in;
}

/* Caption */
.lightbox__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    color: white;
    text-align: center;
}

.lightbox__caption-text {
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* Gallery Item Hover Effect */
.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    background: rgba(0, 0, 0, 0.2);
}

.gallery-item__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.gallery-item:hover .gallery-item__overlay {
    opacity: 1;
}

.gallery-item__icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item__icon {
    transform: scale(1);
}

.gallery-item__icon .material-icons-outlined {
    font-size: 24px;
    color: #1f2937;
}
