/* Portfolio Lightbox - Clean Modern Design */

#portfolio-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#portfolio-lightbox.active {
    display: block;
    opacity: 1;
}

/* Dark overlay background */
.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

/* Main content container */
.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Image container */
.lightbox-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    min-height: 200px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

/* Caption */
.lightbox-caption {
    padding: 16px 24px;
    background: white;
    border-top: 1px solid #e9ecef;
    font-size: 14px;
    color: #495057;
    text-align: center;
    line-height: 1.4;
}

/* Navigation */
.lightbox-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    background: white;
    border-top: 1px solid #e9ecef;
    gap: 20px;
}

.lightbox-prev,
.lightbox-next {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #495057;
    transition: all 0.2s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

.lightbox-prev:active,
.lightbox-next:active {
    transform: scale(0.95);
}

/* Remove focus outlines for cleaner look */
.lightbox-prev:focus,
.lightbox-next:focus,
.lightbox-close:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove any default button styling and override main.css conflicts */
.lightbox-prev,
.lightbox-next,
.lightbox-close {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    border: none !important;
    background: none !important;
    font-family: inherit !important;
    box-shadow: none !important;
}

/* Counter */
.lightbox-counter {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 20px;
    font-weight: 300;
    transition: all 0.2s ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.lightbox-close:active {
    transform: scale(0.95);
}

/* Responsive design */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .lightbox-image {
        max-height: 60vh;
    }
    
    .lightbox-caption {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .lightbox-nav {
        padding: 12px 16px;
        gap: 16px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}

/* Loading state */
.lightbox-image-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
}

.lightbox-image-container.loading::before {
    opacity: 1;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Fade in animation */
#portfolio-lightbox.active .lightbox-content {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}
