/*
 * Lightbox Gallery Styles
 * Custom lightbox implementation for car image gallery
 */

/* Lightbox container - covers the entire screen */
.lightbox-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95); /* Darker background for better contrast */
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(3px); /* Slight blur effect for a more premium feel */
    -webkit-backdrop-filter: blur(3px);
}

.lightbox-gallery.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 9999 !important;
}

/* Lightbox content container */
.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main image container */
.lightbox-main-image-container {
    width: 90%; /* Reduced from 100% to give some margin on the sides */
    height: 75%; /* Increased from 70% to give more vertical space */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative; /* For absolute positioning of image if needed */
    overflow: visible; /* Allow image to overflow if necessary */
}

/* Main image */
.lightbox-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* This ensures the full image is displayed without cropping */
    border-radius: 4px;
    background-color: transparent; /* Ensure no background color */
}

/* Thumbnails container */
.lightbox-thumbnails-container {
    width: 100%;
    max-width: 1000px;
    height: 100px;
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

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

.lightbox-thumbnails-container::-webkit-scrollbar-track {
    background: transparent;
}

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

/* Thumbnails */
.lightbox-thumbnails {
    display: inline-flex;
    padding: 5px 0;
}

.lightbox-thumbnail {
    width: 100px;
    height: 70px;
    margin: 0 5px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    overflow: hidden;
}

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

.lightbox-thumbnail.active {
    border-color: #0d6efd;
    opacity: 1;
}

.lightbox-thumbnail:hover {
    opacity: 0.9;
}

/* Navigation buttons */
.lightbox-navigation {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.lightbox-nav-btn {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.2s ease;
}

.lightbox-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Counter */
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    color: white;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lightbox-main-image-container {
        width: 95%;
        height: 65%;
    }

    .lightbox-thumbnails-container {
        height: 80px;
        width: 95%;
    }

    .lightbox-thumbnail {
        width: 80px;
        height: 60px;
    }

    .lightbox-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .lightbox-content {
        padding: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }

    .lightbox-main-image-container {
        width: 100%;
        height: 60%; /* Increased from 50% to give more space for the full image */
    }

    .lightbox-thumbnails-container {
        height: 70px;
        width: 100%;
    }

    .lightbox-thumbnail {
        width: 70px;
        height: 50px;
        margin: 0 3px;
    }

    .lightbox-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .lightbox-counter {
        bottom: 10px;
        font-size: 14px;
        padding: 3px 10px;
    }
}
