/* Стили для категорий */

/* Ссылка категории в карточке */
.card-category .category-link {
    color: #BAA293;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
}

.card-category .category-link:hover {
    color: #8C6F5E;
    text-decoration: underline;
}

/* Ссылка категории в посте */
.post-category .category-link {
    color: #BAA293;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.2s ease;
}

.post-category .category-link:hover {
    color: #8C6F5E;
    text-decoration: underline;
}

/* Кнопки фильтрации */
.filter-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

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

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #EFEAE2;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #282828;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #282828;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #EFEAE2;
}

/* Сетка направлений */
.directions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.direction-column {
    display: flex;
    flex-direction: column;
}

.direction-title {
    font-size: 16px;
    font-weight: 600;
    color: #282828;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #EFEAE2;
}

.direction-link {
    color: #282828;
    text-decoration: none;
    transition: color 0.2s ease;
}

.direction-link:hover,
.direction-link.active {
    color: #BAA293;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 0;
    transition: all 0.2s ease;
}

.category-item:hover,
.category-item.active {
    color: #BAA293;
    padding-left: 8px;
}

/* Диапазоны бюджетов */
.budget-ranges {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.budget-range {
    display: block;
    padding: 12px 16px;
    background: #F9F7F5;
    border: 1px solid #EFEAE2;
    border-radius: 8px;
    color: #282828;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.budget-range:hover,
.budget-range.active {
    background: #EFEAE2;
    border-color: #BAA293;
    color: #BAA293;
}

/* Состояние без результатов */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
}

.no-results p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

/* Адаптивность модальных окон */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .directions-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
    
    .filter-buttons .btn-outline {
        width: 100%;
    }
}

/* Страница категорий */
.page-header {
    margin-bottom: 40px;
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    color: #282828;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 0;
}

.breadcrumbs {
    font-size: 14px;
    color: #999;
    margin-bottom: 16px;
}

.breadcrumbs a {
    color: #BAA293;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Контейнер категорий */
.categories-container {
    max-width: 1200px;
    margin: 0 auto;
}

.direction-section {
    margin-bottom: 40px;
}

.direction-title {
    font-size: 24px;
    font-weight: 600;
    color: #282828;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #EFEAE2;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.category-card {
    display: block;
    background: #FFFFFF;
    border: 1px solid #EFEAE2;
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(186, 162, 147, 0.15);
    border-color: #BAA293;
}

.category-card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    color: #282828;
    margin-bottom: 12px;
    flex-grow: 1;
}

.category-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.post-count {
    font-size: 14px;
    color: #BAA293;
    font-weight: 500;
}

/* Состояние пустого списка */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #F9F7F5;
    border-radius: 12px;
    margin: 40px 0;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: #282828;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary {
    display: inline-block;
    background: #BAA293;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: #8C6F5E;
}

/* Счетчик постов */
.posts-count {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #EFEAE2;
}

/* Похожие категории */
.related-categories {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #EFEAE2;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #282828;
    margin-bottom: 20px;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    background: #F9F7F5;
    border: 1px solid #EFEAE2;
    border-radius: 20px;
    padding: 8px 16px;
    text-decoration: none;
    color: #282828;
    font-size: 14px;
    transition: all 0.2s ease;
}

.category-tag:hover {
    background: #EFEAE2;
    border-color: #BAA293;
    color: #BAA293;
}

.tag-count {
    display: inline-block;
    background: #BAA293;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 20px;
    }
    
    .categories-list {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 20px;
    }
    
    .direction-title {
        font-size: 20px;
    }
    
    .category-name {
        font-size: 16px;
    }
}