/* Стили для страницы галереи */

/* Герой-секция для галереи */
.gallery-hero {
    height: 60vh;
    min-height: 400px;
    background: linear-gradient(rgba(42, 97, 118, 0.85), rgba(59, 142, 165, 0.7)), url('../images/gallery-hero.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    position: relative;
    margin-top: 80px;
}

.gallery-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
    margin: 0 auto;
    text-align: center;
}

.gallery-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 56px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.gallery-hero-subtitle {
    font-size: 22px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Основной контент галереи */
.gallery-main {
    padding: 80px 0;
    background-color: #f8fbfc;
}

/* Фильтры категорий */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 50px;
}

.filter-btn {
    background-color: transparent;
    border: 2px solid var(--color-marine-blue);
    color: var(--color-marine-blue);
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background-color: rgba(59, 142, 165, 0.1);
    transform: translateY(-3px);
}

.filter-btn.active {
    background-color: var(--color-marine-blue);
    color: white;
    box-shadow: 0 5px 15px rgba(59, 142, 165, 0.3);
}

/* Сетка галереи */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.gallery-item {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item.hidden {
    display: none;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    position: relative;
    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: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-info {
    color: white;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-info {
    transform: translateY(0);
}

.gallery-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
    font-weight: 600;
}

.gallery-info p {
    font-size: 14px;
    opacity: 0.9;
}

.gallery-view-btn {
    align-self: flex-end;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-marine-blue);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    transform: translateY(20px);
    opacity: 0;
}

.gallery-item:hover .gallery-view-btn {
    transform: translateY(0);
    opacity: 1;
}

.gallery-view-btn:hover {
    background-color: white;
    transform: scale(1.1);
}

/* Кнопка "Показать еще" */
.gallery-load-more {
    text-align: center;
    margin-top: 30px;
}

.btn-load-more {
    background: linear-gradient(135deg, var(--color-marine-blue), var(--color-deep-blue));
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 5px 15px rgba(59, 142, 165, 0.3);
}

.btn-load-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 142, 165, 0.4);
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background-color: transparent;
    border-radius: 10px;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-dark);
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: white;
    transform: rotate(90deg);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-dark);
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.modal-nav:hover {
    background-color: white;
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background-color: #000;
}

#modalImage {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#modalImage.loaded {
    opacity: 1;
}

.modal-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.modal-loader i {
    font-size: 3rem;
    color: var(--primary-color);
}

.modal-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

#modalImage {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#modalImage.loaded {
    opacity: 1;
}

.modal-info {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 25px;
    text-align: center;
    color: var(--color-dark);
}

.modal-info h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--color-deep-blue);
}

.modal-info p {
    font-size: 16px;
    margin-bottom: 15px;
    color: #666;
}

.modal-counter {
    font-size: 16px;
    color: var(--color-marine-blue);
    font-weight: 600;
}

/* Анимации для модального окна */
@keyframes slideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-container {
    animation: slideIn 0.3s ease;
}

/* Адаптивность */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .gallery-hero-title {
        font-size: 46px;
    }
    
    .gallery-hero-subtitle {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .gallery-hero {
        height: 50vh;
        min-height: 350px;
    }
    
    .gallery-hero-title {
        font-size: 36px;
    }
    
    .gallery-hero-subtitle {
        font-size: 18px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .gallery-filters {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 15px;
    }
    
    .modal-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .modal-info {
        padding: 20px;
    }
    
    .modal-info h3 {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-hero-title {
        font-size: 32px;
    }
    
    .gallery-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 200px;
    }
    
    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}