/* Modern Mobile Gallery - Alternative zu PrettyPhoto */

/* Mobile Lightbox */
.mobile-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    overflow: hidden;
}

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

.mobile-lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-lightbox img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.mobile-lightbox-title {
    color: white;
    font-size: 18px;
    text-align: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    margin-top: 15px;
    max-width: 90%;
}

/* Close button */
.mobile-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.mobile-lightbox-close:hover {
    background: white;
    transform: scale(1.1);
}

/* Navigation arrows */
.mobile-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-lightbox-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.mobile-lightbox-prev {
    left: 20px;
}

.mobile-lightbox-next {
    right: 20px;
}

/* Counter */
.mobile-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

/* Hide on desktop (keep PrettyPhoto for desktop) */
@media (min-width: 769px) {
    .mobile-lightbox {
        display: none !important;
    }
}

/* Mobile gallery optimization */
@media (max-width: 768px) {
    /* Hide PrettyPhoto links on mobile */
    .gallery-thumb[rel*="prettyPhoto"],
    a[rel*="prettyPhoto"] {
        pointer-events: none;
    }
    
    /* Make gallery thumbnails tappable for mobile lightbox */
    .gallery-thumb.mobile-gallery-item,
    .mobile-gallery-item {
        cursor: pointer;
        position: relative;
    }
    
    .mobile-gallery-item::after {
        content: "📱 Tippen zum Vergrößern";
        position: absolute;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    
    .mobile-gallery-item:hover::after {
        opacity: 1;
    }
}

/* Touch-friendly animations */
.mobile-lightbox-content {
    animation: zoomIn 0.3s ease;
}

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

/* Loading indicator */
.mobile-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
}

.mobile-lightbox-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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