/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-container {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    flex-direction: column;
}

.lightbox-content {
    max-width: 95vw;
    max-height: 95vh;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    min-height: 400px;
    position: relative;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-info {
    width: 300px;
    padding: 20px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lightbox-info h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.5em;
}

.lightbox-info p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #666;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Mobile-specific close button styling */
@media (max-width: 768px) {
    .lightbox-close {
        color: #fff; /* White text */
        background: rgba(0, 0, 0, 0.5); /* Same semi-transparent black as nav buttons */
    }

    .lightbox-close:hover {
        background: rgba(0, 0, 0, 0.7); /* Darker on hover, matching nav buttons */
    }
}

.lightbox-nav {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
    margin: 10px 5px;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-nav:disabled:hover {
    transform: scale(1);
}

.lightbox-prev {
    left: auto;
}

.lightbox-next {
    right: auto;
}

/* Container for navigation arrows */
.lightbox-nav-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .lightbox-content {
        flex-direction: column;
        max-width: 98vw;
        max-height: 98vh;
    }

    .lightbox-info {
        width: 100%;
        max-height: 200px;
        overflow-y: auto;
    }

    .lightbox-image-container {
        min-height: 300px;
        flex: 1;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin: 5px;
    }

    .lightbox-nav-container {
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .lightbox-container {
        padding: 10px;
    }

    .lightbox-info {
        padding: 15px;
    }

    .lightbox-nav {
        width: 35px;
        height: 35px;
        font-size: 16px;
        margin: 3px;
    }

    .lightbox-nav-container {
        margin-top: 3px;
    }
}

/* Loading indicator */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 18px;
}

/* Card image styles with FontAwesome maximize icon */
.item-image {
    position: relative;
    overflow: hidden;
}

.item-image img {
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
    width: 100%;
}

.item-image:hover img {
    transform: scale(1.02);
}

.item-image::after {
    content: '\f065'; /* FontAwesome expand icon */
    font-family: 'Font Awesome 5 Free'; /* Ensure correct FontAwesome font family */
    font-weight: 900; /* Required for solid icons in FontAwesome */
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
    z-index: 2; /* Ensure icon is above image */
}

.item-image:hover::after {
    color: #ffffff;
    font-size: 24px;
    transform: scale(1.2);
}