/* IMAGE LIGHTBOX - TaskRabbit Style */

/* Lightbox overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

/* Lightbox container */
.lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

/* Lightbox image */
.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: #1a1a1a;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    background: #333333;
    transform: rotate(90deg);
}

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

.lightbox-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: -70px;
}

.lightbox-next {
    right: -70px;
}

/* Loading spinner */
.lightbox-loading {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Image counter */
.lightbox-counter {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Image caption */
.lightbox-caption {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    max-width: 80%;
    text-align: center;
    line-height: 1.5;
}

/* Zoom controls */
.lightbox-zoom {
    position: absolute;
    top: -50px;
    left: 0;
    display: flex;
    gap: 10px;
}

.lightbox-zoom-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lightbox-zoom-btn:hover {
    background: white;
    transform: scale(1.1);
}

/* Gallery thumbnails */
.lightbox-thumbnails {
    position: absolute;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    overflow-x: auto;
    max-width: 90%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
}

.lightbox-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.lightbox-thumbnail:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

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

/* Mobile responsive */
@media (max-width: 768px) {
    .lightbox-container {
        max-width: 100%;
        max-height: 100vh;
    }

    .lightbox-image {
        max-height: 70vh;
        border-radius: 0;
    }

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

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

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-counter {
        bottom: 20px;
        font-size: 13px;
    }

    .lightbox-caption {
        bottom: 60px;
        font-size: 14px;
        padding: 10px 16px;
        max-width: 90%;
    }

    .lightbox-thumbnails {
        display: none; /* Hide thumbnails on mobile */
    }

    .lightbox-zoom {
        display: none; /* Hide zoom controls on mobile */
    }
}

/* Touch swipe indicator */
.lightbox-swipe-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    display: none;
}

@media (max-width: 768px) and (hover: none) {
    .lightbox-swipe-indicator {
        display: block;
    }
}

/* Keyboard shortcut hints */
.lightbox-hint {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active .lightbox-hint {
    opacity: 1;
}

/* Smooth transitions */
.lightbox-image-transition {
    animation: imageZoomIn 0.3s ease;
}

@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fullscreen support */
.lightbox-fullscreen {
    position: absolute;
    top: -50px;
    left: 100px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lightbox-fullscreen:hover {
    background: white;
    transform: scale(1.1);
}

/* Download button */
.lightbox-download {
    position: absolute;
    top: -50px;
    left: 50px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

.lightbox-download:hover {
    background: white;
    transform: scale(1.1);
}
