/* css/lightbox.css */

/* The main lightbox container, a semi-transparent overlay */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Class to show the lightbox */
.lightbox.show {
    opacity: 1;
    visibility: visible;
}

/* The content wrapper for the image or video */
.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    position: relative;
}

.lightbox-content img,
.lightbox-content video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 85vh;
    border-radius: 8px;
    position: relative;
    z-index: 1; /* Lower z-index than nav buttons */
}



/* Prevent double-tap zoom and improve touch interactions on mobile */
@media screen and (max-width: 768px) {
    .lightbox-content video {
        touch-action: manipulation; /* Prevents double-tap zoom */
        -webkit-touch-callout: none; /* Prevents long-press context menu */
        -webkit-user-select: none; /* Prevents text selection */
        user-select: none;
    }
    
    /* Additional mobile-specific video control hiding */
    .lightbox-content video::-webkit-media-controls-panel {
        background: transparent;
    }
    
    /* Ensure center play button is completely hidden on mobile */
    .lightbox-content video::-webkit-media-controls-overlay-play-button,
    .lightbox-content video::-webkit-media-controls-overlay-enclosure {
        opacity: 0 !important;
        display: none !important;
        visibility: hidden !important;
    }
}

/* Header section within the lightbox for counter and close button */
.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 15px; /* Video içinde, üst kısımda */
    left: 15px;
    right: 15px;
    width: auto;
    color: #fff;
    padding: 8px 12px;
    background: transparent; /* Arka plan kaldırıldı */
    z-index: 20; /* Video'nun üzerinde görünsün */
    opacity: 0; /* Varsayılan olarak gizli */
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none; /* Gizliyken tıklanabilir olmasın */
}

/* Desktop'ta hover ile header görünür yap */
@media (min-width: 769px) {
    .lightbox-content:hover .lightbox-header {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* Mobilde tıklama ile header görünür yap - 3 saniye kalır */
@media (max-width: 768px) {
    .lightbox-content:active .lightbox-header {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    /* Mobilde 3 saniye görünür kalması için class */
    .lightbox-header.mobile-show {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* Manuel toggle için class (artık kullanılmayacak) */
.lightbox-header.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-close {
    order: 3; /* Move to the end */
    font-size: 24px; /* Daha küçük boyut */
    color: #007AFF; /* iOS mavi rengi */
    cursor: pointer;
    background: transparent; /* Arka plan kaldırıldı */
    border: none;
    line-height: 1;
    padding: 4px 8px;
    transition: opacity 0.2s ease;
}

.reels-viewer-url {
    order: 2; /* X butonunun solunda */
    font-size: 17px; /* Daha küçük boyut */
    color: #007AFF; /* iOS mavi rengi */
    cursor: pointer;
    background: transparent;
    border: none;
    line-height: 1;
    padding: 4px 8px;
    transition: opacity 0.2s ease;
}

.reels-viewer-url:hover {
    opacity: 0.8; /* Hover'da biraz soluklaştır */
}

.lightbox-close:hover {
    opacity: 0.8; /* Hover'da biraz soluklaştır */
}

.lightbox-counter {
    order: 1; /* Move to the start */
    font-size: 14px; /* Daha küçük boyut */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    color: #007AFF; /* iOS mavi rengi */
}

/* Previous/Next navigation buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease, opacity 0.3s ease;
    opacity: 0;
    z-index: 10; /* Ensure navigation buttons are above video elements */
}

/* Show nav buttons on lightbox content hover (Desktop) */
.lightbox-content:hover .lightbox-nav {
    opacity: 1;
}

/* Mobile touch states - No longer needed since nav buttons are hidden on mobile */
/* Keeping for potential future desktop touch device support */

/* Force navigation buttons to be clickable on desktop only */
@media screen and (min-width: 769px) {
    .lightbox-nav {
        pointer-events: auto !important;
    }
}

/* Responsive adjustments for mobile devices */
@media screen and (max-width: 768px) {
    .lightbox-nav {
        display: none !important; /* Completely hide navigation arrows on mobile */
        pointer-events: none !important; /* Disable all click events */
    }
    
    .lightbox-content.touch-active .lightbox-nav,
    .lightbox-content.touch-hiding .lightbox-nav {
        display: none !important; /* Ensure they stay hidden in all states */
    }
    
    .lightbox-header {
        top: 10px; /* Mobilde daha üstte */
        left: 10px;
        right: 10px;
        padding: 8px 12px; /* Mobil için daha büyük padding */
    }
    
    .lightbox-counter {
        font-size: 16px; /* Mobilde daha büyük ve belirgin */
        font-weight: 600; /* Daha kalın yazı */
        color: #007AFF; /* iOS mavi rengi */
    }
    
    .lightbox-close {
        font-size: 28px; /* Mobilde daha büyük X butonu */
        padding: 6px 10px; /* Daha büyük dokunma alanı */
        font-weight: bold; /* Daha kalın X */
        color: #007AFF; /* iOS mavi rengi */
    }
    
    /* Add swipe hint for multi-media galleries - now the primary navigation method */
    .lightbox-content:after {
        content: "← Swipe to navigate →";
        position: absolute;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255, 255, 255, 0.9);
        background: rgba(0, 0, 0, 0.7);
        padding: 6px 15px;
        border-radius: 18px;
        font-size: 12px;
        font-weight: 600;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
        white-space: nowrap;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .lightbox-content.show-swipe-hint:after {
        opacity: 1;
    }
}

.lightbox-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-nav.prev {
    left: 15px;
}

.lightbox-nav.next {
    right: 15px;
}