/* Lightbox Overlay */
.ag-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ag-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Lightbox Content Wrapper */
.ag-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ag-lightbox-overlay.active .ag-lightbox-content {
    transform: scale(1);
}

/* Image */
.ag-lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    /* Leave room for caption */
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    user-select: none;
}

/* Caption */
.ag-lightbox-caption {
    margin-top: 15px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

/* Controls (Arrows & Close) */
.ag-lightbox-btn {
    position: absolute;
    background: transparent;
    /* Reset */
    border: none;
    /* Reset */
    box-shadow: none;
    /* Reset */
    padding: 0;
    /* Reset */
    margin: 0;
    /* Reset */
    outline: none;
    /* Reset */

    /* Custom Style */
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 100000;

    /* Default size, overriden by JS/Control */
    width: 50px;
    height: 50px;
    border-radius: 50%;

    /* Glassmorphism Optional Default */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ag-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.ag-lightbox-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    /* Reset SVG styles */
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

/* Close Button */
.ag-lightbox-close {
    top: 20px;
    right: 20px;
    position: fixed;
}

/* Navigation Arrows */
.ag-lightbox-prev,
.ag-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .ag-lightbox-content {
        max-width: 95%;
        max-height: 80vh;
    }

    .ag-lightbox-btn {
        width: 44px;
        /* Touch target size */
        height: 44px;
        background: rgba(0, 0, 0, 0.5);
        /* Stronger contrast mobile */
        border: none;
    }

    /* Mobile: Move arrows to bottom center for better UX */
    .ag-lightbox-prev,
    .ag-lightbox-next {
        top: auto;
        bottom: 30px;
        transform: none;
    }

    .ag-lightbox-prev {
        left: 20px;
    }

    .ag-lightbox-next {
        right: 20px;
    }

    /* Alternative: Center cluster if desired, but corners are safe */
}