/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Боковое меню */
#sidebar-menu {
    width: 320px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

#sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

#sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

#sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.site-title {
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 20px;
    text-align: center;
}

/* === ПАНЕЛЬ ФИЛЬТРОВ === */
.filters-panel {
    background: rgba(0,0,0,0.2);
    margin: 0 10px 20px;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.2);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.filters-header h3 {
    color: #ffd700;
    font-size: 0.9em;
    margin: 0;
    font-weight: 600;
}

.clear-filters {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.filter-group {
    margin-bottom: 12px;
}

.filter-group label {
    display: block;
    color: rgba(255,255,255,0.9);
    font-size: 0.8em;
    margin-bottom: 4px;
    font-weight: 500;
}

.filter-toggle {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    transition: all 0.3s ease;
    user-select: none;
}

.filter-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.toggle-arrow {
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.filter-options {
    display: block;
    margin-top: 5px;
    max-height: 150px;
    overflow-y: auto;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    padding: 5px;
}

.filter-options::-webkit-scrollbar {
    width: 4px;
}

.filter-options::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.filter-options::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.no-options {
    color: rgba(255,255,255,0.6);
    font-size: 0.75em;
    padding: 8px;
    text-align: center;
    font-style: italic;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    margin: 2px 0;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.checkbox-item:hover {
    background: rgba(255,255,255,0.1);
}

.checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #ffd700;
    cursor: pointer;
}

.checkbox-item label {
    color: rgba(255,255,255,0.9);
    font-size: 0.75em;
    cursor: pointer;
    margin: 0;
    flex: 1;
}

.filter-group input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.filter-group input[type="text"]::placeholder {
    color: rgba(255,255,255,0.6);
}

.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 5px rgba(255,215,0,0.3);
}

.filter-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.8em;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 5px rgba(255,215,0,0.3);
}

.filter-group select option {
    background: #2c3e50;
    color: white;
    padding: 5px;
}

.filter-options-large {
    max-height: 200px !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.models-count {
    margin-top: 15px;
    padding: 8px;
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 4px;
    color: #ffd700;
    font-size: 0.8em;
    text-align: center;
    font-weight: 600;
}

.models-count span {
    color: white;
    font-weight: bold;
}

.active-filters {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 4px;
}

.active-filters-title {
    color: #ffd700;
    font-size: 0.75em;
    font-weight: 600;
    margin-bottom: 5px;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.active-filter-tag {
    background: rgba(255,215,0,0.2);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7em;
    border: 1px solid rgba(255,215,0,0.4);
}

/* === ОСНОВНОЕ МЕНЮ === */
.main-menu {
    list-style: none;
}

.menu-item {
    margin-bottom: 2px;
}

/* Категории-заголовки */
.menu-category {
    margin: 15px 0 8px 0;
}

.category-title {
    color: #ffd700;
    font-weight: 700;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 20px 5px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    margin-bottom: 5px;
    cursor: default;
}

/* Стили для разных уровней меню */
.menu-level-0 .menu-title {
    font-weight: 700;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.15);
    padding: 12px 20px;
}

.menu-level-1 .menu-title {
    font-weight: 600;
    font-size: 0.9em;
    text-transform: none;
    letter-spacing: 0.3px;
    background: rgba(0,0,0,0.2);
    padding: 10px 30px;
    border-left: 3px solid rgba(255,255,255,0.3);
}

.menu-level-2 .menu-title {
    font-weight: 500;
    font-size: 0.85em;
    text-transform: none;
    letter-spacing: 0.2px;
    background: rgba(0,0,0,0.3);
    padding: 8px 40px;
    border-left: 2px solid rgba(255,255,255,0.2);
}

.menu-title {
    display: block;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.menu-title:hover {
    background: rgba(255,255,255,0.2) !important;
}

.menu-title.inactive {
    cursor: default;
    opacity: 0.7;
}

.menu-toggle {
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.3s ease;
    font-size: 0.8em;
    width: 12px;
}

/* Стили для ссылок на разных уровнях */
.menu-level-0 .menu-link {
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.menu-level-1 .menu-link {
    padding: 10px 30px;
    font-weight: 500;
    font-size: 0.85em;
    border-left: 3px solid rgba(255,255,255,0.3);
}

.menu-level-2 .menu-link {
    padding: 8px 40px;
    font-weight: 400;
    font-size: 0.8em;
    border-left: 2px solid rgba(255,255,255,0.2);
}

.menu-link {
    display: block;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.menu-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(5px);
}

.menu-link.active {
    background: rgba(255,255,255,0.25);
    color: white;
    font-weight: 600;
}

.menu-link.active::before {
    content: '▶';
    position: absolute;
    left: 10px;
    font-size: 0.7em;
    color: #ffd700;
}

/* Специальные стили для ссылки с фильтрами */
.menu-link.has-filters {
    background: rgba(255,215,0,0.1);
    border-left-color: #ffd700 !important;
}

.menu-link.has-filters:hover {
    background: rgba(255,215,0,0.2);
}

/* Подменю */
.submenu {
    list-style: none;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.submenu-level-1 {
    background: rgba(0,0,0,0.2);
}

.submenu-level-2 {
    background: rgba(0,0,0,0.3);
}

.submenu-level-3 {
    background: rgba(0,0,0,0.4);
}

.submenu li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.submenu li:last-child {
    border-bottom: none;
}

/* Показываем подменю, когда у родительского LI есть класс .open */
.menu-item.open > .submenu {
    max-height: 1000px;
}

/* Поворачиваем "стрелочку" при открытом пункте */
.menu-item.open .menu-toggle {
    transform: rotate(90deg);
}

/* === ОСНОВНОЙ КОНТЕНТ === */
.main-content {
    margin-left: 320px;
    flex: 1;
    min-height: 100vh;
    background: #f8f9fa;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 30px;
    background: white;
    min-height: calc(100vh - 80px);
    margin-top: 0;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* === СТИЛИ ДЛЯ СТРАНИЦЫ МОДЕЛЕЙ === */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.model-card {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.model-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.model-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.model-card .model-info {
    margin-bottom: 15px;
}

.model-card .model-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.model-tag {
    background: #e8f4f8;
    color: #2c3e50;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    border: 1px solid #3498db;
}

.model-tag.country {
    background: #fef5e7;
    border-color: #f39c12;
    color: #d68910;
}

.model-tag.provider {
    background: #e8f4f8;
    border-color: #3498db;
    color: #2c3e50;
}

.model-tag.type {
    background: #e8f5e8;
    border-color: #27ae60;
    color: #1e8449;
}

.model-tag.open-source {
    background: #ebf3fd;
    border-color: #2980b9;
    color: #2471a3;
}

.model-tag.proprietary {
    background: #fdebf0;
    border-color: #e74c3c;
    color: #c0392b;
}

.model-tag.release {
    background: #f4f4f9;
    border-color: #8e44ad;
    color: #6c3483;
}

.model-card .model-description {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 15px;
}

.model-card .model-link {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.model-card .model-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
}

/* Заголовки */
h1 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 1.8em;
    color: #34495e;
    margin: 30px 0 20px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

h3 {
    font-size: 1.4em;
    color: #2c3e50;
    margin: 25px 0 15px;
    font-weight: 600;
}

/* Мета информация статьи */
.article-meta {
    margin-bottom: 30px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.meta-item {
    display: inline-block;
    margin-right: 20px;
    font-size: 0.9em;
    color: #555;
}

.meta-item i {
    margin-right: 5px;
    color: #3498db;
}

/* Основной текст */
.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 10px;
}

/* Блоки с информацией */
.info-box {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.warning-box {
    background: #fef5e7;
    border-left: 4px solid #f39c12;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.success-box {
    background: #e8f5e8;
    border-left: 4px solid #27ae60;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

tr:nth-child(even) {
    background: #f8f9fa;
}

tr:hover {
    background: #e8f4f8;
}

/* Код */
code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e74c3c;
}

pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Ссылки */
a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Для внешних ссылок добавляем noindex */
a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.7;
}

/* Стили для главной страницы */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 80px 30px 60px;
    margin: -40px -30px 0 -30px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="white" opacity="0.1"><polygon points="0,0 1000,0 1000,100 0,80"/></svg>') no-repeat bottom;
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-section h1 {
    color: white;
    font-size: 4em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    font-weight: 800;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.6em;
    margin-bottom: 15px;
    opacity: 0.95;
    font-weight: 300;
}

.hero-description {
    font-size: 1.1em;
    margin-bottom: 40px;
    opacity: 0.85;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.feature-card {
    background: white;
    border-radius: 15px;
    padding: 30px 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e1e8ed;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.feature-card .feature-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
    line-height: 1;
}

.feature-card h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.4em;
}

.feature-card p {
    color: #666;
    margin: 0;
    line-height: 1.6;
    font-size: 0.95em;
}

/* Адаптивность */
@media (max-width: 768px) {
    #sidebar-menu {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 20px 15px;
    }
    
    .models-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filters-panel {
        margin: 0 5px 15px;
        padding: 10px;
    }
    
    .filter-group {
        margin-bottom: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .hero-section h1 {
        font-size: 2.5em;
    }
    
    .hero-section {
        padding: 40px 20px;
        margin: -20px -15px 30px -15px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        flex-direction: column;
    }
}

/* Утилиты для отображения/скрытия элементов */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Анимации для плавного появления контента */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
