/* Lightbox CSS - Wiederverwendbare Bildvergrößerung */

/* Klickbare Bilder */
.clickable-image {
    cursor: zoom-in;
    transition: opacity 0.3s ease;
}

.clickable-image:hover {
    opacity: 0.9;
}

/* Lightbox Overlay */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    cursor: zoom-out;
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Lightbox Content Container */
.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    animation: zoomIn 0.3s ease;
}

/* Lightbox Bild */
.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    cursor: grab;
    border-radius: 0.75rem; /* Abgerundete Ecken wie in funktionen.html (rounded-4 entspricht) */
}

.lightbox-image:active {
    cursor: grabbing;
}

/* Schließen-Button */
.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0 10px;
    transition: color 0.3s ease;
    user-select: none;
}

.lightbox-close:hover {
    color: #f8f9fa;
    transform: scale(1.1);
}

/* Bildunterschrift */
.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 20px;
    font-size: 1rem;
    padding: 0 20px;
}

/* Navigation Buttons (für zukünftige Galerie-Funktion) */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 0 20px;
    user-select: none;
    transition: opacity 0.3s ease;
}

.lightbox-nav:hover {
    opacity: 0.8;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Zoom Indicator */
.lightbox-zoom-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: white;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 4px;
    display: none;
}

.lightbox-zoom-indicator.active {
    display: block;
}

/* Animationen */
@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 100%;
        max-height: 100%;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .lightbox-nav {
        font-size: 2rem;
        padding: 0 10px;
    }
    
    .lightbox-caption {
        font-size: 0.9rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .lightbox-overlay,
    .lightbox-content,
    .clickable-image,
    .lightbox-image {
        animation: none;
        transition: none;
    }
}

/* Body overflow control */
body.lightbox-open {
    overflow: hidden;
}

/* Image states */
.lightbox-image.draggable {
    cursor: grab;
}

.lightbox-image.dragging {
    cursor: grabbing;
}

/* Transform with CSS custom properties */
.lightbox-image {
    --scale: 1;
    --translate-x: 0px;
    --translate-y: 0px;
    transform: scale(var(--scale)) translate(calc(var(--translate-x) / var(--scale)), calc(var(--translate-y) / var(--scale)));
}