/* Стили для страницы портфолио */

.portfolio-section {
    padding: 40px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--secondary-color);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Фильтры */
.filters {
    margin-bottom: 40px;
    text-align: center;
}

.filters h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 20px;
    background-color: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.filter-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Галерея */
.gallery-container {
    margin-bottom: 50px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.gallery-item {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

.gallery-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

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

.view-btn {
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color var(--transition-speed);
}

.view-btn:hover {
    background-color: var(--primary-color);
}

.gallery-info {
    padding: 20px;
}

.gallery-info h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.gallery-info p {
    font-size: 0.9rem;
    color: var(--secondary-color);
    line-height: 1.5;
}

/* Кнопка "Показать еще" */
.load-more-container {
    text-align: center;
    margin-top: 40px;
}

.load-more-btn {
    padding: 12px 40px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.load-more-btn:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Статистика портфолио */
.portfolio-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 60px;
    padding: 40px 20px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.stat-item {
    text-align: center;
    flex: 1;
    max-width: 200px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
    display: block;
    margin-bottom: 10px;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: var(--secondary-color);
}

/* PhotoSwipe кастомизация */
.pswp__bg {
    background-color: rgba(0, 0, 0, 0.9);
}

.pswp__caption__center {
    text-align: center;
    font-size: 0.9rem;
    color: #fff;
    padding: 10px 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .section-header h1 {
        font-size: 2rem;
    }
    
    .filters h2 {
        font-size: 1.3rem;
    }
    
    .filter-buttons {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 6px 15px;
        font-size: 0.85rem;
    }
    
    .portfolio-stats {
        flex-direction: column;
        gap: 30px;
        padding: 30px 20px;
    }
    
    .stat-item {
        max-width: 100%;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .section-header h1 {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .gallery-info h3 {
        font-size: 1.1rem;
    }
    
    .gallery-info p {
        font-size: 0.85rem;
    }
    
    .load-more-btn {
        padding: 10px 30px;
        font-size: 0.9rem;
    }
    
    .portfolio-stats {
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
}

/* Темная тема */
body.dark .gallery-item {
    background-color: #1a1a1a;
    border-color: #444;
}

body.dark .gallery-overlay {
    background-color: rgba(0, 0, 0, 0.8);
}

body.dark .portfolio-stats {
    background-color: #1a1a1a;
    border-color: #444;
}

body.dark .filter-btn {
    background-color: #1a1a1a;
    border-color: #444;
    color: #f0f0f0;
}

body.dark .filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

body.dark .filter-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: fadeIn 0.6s ease-out;
}

.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-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }
.gallery-item:nth-child(9) { animation-delay: 0.9s; }
.gallery-item:nth-child(10) { animation-delay: 1.0s; }

/* Загрузка изображений */
.loading {
    position: relative;
    background-color: var(--border-color);
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Состояние скрытых элементов */
.gallery-item.hidden {
    display: none;
}