/* 
 * Kaisergarten Restaurant - Modern Lightbox CSS
 * Elegant glassmorphism design with smooth animations
 */

/* Lightbox Container */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-index-modal, 9999);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), 
                visibility 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Modern Overlay with blur */
.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
                rgba(0, 0, 0, 0.95) 0%, 
                rgba(10, 10, 30, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1;
}

/* Lightbox Content */
.lightbox-content {
    position: relative;
    z-index: 2;
    max-width: 92%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: lightboxZoomIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes lightboxZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modern Image Container */
.lightbox-image-container {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Image */
.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.3s ease;
    border-radius: 12px;
}

/* Modern Caption */
.lightbox-caption {
    color: rgba(255, 255, 255, 0.9);
    padding: 1.25rem 2rem;
    text-align: center;
    font-size: 1rem;
    max-width: 800px;
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
}

/* Modern Navigation Arrows */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    font-size: 1.25rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color, #c41e3a);
    border-color: var(--primary-color, #c41e3a);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 15px 50px rgba(196, 30, 58, 0.4);
}

.lightbox-prev:focus,
.lightbox-next:focus,
.lightbox-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(250, 183, 0, 0.5);
}

.lightbox-prev.disabled,
.lightbox-next.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Modern Close Button */
.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    font-size: 1.25rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover {
    background: var(--primary-color, #c41e3a);
    border-color: var(--primary-color, #c41e3a);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 15px 50px rgba(196, 30, 58, 0.4);
}

/* Modern Counter */
.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.15);
    letter-spacing: 2px;
}

/* Smooth Animations */
.lightbox-image.slide-left {
    animation: slideInLeft 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.lightbox-image.slide-right {
    animation: slideInRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(60px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(-60px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Prevent background scrolling */
body.lightbox-open {
    overflow: hidden;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 96%;
    }
    
    .lightbox-image-container {
        border-radius: 12px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
    
    .lightbox-prev {
        left: 12px;
    }
    
    .lightbox-next {
        right: 12px;
    }
    
    .lightbox-close {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
    
    .lightbox-caption {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
        margin-top: 1rem;
    }
    
    .lightbox-counter {
        bottom: 16px;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* Touch-friendly for mobile devices */
@media (hover: none) and (pointer: coarse) {
    .lightbox-prev,
    .lightbox-next,
    .lightbox-close {
        min-width: 48px;
        min-height: 48px;
    }
    
    /* Show arrows always on touch devices */
    .lightbox-prev,
    .lightbox-next {
        opacity: 1;
    }
}
