/* Gallery Styles */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Photo Card */
.photo-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    group: true;
}

.photo-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.photo-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.photo-card:hover .photo-image {
    transform: scale(1.05);
}

/* Унифицированные размеры для галереи на ПК */
@media (min-width: 769px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .photo-image {
        height: 200px;
    }
    
    .gallery-masonry {
        column-count: 4;
        column-gap: 1.5rem;
    }
    
    .masonry-item {
        margin-bottom: 1.5rem;
    }
}

/* Photo Overlay */
.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-card:hover .photo-overlay {
    transform: translateY(0);
}

.photo-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.photo-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Zoom Icon */
.zoom-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    font-size: 1.2rem;
}

.photo-card:hover .zoom-icon {
    opacity: 1;
    transform: scale(1);
}

/* Masonry Layout */
.gallery-masonry {
    column-count: 4;
    column-gap: 1.5rem;
    margin-bottom: 3rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.masonry-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

/* Filter Buttons */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-inverse);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox:target {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.lightbox-image.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
}

/* Lightbox Controls */
.lightbox-close {
    position: absolute;
    top: -50px;
    right: -10px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.lightbox-nav:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

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

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

/* Info Panel */
.lightbox-info {
    position: absolute;
    bottom: -80px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.lightbox-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.lightbox-description {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* Loading States */
.gallery-loading {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.photo-skeleton {
    background: var(--bg-secondary);
    border-radius: 16px;
    height: 250px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-masonry {
        column-count: 3;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .gallery-container {
        padding: 1rem;
    }
    
    .gallery-masonry {
        column-count: 2;
        column-gap: 1rem;
    }
    
    .masonry-item {
        margin-bottom: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .photo-image {
        height: 200px;
    }
    
    .gallery-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .lightbox-nav {
        display: none;
    }
    
    .lightbox-close {
        top: -40px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-info {
        position: static;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-masonry {
        column-count: 1;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .photo-image {
        height: 250px;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 80%;
    }
}

/* Category Indicators */
.photo-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Statistics */
.gallery-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Dark theme adjustments */
body.dark-theme .lightbox {
    background: rgba(0, 0, 0, 0.98);
}

body.dark-theme .lightbox-close,
body.dark-theme .lightbox-nav {
    background: rgba(30, 41, 59, 0.9);
    color: var(--text-primary);
}

body.dark-theme .lightbox-close:hover {
    background: var(--error-color);
    color: white;
}

body.dark-theme .lightbox-nav:hover {
    background: var(--primary-color);
    color: white;
}
