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

/* Заголовок страницы работ */
.works-hero {
    text-align: center;
    padding: 50px 0;
    border-radius: 20px;
    margin-bottom: 50px;
}

.works-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.works-subtitle {
    font-size: 1.2rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

/* Фильтры категорий */
.works-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.works-filter-btn {
    padding: 10px 20px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.works-filter-btn:hover,
.works-filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Фильтры по тегам */
.tags-filter {
    margin-bottom: 40px;
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.tags-filter__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.tags-filter__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.tags-filter__tag {
    display: inline-block;
    padding: 8px 15px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tags-filter__tag:hover,
.tags-filter__tag.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.tags-filter__selected {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
    color: #64748b;
}

.tags-filter__selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tags-filter__remove {
    color: white;
    text-decoration: none;
    font-weight: bold;
    margin-left: 3px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.tags-filter__remove:hover {
    opacity: 1;
}

.tags-filter__clear {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    margin-left: 10px;
    transition: opacity 0.2s ease;
}

.tags-filter__clear:hover {
    text-decoration: underline;
}

/* Дополнительные стили для интерактивности фильтров */
.tags-filter__tag {
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.tags-filter__tag::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.tags-filter__tag:active::before {
    width: 100%;
    height: 100%;
}

/* Анимация для выбранных тегов */
.tags-filter__selected-tags-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-filter__selected-tag {
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Индикатор загрузки для фильтров */
#filter-loading-indicator {
    z-index: 10000;
}

/* Улучшенная визуальная обратная связь для активных тегов */
.tags-filter__tag.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 42, 127, 0.2);
}

/* Эффект пульсации для активных тегов */
.tags-filter__tag.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.2;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.6;
        transform: scale(1);
    }
}

/* Сетка работ - обновленная для правильного отображения макетов */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
    grid-auto-flow: dense;
}

/* Особые правила для одного элемента в сетке */
.works-grid > .work-card:only-child {
    grid-column: 1 / -1;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    justify-self: center;
}

/* Особые правила для двух элементов в сетке */
.works-grid > .work-card:nth-last-child(2):first-child,
.works-grid > .work-card:nth-last-child(2):first-child ~ .work-card {
    grid-column: span 1;
}

/* Адаптивность для больших экранов */
@media screen and (min-width: 1200px) {
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 40px;
    }
    
    .works-grid > .work-card:only-child {
        max-width: 600px;
    }
}

@media screen and (min-width: 1600px) {
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* Адаптивность для планшетов */
@media screen and (min-width: 768px) and (max-width: 1199px) {
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 25px;
    }
    
    .works-grid > .work-card:only-child {
        max-width: 500px;
    }
}

@media screen and (max-width: 767px) {
    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media screen and (max-width: 576px) {
    .works-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .works-grid > .work-card:only-child {
        max-width: 100%;
    }
}

/* Карточки работ - обновленные стили */
.work-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 42, 127, 0.06);
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    position: relative;
    transform-origin: center;
    will-change: transform;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
}

.work-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 15px 35px rgba(0, 42, 127, 0.12);
    z-index: 10;
}

/* Особые стили для больших экранов */
@media screen and (min-width: 1200px) {
    .work-card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 20px 40px rgba(0, 42, 127, 0.15);
    }
}

/* Мобильные устройства - уменьшаем эффекты */
@media screen and (max-width: 768px) {
    .work-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 25px rgba(0, 42, 127, 0.1);
    }
}

/* Изображения работ - обновленные с правильными пропорциями для макетов */
.work-card__img {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Убираем фиксированное соотношение сторон для адаптивности */
    min-height: 350px;
    max-height: 700px;
    width: 100%;
}

/* Ссылка вокруг изображения */
.work-card__img-link {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.work-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Изменено с cover на contain для правильных пропорций */
    object-position: center;
    transition: transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
    opacity: 1;
    filter: brightness(1.0);
    z-index: 2;
    position: relative;
}

.work-card:hover .work-card__img img,
.work-card__img-link:hover img {
    transform: scale(1.03); /* Уменьшен масштаб для более естественного эффекта */
    filter: brightness(1.05);
}

/* Оверлей для изображений */
.work-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 30%,
        rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    backdrop-filter: blur(3px);
    z-index: 3;
    padding: 20px;
}

.work-card:hover .work-card__overlay,
.work-card__img-link:hover .work-card__overlay {
    opacity: 1;
}

.work-card__overlay-content {
    text-align: center;
    color: white;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.work-card:hover .work-card__overlay-content,
.work-card__img-link:hover .work-card__overlay-content {
    transform: translateY(0);
}

.work-card__overlay-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.work-card__overlay-content p {
    font-size: 0.9rem;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Специальные классы для разных пропорций изображений */
.work-card__img.desktop {
    min-height: 280px;
    max-height: 400px;
}

.work-card__img.tablet {
    min-height: 320px;
    max-height: 450px;
}

.work-card__img.tall {
    min-height: 500px;
    max-height: 700px;
}

/* Дополнительные классы для очень высоких макетов */
.work-card__img.extra-tall {
    min-height: 600px;
    max-height: 800px;
}

/* Для широких макетов */
.work-card__img.wide {
    min-height: 250px;
    max-height: 350px;
}

/* Адаптивность для изображений на разных экранах */
@media screen and (max-width: 768px) {
    .work-card__img {
        min-height: 300px;
        max-height: 500px;
    }
    
    .work-card__img.tall {
        min-height: 400px;
        max-height: 600px;
    }
    
    .work-card__img.extra-tall {
        min-height: 500px;
        max-height: 700px;
    }
}

@media screen and (max-width: 576px) {
    .work-card__img {
        min-height: 250px;
        max-height: 400px;
    }
    
    .work-card__img.tall {
        min-height: 350px;
        max-height: 500px;
    }
    
    .work-card__img.extra-tall {
        min-height: 400px;
        max-height: 600px;
    }
}

/* Плейсхолдер для отсутствующих изображений */
.work-card__img--placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #6c757d;
}

.work-card__img--placeholder::before {
    content: '\f30b';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.work-card__img--placeholder::after {
    content: 'Нет изображения';
    font-size: 1rem;
    font-weight: 500;
}

.work-card__category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 4;
}

/* Стили для статуса и прогресс-бара */
.work-card__status {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 127, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 4;
}

.work-card__progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 4;
}

.work-card__progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: var(--primary-color);
    animation: progressAnimation 2s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

/* Заголовок работы */
.work-card__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 20px;
    line-height: 1.4;
}

/* Контент работы */
.work-card__content {
    padding: 0 20px 20px;
}

.work-card__description {
    color: #475569;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Теги в карточке работы */
.work-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.work-card__tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Мета-информация */
.work-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #64748b;
}

.work-card__client,
.work-card__date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.work-card__icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* Кнопка "Подробнее" */
.work-card .btn {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}

.work-card__btn-icon {
    width: 16px;
    height: 16px;
    margin-left: 5px;
}

/* Стили для кнопок действий */
.work-card__actions {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.work-card__actions .btn-outline-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Адаптивность для кнопок на мобильных устройствах */
@media screen and (max-width: 576px) {
    .work-card__actions {
        padding: 0 15px 15px;
    }
    
    .work-card .btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* Состояние "Нет работ" */
.no-works {
    text-align: center;
    padding: 60px 20px;
    border-radius: 16px;
    background: #f8f9fa;
}

.no-works-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.no-works-icon img {
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

.no-works h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.no-works p {
    color: #64748b;
    font-size: 1rem;
}

/* Пагинация */
.works-pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}
