/* Basic styling for the gallery container */
.cpgl-gallery-container {
    position: relative;
    max-width: 800px; /* Adjust as needed */
    height: 500px;
    margin: 20px auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Slider wrapper */
.cpgl-gallery-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%; /* Ensure it takes full width of container */
}

.cpgl-slide {
    min-width: 100%; /* Each slide takes full width of the slider */
    box-sizing: border-box;
    display: none; /* Hide all slides by default */
}

.cpgl-slide.active {
    display: block; /* Show active slide */
}

.cpgl-slide img {
    width: 100% !important;
    height: 500px !important;
    object-fit: cover !important;
    display: block;
    cursor: pointer; /* Indicate image is clickable */
    border-radius: 8px;
}

/* Slider navigation arrows */
.cpgl-prev-slide,
.cpgl-next-slide {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 4px;
    z-index: 10;
    transition: background-color 0.3s ease;
    border-radius: 50%; /* Make them circular */
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpgl-prev-slide:hover,
.cpgl-next-slide:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.cpgl-prev-slide {
    left: 10px;
}

.cpgl-next-slide {
    right: 10px;
}

/* Lightbox Overlay */
.cpgl-lightbox-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999; /* Ensure it's on top */
    /* The display:flex and related properties are now moved to the .active class */
}

.cpgl-lightbox-overlay.active {
    display: flex; /* Only show and layout when active */
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.cpgl-lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Lightbox navigation arrows */
.cpgl-lightbox-prev,
.cpgl-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent; /* Changed to transparent */
    color: #474747; /* Specified arrow color */
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 40px; /* Larger for full screen */
    z-index: 10000;
    transition: color 0.3s ease;
}

.cpgl-lightbox-prev:hover,
.cpgl-lightbox-next:hover {
    color: #fff; /* White on hover for better visibility */
}

.cpgl-lightbox-prev {
    left: 20px;
}

.cpgl-lightbox-next {
    right: 20px;
}

/* Close button for Lightbox */
.cpgl-close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    background-color: transparent;
    color: #fff;
    border: none;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
}

.cpgl-close-lightbox:hover {
    color: #ff0000; /* Red on hover for clear exit */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cpgl-gallery-container {
        margin: 10px auto;
    }

    .cpgl-prev-slide,
    .cpgl-next-slide {
        font-size: 18px;
        padding: 8px 12px;
        width: 40px;
        height: 40px;
    }

    .cpgl-lightbox-prev,
    .cpgl-lightbox-next {
        font-size: 30px;
        left: 10px;
        right: 10px;
    }

    .cpgl-close-lightbox {
        font-size: 30px;
        top: 10px;
        right: 15px;
    }
}
