/* ==================== GALLERY MODERN STYLES ==================== */

/* Hero Section */
.gallery-hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%),
                url('./гречесская сауна бассейн.jpg') center/cover no-repeat;
    margin-top: 80px;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.gallery-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 40px 20px;
}

.gallery-hero-title {
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 700;
    letter-spacing: 8px;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease;
}

.gallery-hero-subtitle {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 300;
    letter-spacing: 2px;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.gallery-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

/* Filters Section */
.gallery-filters-section {
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.7) 100%),
                url('./1762096265733.jpg') center/cover no-repeat;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    position: relative;
    overflow: hidden;
}

.gallery-filters-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 1400px 900px at 30% 20%, rgba(212, 175, 55, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 1200px 700px at 70% 80%, rgba(184, 134, 11, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: galleryFiltersSectionGlow 15s ease-in-out infinite;
}

@keyframes galleryFiltersSectionGlow {
    0%, 100% { 
        opacity: 0.8; 
        transform: scale(1) translate(0, 0);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.05) translate(20px, -15px);
    }
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.gallery-filter-btn {
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50px;
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.gallery-filter-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

.gallery-filter-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #f4e5b5 100%);
    border-color: #d4af37;
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

/* Gallery Grid Section */
.gallery-grid-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.7) 100%),
                url('./1762096265733.jpg') center/cover no-repeat;
    min-height: 60vh;
    position: relative;
    overflow: hidden;
}

.gallery-grid-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 1400px 900px at 30% 20%, rgba(212, 175, 55, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 1200px 700px at 70% 80%, rgba(184, 134, 11, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: galleryGridSectionGlow 15s ease-in-out infinite;
}

@keyframes galleryGridSectionGlow {
    0%, 100% { 
        opacity: 0.8; 
        transform: scale(1) translate(0, 0);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.05) translate(20px, -15px);
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    backdrop-filter: blur(10px);
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-item:nth-child(10) { animation-delay: 0.5s; }

.gallery-item.hidden {
    display: none;
}

.gallery-item:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

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

.gallery-item-icon {
    width: 50px;
    height: 50px;
    background: rgba(212, 175, 55, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 24px;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-icon {
    transform: scale(1);
}

/* Gallery Modal */
.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gallery-modal[aria-hidden="false"] {
    display: flex;
}

.gallery-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.gallery-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.4s ease;
}

.gallery-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.gallery-modal-close:hover {
    background: rgba(212, 175, 55, 0.3);
    border-color: #d4af37;
    transform: rotate(90deg);
}

.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.gallery-modal-nav:hover {
    background: rgba(212, 175, 55, 0.3);
    border-color: #d4af37;
    transform: translateY(-50%) scale(1.1);
}

.gallery-modal-nav.prev {
    left: -70px;
}

.gallery-modal-nav.next {
    right: -70px;
}

.gallery-modal-image-container {
    width: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.gallery-modal-image-container img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.gallery-modal-info {
    margin-top: 20px;
    text-align: center;
    color: #fff;
}

.gallery-modal-caption {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.gallery-modal-counter {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-hero {
        height: 50vh;
        min-height: 300px;
    }

    .gallery-hero-title {
        font-size: 40px;
        letter-spacing: 4px;
    }

    .gallery-hero-subtitle {
        font-size: 16px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .gallery-filters-section::before {
        background: 
            radial-gradient(ellipse 800px 600px at 30% 20%, rgba(212, 175, 55, 0.1) 0%, transparent 60%),
            radial-gradient(ellipse 700px 500px at 70% 80%, rgba(184, 134, 11, 0.08) 0%, transparent 50%);
    }
    
    .gallery-grid-section::before {
        background: 
            radial-gradient(ellipse 800px 600px at 30% 20%, rgba(212, 175, 55, 0.1) 0%, transparent 60%),
            radial-gradient(ellipse 700px 500px at 70% 80%, rgba(184, 134, 11, 0.08) 0%, transparent 50%);
    }

    .gallery-filters {
        gap: 10px;
    }

    .gallery-filter-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .gallery-modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .gallery-modal-close {
        top: -40px;
        right: 10px;
    }

    .gallery-modal-nav {
        width: 40px;
        height: 40px;
    }

    .gallery-modal-nav.prev {
        left: 10px;
    }

    .gallery-modal-nav.next {
        right: 10px;
    }

    .gallery-modal-image-container {
        max-height: 70vh;
    }

    .gallery-modal-caption {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .gallery-hero {
        height: 40vh;
        min-height: 250px;
    }

    .gallery-grid-section {
        padding: 40px 15px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Улучшаем touch targets для галереи */
    .gallery-item {
        min-height: 200px;
    }
    
    .gallery-filter-btn {
        min-height: 44px !important;
        padding: 10px 16px !important;
        touch-action: manipulation;
    }
}

/* Оптимизация для очень маленьких экранов */
@media (max-width: 375px) {
    .gallery-hero-title {
        font-size: 36px !important;
    }
    
    .gallery-hero-subtitle {
        font-size: 14px !important;
    }
    
    .gallery-grid-section {
        padding: 30px 12px !important;
    }
    
    .gallery-item {
        min-height: 180px;
    }
}

    .gallery-modal-image-container {
        max-height: 60vh;
    }
}







