/* Standalone Lightbox CSS */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: none;
    animation: lightbox-fadeIn 0.3s ease;
}

.lightbox-overlay.show {
    display: flex;
}

.lightbox-container {
    display: flex;
    width: 100%;
}

.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

.lightbox-image:active {
    cursor: grabbing;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 24px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;

    z-index: 10001;
}

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

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

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

.lightbox-next {
    right: 20px;
}

.lightbox-info {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    color: white;
}

.lightbox-title {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.lightbox-description {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.lightbox-carousel-caption {
    text-align: left;
    left: auto;
    right: auto;
    padding: 1rem 5rem;
    background: rgba(0, 0, 0, 0.7);
    bottom: 5rem;
}

.lightbox-counter {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 14px 16px;
    font-size: 0.9rem;
    z-index: 10001;
}

.lightbox-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.lightbox-controls-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin: 0;
}

@keyframes lightbox-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

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

    .lightbox-info {
        bottom: 60px;
        padding: 15px;
    }

    .lightbox-title {
        font-size: 1.2rem;
    }

    .lightbox-controls {
        bottom: 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-counter {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Demo styles (remove these in your implementation) */

.demo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.demo-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.demo-gallery img:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* hide overlay text initially */
.overlay {
    transition: opacity .3s ease;
    pointer-events: none;
}
.gallery-card {
    width: 100%;
    height: 100%;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* dim the image and show text on hover */
.card:hover .card-img {
    filter: brightness(.6);
    transition: filter .3s ease;
}
.card:hover .overlay {
    opacity: 1;
}
