/* Стили для страницы каталога курсов */

.page-hero {
    padding: 120px 0 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.page-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.page-header p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* Поиск */
.search-section {
    display: flex;
    justify-content: center;
}

.search-box {
    position: relative;
    max-width: 500px;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
}

.search-box input {
    width: 100%;
    padding: 15px 20px 15px 55px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Основной макет */
.courses-section {
    padding: 60px 0;
    background: var(--bg-primary);
}

.courses-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
}

/* Боковые фильтры */
.filters-sidebar {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-section {
    margin-bottom: 30px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 25px;
}

.filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.filter-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Кастомные чекбоксы */
.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    padding-left: 30px;
}

.filter-checkbox:hover {
    color: var(--primary);
}

.filter-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 2px;
    height: 18px;
    width: 18px;
    background-color: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    transition: var(--transition);
}

.filter-checkbox:hover .checkmark {
    border-color: var(--primary);
}

.filter-checkbox input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-checkbox input:checked ~ .checkmark:after {
    display: block;
}

/* Звезды в фильтрах */
.stars {
    display: flex;
    gap: 2px;
    margin-left: 5px;
}

.stars i {
    font-size: 14px;
    color: #fbbf24;
}

/* Ценовой диапазон */
.price-range {
    position: relative;
}

.price-range input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    margin: 10px 0;
}

.price-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.price-range input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.price-display {
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    margin-top: 10px;
}

/* Кнопка сброса фильтров */
.btn-clear-filters {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid #e5e7eb;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-clear-filters:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Панель инструментов */
.courses-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.results-info {
    font-weight: 600;
    color: var(--text-primary);
}

.sort-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-section label {
    font-weight: 500;
    color: var(--text-secondary);
}

.sort-section select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.view-btn:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.view-btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

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

/* Контейнер курсов */
.courses-container {
    min-height: 600px;
}

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

.courses-grid.list-view {
    grid-template-columns: 1fr;
}

.courses-grid.list-view .course-card {
    display: flex;
    flex-direction: row;
    max-width: none;
}

.courses-grid.list-view .course-header {
    min-width: 200px;
    flex-shrink: 0;
}

.courses-grid.list-view .course-content {
    flex: 1;
    padding: 25px 30px;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination-btn {
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    background: white;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.pagination-btn:hover:not(.disabled),
.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

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

.empty-state p {
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Рекомендации */
.recommendations {
    padding: 60px 0;
    background: var(--bg-secondary);
}

.recommendations-slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .courses-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .filters-sidebar {
        position: static;
        order: 2;
    }
    
    .courses-main {
        order: 1;
    }
    
    .courses-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .sort-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2.2rem;
    }
    
    .page-header p {
        font-size: 1.1rem;
    }
    
    .filters-sidebar {
        padding: 20px;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .courses-toolbar {
        padding: 15px;
    }
    
    .view-toggle {
        display: none;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .page-hero {
        padding: 100px 0 40px;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .search-box input {
        padding: 12px 15px 12px 45px;
        font-size: 1rem;
    }
    
    .courses-section {
        padding: 40px 0;
    }
    
    .filter-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .courses-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .results-info {
        font-size: 0.9rem;
    }
}

/* Анимации загрузки */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.course-card.loading {
    pointer-events: none;
}

.course-card.loading .course-header,
.course-card.loading .course-title,
.course-card.loading .course-description {
    background: var(--loading-skeleton);
    color: transparent;
}

/* Hover эффекты */
.course-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Активная ссылка в навигации */
.nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-link.active::after {
    width: 100%;
}