/* Gallery and Lightbox Styles */

/* Lazy loading styles */
.lazy-load {
    transition: opacity 0.3s ease;
    opacity: 0.7;
}

.lazy-load.loaded {
    opacity: 1;
}

.lazy-load.error {
    opacity: 0.5;
    filter: grayscale(100%);
}

/* Gallery item cursor */
.gallery-item img {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

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

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

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

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

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

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

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

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

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

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

/* Mobile styles */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .lightbox-close {
        top: -40px;
        right: -40px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: -50px;
    }
    
    .lightbox-next {
        right: -50px;
    }
}

@media (max-width: 480px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        position: fixed;
    }
    
    .lightbox-prev {
        left: 10px;
        position: fixed;
        top: 50%;
    }
    
    .lightbox-next {
        right: 10px;
        position: fixed;
        top: 50%;
    }
}

/* VK Gallery Badge */
.gallery-item[data-source="vk"]::after {
    content: "📷 Из поездки";
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 2;
}

.gallery-item {
    position: relative;
    overflow: hidden;
}

/* Gallery overlay and actions */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.action-btn:hover {
    transform: scale(1.1);
    border-color: white;
}

.call-btn {
    background-color: #007bff;
}

.call-btn:hover {
    background-color: #0056b3;
}

.whatsapp-btn {
    background-color: #25D366;
}

.whatsapp-btn:hover {
    background-color: #1DA851;
}

.telegram-btn {
    background-color: #0088CC;
}

.telegram-btn:hover {
    background-color: #006699;
}

.details-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    gap: 0.5rem;
    width: auto;
    height: auto;
}

.details-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
}