/* Стили для галереи интерьеров */

.gallery {
    background: var(--color-dark-light);
    position: relative;
    padding: 100px 0;
    overflow: hidden;
}

.gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(
            circle at 10% 20%,
            rgba(255, 215, 0, 0.05) 0%,
            transparent 40%
        ),
        radial-gradient(
            circle at 90% 80%,
            rgba(0, 255, 157, 0.05) 0%,
            transparent 40%
        );
    pointer-events: none;
}

.gallery-container {
    margin-top: 40px;
    position: relative;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    position: relative;
    z-index: 2;
}

@media (min-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery-item {
    position: relative;
    height: 400px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(26, 26, 26, 0.8) 100%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        var(--shadow-md),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.2) 0%,
        rgba(0, 255, 157, 0.1) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 1;
}

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

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 60%,
        rgba(0, 0, 0, 0.8) 100%
    );
    z-index: 1;
}

/* Случайные фоновые изображения для галереи */
.gallery-item:nth-child(1) {
    background-image: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(26, 26, 26, 0.7) 100%),
        url('../images/gallery/interior-main-hall.png');
    background-size: cover;
    background-position: center;
}

.gallery-item:nth-child(2) {
    background-image: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(26, 26, 26, 0.7) 100%),
        url('../images/gallery/interior-bar.png');
    background-size: cover;
    background-position: center;
}

.gallery-item:nth-child(3) {
    background-image: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(26, 26, 26, 0.7) 100%),
        url('../images/gallery/interior-vip.png');
    background-size: cover;
    background-position: center;
}

.gallery-item:nth-child(4) {
    background-image: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(26, 26, 26, 0.7) 100%),
        url('../images/gallery/interior-hookah-zone.png');
    background-size: cover;
    background-position: center;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 30px;
    z-index: 2;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
    opacity: 1;
}

.gallery-overlay h3 {
    color: var(--color-gold);
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-shadow: var(--shadow-gold);
}

.gallery-overlay p {
    color: var(--color-white);
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}

.gallery-item:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 
        var(--shadow-lg),
        0 15px 40px rgba(255, 215, 0, 0.3),
        inset 0 0 0 1px rgba(255, 215, 0, 0.3);
}

/* Эффект свечения при наведении */
.gallery-item:hover {
    position: relative;
}

.gallery-item:hover::before {
    animation: galleryGlow 3s ease-in-out infinite;
}

@keyframes galleryGlow {
    0%, 100% {
        background: linear-gradient(
            135deg,
            rgba(255, 215, 0, 0.2) 0%,
            rgba(0, 255, 157, 0.1) 50%,
            transparent 100%
        );
    }
    50% {
        background: linear-gradient(
            135deg,
            rgba(0, 255, 157, 0.2) 0%,
            rgba(255, 215, 0, 0.1) 50%,
            transparent 100%
        );
    }
}

/* Параллакс эффект */
.parallax-item {
    transform-style: preserve-3d;
}

/* Анимация появления галереи */
@keyframes galleryFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gallery-item {
    animation: galleryFadeIn 0.8s ease-out both;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }

/* Модальное окно для полноразмерного просмотра */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.gallery-modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.gallery-modal-img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
}

.gallery-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: var(--color-gold);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.gallery-modal-close:hover {
    color: var(--color-neon-green);
}

/* Адаптация для планшетов */
@media (max-width: 1024px) {
    .gallery {
        padding: 80px 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item {
        height: 300px;
    }
    
    .gallery-overlay {
        padding: 30px 20px;
    }
    
    .gallery-overlay h3 {
        font-size: 1.3rem;
    }
    
    .gallery-overlay p {
        font-size: 0.85rem;
    }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .gallery {
        padding: 60px 0;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
        gap: 15px;
    }
    
    .gallery-item {
        height: 250px;
    }
    
    .gallery-overlay {
        padding: 25px 20px;
        transform: translateY(10px);
    }
    
    .gallery-item:hover .gallery-overlay {
        transform: translateY(0);
    }
    
    .gallery-item:hover {
        transform: translateY(-10px) scale(1.02);
    }
    
    .gallery-overlay h3 {
        font-size: 1.2rem;
    }
    
    .gallery-overlay p {
        font-size: 0.8rem;
    }
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 480px) {
    .gallery-item {
        height: 200px;
    }
    
    .gallery-overlay {
        padding: 20px 15px;
    }
    
    .gallery-overlay h3 {
        font-size: 1.1rem;
    }
}

/* Поддержка тёмного режима */
@media (prefers-color-scheme: dark) {
    .gallery-item {
        background-blend-mode: overlay;
    }
    
    .gallery-item:hover {
        box-shadow: 
            var(--shadow-lg),
            0 15px 40px rgba(255, 215, 0, 0.4),
            inset 0 0 0 1px rgba(255, 215, 0, 0.4);
    }
}

/* Улучшенный эффект параллакса для скролла */
@media (prefers-reduced-motion: no-preference) {
    .parallax-item {
        transition: transform 0.3s ease-out;
    }
}