/* Modern Lightbox CSS */
.modern-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.lightbox-caption {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 15px 20px;
    margin-top: 15px;
    border-radius: 25px;
    max-width: 500px;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* Navigation Controls */
.lightbox-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lightbox-controls:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Counter */
.lightbox-counter {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Loading Animation */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .lightbox-controls {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .lightbox-counter {
        top: 15px;
        left: 15px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .lightbox-caption {
        margin: 10px;
        padding: 12px 16px;
        font-size: 13px;
        max-width: calc(100vw - 40px);
    }
    
    .lightbox-container {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .lightbox-image {
        max-height: 75vh;
    }
}

@media (max-width: 480px) {
    .lightbox-controls {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .lightbox-counter {
        top: 10px;
        left: 10px;
        padding: 4px 10px;
        font-size: 11px;
    }
}

/* Animation for image transitions */
.lightbox-image.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Touch gestures hint */
.lightbox-container::after {
    content: "← Deslize para navegar →";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    opacity: 0;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@media (max-width: 768px) {
    .lightbox-container::after {
        bottom: -25px;
        font-size: 11px;
    }
}
