/**
 * WPMF Lightbox Fix - CSS v3.0
 * Vollständige Lightbox mit Navigation
 */

/* Verhindere Scrollen wenn Lightbox aktiv */
body.hmf-lightbox-open {
    overflow: hidden !important;
}

/* Lightbox Overlay */
.hmf-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.hmf-lightbox-overlay.hmf-active {
    opacity: 1;
  background: rgba(0, 0, 0, 0.8);
}

/* Lightbox Content Container */
.hmf-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

/* Lightbox Image */
.hmf-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    animation: hmfZoomIn 0.3s ease-out;
}

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

/* Close Button */
.hmf-lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    font-size: 60px;
    color: #fff;
    cursor: pointer;
    z-index: 1000000;
    line-height: 1;
    font-weight: 300;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    transition: all 0.2s ease;
    font-family: Arial, sans-serif;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    user-select: none;
}

.hmf-lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
    background: rgba(255, 255, 255, 0.2);
}

/* Navigation Buttons */
.hmf-lightbox-prev,
.hmf-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    color: #fff;
    cursor: pointer;
    z-index: 1000000;
    line-height: 1;
    font-weight: 300;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    transition: all 0.2s ease;
    font-family: Arial, sans-serif;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    user-select: none;
}

.hmf-lightbox-prev {
    left: 30px;
}

.hmf-lightbox-next {
    right: 30px;
}

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

/* Counter */
.hmf-lightbox-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 18px;
    font-family: Arial, sans-serif;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 1000000;
}

/* Loader */
.hmf-lightbox-loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hmfSpin 1s linear infinite;
}

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

/* WPMF Galerie Items */
.wpmf-gallery-item,
.wpmf-gallery-icon,
.wpmf_gallery img {
    cursor: pointer !important;
}

.wpmf-gallery-item img,
.wpmf_gallery img {
    transition: all 0.3s ease;
}

.wpmf-gallery-item:hover img,
.wpmf_gallery img:hover {
    transform: scale(1.03);
    opacity: 0.9;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .hmf-lightbox-content {
        max-width: 95%;
        max-height: 85vh;
    }
    
    .hmf-lightbox-image {
        max-height: 85vh;
    }
    
    .hmf-lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 50px;
        width: 50px;
        height: 50px;
    }
    
    .hmf-lightbox-prev {
        left: 15px;
        font-size: 50px;
        width: 50px;
        height: 50px;
    }
    
    .hmf-lightbox-next {
        right: 15px;
        font-size: 50px;
        width: 50px;
        height: 50px;
    }
    
    .hmf-lightbox-counter {
        bottom: 20px;
        font-size: 16px;
        padding: 8px 16px;
    }
}

@media screen and (max-width: 480px) {
    .hmf-lightbox-content {
        max-width: 98%;
        max-height: 80vh;
    }
    
    .hmf-lightbox-image {
        max-height: 80vh;
    }
    
    .hmf-lightbox-close {
        top: 5px;
        right: 10px;
        font-size: 40px;
        width: 40px;
        height: 40px;
    }
    
    .hmf-lightbox-prev {
        left: 10px;
        font-size: 40px;
        width: 40px;
        height: 40px;
    }
    
    .hmf-lightbox-next {
        right: 10px;
        font-size: 40px;
        width: 40px;
        height: 40px;
    }
    
    .hmf-lightbox-counter {
        bottom: 15px;
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* Fix für WordPress Admin Bar */
body.admin-bar .hmf-lightbox-overlay {
    top: 32px;
    height: calc(100% - 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .hmf-lightbox-overlay {
        top: 46px;
        height: calc(100% - 46px);
    }
}

/* Accessibility */	
.hmf-lightbox-overlay:focus,
.hmf-lightbox-close:focus,
.hmf-lightbox-prev:focus,
.hmf-lightbox-next:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Touch Geräte */
@media (hover: none) and (pointer: coarse) {
    .hmf-lightbox-close,
    .hmf-lightbox-prev,
    .hmf-lightbox-next {
        background: rgba(0, 0, 0, 0.7);
    }
}

/* Print Styles */
@media print {
    .hmf-lightbox-overlay {
        display: none !important;
    }
}