/* 
 * Kaisergarten Restaurant - Lightbox CSS
 * Styling für die Lightbox-Galerie
 */

/* Lightbox Container */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-index-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* Overlay */
.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1;
}

/* Lightbox Content */
.lightbox-content {
    position: relative;
    z-index: 2;
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Bild-Container */
.lightbox-image-container {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow);
}

/* Bild */
.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    transition: transform var(--transition-speed) ease;
}

/* Bildunterschrift */
.lightbox-caption {
    color: var(--text-light);
    padding: 1rem;
    text-align: center;
    font-size: var(--font-size-md);
    max-width: 800px;
    margin-top: 1rem;
}

/* Navigationspfeile */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--text-light);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    font-size: var(--font-size-lg);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
    background-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev:focus,
.lightbox-next:focus,
.lightbox-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring-color);
}

.lightbox-prev.disabled,
.lightbox-next.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Schließen-Button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 3;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--text-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    font-size: var(--font-size-lg);
}

.lightbox-close:hover {
    background-color: var(--primary-color);
    transform: scale(1.1);
}

/* Zähler */
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-light);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-sm);
    z-index: 3;
}

/* Animationen */
.lightbox-image.slide-left {
    animation: slideLeft 0.3s forwards;
}

.lightbox-image.slide-right {
    animation: slideRight 0.3s forwards;
}

@keyframes slideLeft {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Verhindert Scrollen des Hintergrunds */
body.lightbox-open {
    overflow: hidden;
}

/* Barrierefreiheit - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .lightbox,
    .lightbox-image,
    .lightbox-prev,
    .lightbox-next,
    .lightbox-close {
        transition: none;
    }
    
    .lightbox-image.slide-left,
    .lightbox-image.slide-right {
        animation: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .lightbox-caption {
        font-size: var(--font-size-base);
        padding: 0.5rem;
    }
}

/* Verbesserte Touch-Interaktionen für mobile Geräte */
@media (hover: none) and (pointer: coarse) {
    .lightbox-prev,
    .lightbox-next,
    .lightbox-close {
        background-color: rgba(0, 0, 0, 0.7);
        width: 50px;
        height: 50px;
    }
    
    .lightbox-close {
        width: 44px;
        height: 44px;
    }
}
