/* Portfolio Gallery Lightbox Styles */

.portfolio-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base, 250ms ease-in-out), visibility var(--transition-base, 250ms ease-in-out);
}

.portfolio-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: color-mix(in srgb, var(--color-black-rock) 90%, transparent);
    backdrop-filter: blur(10px);
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 60px 20px 80px;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

/* Loader */
.lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #6F39E3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-loader.active {
    opacity: 1;
    visibility: visible;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: var(--color-purple-heart);
    border-color: var(--color-purple-heart);
    transform: rotate(90deg);
}

/* Navigation Buttons */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 48px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--color-purple-heart);
    border-color: var(--color-purple-heart);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-prev:disabled:hover,
.lightbox-next:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%);
}

.lightbox-prev span,
.lightbox-next span {
    display: block;
    margin-top: -4px;
}

/* Caption */
.lightbox-caption {
    margin-top: 20px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    max-width: 800px;
    line-height: 1.5;
}

/* Counter */
.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .lightbox-container {
        padding: 50px 10px 70px;
    }
    
    .lightbox-content {
        max-width: 95%;
    }
    
    .lightbox-image {
        max-height: 70vh;
        border-radius: 8px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 28px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 36px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-caption {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .lightbox-counter {
        bottom: 15px;
        font-size: 12px;
        padding: 6px 16px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .lightbox-prev,
    .lightbox-next {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* Animation for lightbox appearance */
.portfolio-lightbox.active .lightbox-container {
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Prevent page scroll when lightbox is open */
body.lightbox-open {
    overflow: hidden;
}
