/**
 * Lightbox Styles for Property Gallery
 */

/* Lightbox Container */
.lightbox-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.lightbox-container.active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Lightbox Content */
.lightbox-content {
    position: relative !important;
    width: 90% !important;
    max-width: 1200px !important;
    height: 70vh !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 999999 !important;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

/* Navigation Buttons */
.lightbox-navigation {
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    width: 100% !important;
    height: 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    pointer-events: none !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
    z-index: 999999 !important;
    transform: translateY(-50%) !important;
}

.lightbox-nav {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    border: none !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    font-size: 24px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
    transition: all 0.2s ease !important;
    opacity: 0.7 !important;
    position: relative !important;
    z-index: 999999 !important;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    opacity: 1;
}

.lightbox-close {
    position: absolute !important;
    top: -50px !important;
    right: 0 !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    z-index: 999999 !important;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Counter */
.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 0;
    color: #fff;
    font-size: 16px;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
}

/* Thumbnails */
.lightbox-thumbnails {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 90%;
    margin-top: 20px;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.lightbox-thumb {
    flex: 0 0 auto;
    width: 80px;
    height: 60px;
    margin: 0 5px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.lightbox-thumb.active {
    border-color: #fff;
    opacity: 1;
    transform: scale(1.05);
}

.lightbox-thumb:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Body class when lightbox is open */
body.lightbox-open {
    overflow: hidden !important;
    padding-right: 15px !important; /* Prevent layout shift */
}

/* Ensure lightbox is above everything */
#property-lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    pointer-events: auto !important;
}

/* Reset any inherited styles that might interfere */
#property-lightbox * {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

#property-lightbox .lightbox-content {
    margin: 0 !important;
    padding: 0 !important;
}

#property-lightbox .lightbox-navigation {
    margin: 0 !important;
    padding: 0 20px !important;
}

/* Add a highlight to the gallery images indicating they're clickable */
.property-gallery .main-image {
    cursor: pointer;
    transition: all 0.2s ease;
}

.property-gallery .main-image:hover {
    transform: scale(1.01);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.3);
}

.gallery-thumbs .thumb {
    cursor: pointer;
}

.gallery-thumbs .thumb::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.gallery-thumbs .thumb:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .lightbox-content {
        height: 50%;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-thumb {
        width: 60px;
        height: 45px;
    }
}
