:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --light-bg: #f8f9fa;
    --light-text: #212529;
    --light-card: #ffffff;
    --light-border: #e9ecef;
    --dark-bg: #121826;
    --dark-text: #f8f9fa;
    --dark-card: #1e293b;
    --dark-border: #334155;
    --transition: all 0.3s ease;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background-color: var(--light-bg);
    color: var(--light-text);
    transition: var(--transition);
}

body.dark-theme {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Модальное окно для изображений */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.modal.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    z-index: 1001;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-close:hover {
    color: #ff6b6b;
    transform: rotate(90deg);
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1001;
}

.modal-prev,
.modal-next {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-prev:hover,
.modal-next:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-caption {
    color: white;
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    font-size: 16px;
    max-width: 80%;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .modal-img {
        max-width: 95%;
        max-height: 70vh;
    }
    
    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 35px;
    }
    
    .modal-prev,
    .modal-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .modal-caption {
        font-size: 14px;
        padding: 10px;
    }
}

/* Header */
header {
    padding: 15px 0; /* Уменьшено с 20px */
    border-bottom: 1px solid var(--light-border);
    background-color: var(--light-card);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.dark-theme header {
    background-color: var(--dark-card);
    border-bottom: 1px solid var(--dark-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: var(--light-text);
    transition: var(--transition);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-theme .theme-toggle {
    color: var(--dark-text);
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.dark-theme .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main content */
main {
    display: flex;
    gap: 30px;
    padding: 40px 0;
    min-height: calc(100vh - 100px);
}

/* Sidebar navigation */
.sidebar {
    flex: 0 0 290px; /* УВЕЛИЧЕНО с 280px до 300px */
    position: sticky;
    top: 100px;
    height: fit-content;
}

.nav-title {
    font-size: 12px; /* УМЕНЬШЕНО с 14px */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    margin-bottom: 12px; /* УМЕНЬШЕНО с 15px */
    padding-left: 10px;
}

body.dark-theme .nav-title {
    color: #94a3b8;
}

.nav-menu {
    list-style: none;
    background-color: var(--light-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

body.dark-theme .nav-menu {
    background-color: var(--dark-card);
}

.nav-item {
    margin-bottom: 8px;
}

.nav-item:last-child {
    margin-bottom: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px; /* УМЕНЬШЕНО вертикальные отступы с 14px */
    text-decoration: none;
    color: var(--light-text);
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
    font-size: 14px; /* ДОБАВЛЕНО уменьшение шрифта */
}

body.dark-theme .nav-link {
    color: #e2e8f0;
}

/* ИСПРАВЛЕНИЕ: убираем подчеркивание при наведении только в меню */
.nav-link:hover {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    text-decoration: none; /* Добавлено: убираем подчеркивание */
}

body.dark-theme .nav-link:hover {
    background-color: rgba(67, 97, 238, 0.2);
    color: #93c5fd;
    text-decoration: none; /* Добавлено: убираем подчеркивание */
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-link i {
    font-size: 16px; /* УМЕНЬШЕНО с 18px */
    width: 20px; /* УМЕНЬШЕНО с 24px */
}

body.dark-theme .nav-link i {
    color: #cbd5e1;
}

body.dark-theme .nav-link:hover i {
    color: #93c5fd;
}

/* Content area */
.content {
    flex: 1;
}

.content-section {
    display: none;
    background-color: var(--light-card);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

body.dark-theme .content-section {
    background-color: var(--dark-card);
}

.content-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-subtitle {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 25px;
    font-weight: 400;
}

body.dark-theme .section-subtitle {
    color: #94a3b8;
}

.instruction-step {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--light-border);
}

body.dark-theme .instruction-step {
    border-bottom: 1px solid var(--dark-border);
}

.instruction-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--secondary-color);
}

body.dark-theme .step-title {
    color: #7c3aed;
}

.step-content {
    line-height: 1.7;
    color: var(--light-text);
}

body.dark-theme .step-content {
    color: #cbd5e1;
}

.step-content p {
    margin-bottom: 10px;
}

.step-content ul, .step-content ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.step-content li {
    margin-bottom: 8px;
}

.code-block {
    background-color: #f1f5f9;
    padding: 16px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    margin: 15px 0;
    overflow-x: auto;
    border-left: 4px solid var(--primary-color);
}

body.dark-theme .code-block {
    background-color: #0f172a;
    color: #e2e8f0;
}

.note {
    background-color: #e0f2fe;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #0284c7;
    margin: 15px 0;
}

body.dark-theme .note {
    background-color: rgba(2, 132, 199, 0.2);
}

.warning {
    background-color: #fef3c7;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #d97706;
    margin: 15px 0;
}

body.dark-theme .warning {
    background-color: rgba(217, 119, 6, 0.2);
}

.success {
    background-color: #d1fae5;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #059669;
    margin: 15px 0;
}

body.dark-theme .success {
    background-color: rgba(5, 150, 105, 0.2);
}

.tip {
    background-color: #f3e8ff;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #7c3aed;
    margin: 15px 0;
}

body.dark-theme .tip {
    background-color: rgba(124, 58, 237, 0.2);
}

.command {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    display: inline-block;
    margin: 5px 0;
}

body.dark-theme .command {
    background-color: #0f172a;
}

.important {
    font-weight: 600;
    color: var(--primary-color);
}

body.dark-theme .important {
    color: #60a5fa;
}

/* Стили для ссылок */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Ссылки в тёмной теме */
body.dark-theme a {
    color: #60a5fa;
}

body.dark-theme a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Ссылки в контенте */
body.dark-theme .step-content a,
body.dark-theme .instruction-step a,
body.dark-theme .content-section a {
    color: #60a5fa;
    text-decoration: underline;
    text-decoration-color: rgba(96, 165, 250, 0.3);
}

body.dark-theme .step-content a:hover,
body.dark-theme .instruction-step a:hover,
body.dark-theme .content-section a:hover {
    color: #93c5fd;
    text-decoration-color: rgba(147, 197, 253, 0.5);
}

/* Ссылки в заголовках шагов */
body.dark-theme .step-title a {
    color: #60a5fa;
}

body.dark-theme .step-title a:hover {
    color: #93c5fd;
}

/* Ссылки в code-block */
body.dark-theme .code-block a {
    color: #93c5fd;
    text-decoration: underline;
}

body.dark-theme .code-block a:hover {
    color: #bfdbfe;
}

.model-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.model-item {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

body.dark-theme .model-item {
    background-color: rgba(67, 97, 238, 0.1);
}

/* Ссылки в model-list */
body.dark-theme .model-list a {
    color: #60a5fa;
}

body.dark-theme .model-list a:hover {
    color: #93c5fd;
}

.gallery-placeholder {
    background-color: #e9ecef;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
    border: 2px dashed #adb5bd;
}

body.dark-theme .gallery-placeholder {
    background-color: #2d3748;
    border-color: #4a5568;
}

.gallery-placeholder i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 15px;
}

body.dark-theme .gallery-placeholder i {
    color: #94a3b8;
}

.download-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    margin: 10px 5px;
    transition: var(--transition);
}

.download-link:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Ссылки в download-link для тёмной темы */
body.dark-theme .download-link {
    background-color: #2563eb;
    color: white;
}

body.dark-theme .download-link:hover {
    background-color: #1d4ed8;
    color: white;
}

/* Footer */
footer {
    text-align: center;
    padding: 25px 0;
    border-top: 1px solid var(--light-border);
    color: #6c757d;
    font-size: 14px;
    background-color: var(--light-card);
}

body.dark-theme footer {
    border-top: 1px solid var(--dark-border);
    color: #94a3b8;
    background-color: var(--dark-card);
}

/* Ссылки в футере */
footer a {
    color: var(--primary-color);
}

footer a:hover {
    text-decoration: underline;
}

body.dark-theme footer a {
    color: #60a5fa;
}

body.dark-theme footer a:hover {
    color: #93c5fd;
}

/* Responsive */
@media (max-width: 992px) {
    main {
        flex-direction: column;
    }
    
    .sidebar {
        flex: 0 0 auto;
        width: 100%;
        position: static;
    }
    
    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .nav-item {
        flex: 1;
        min-width: 200px;
        margin-bottom: 0;
    }
}

@media (max-width: 576px) {
    /* Шапка */
    header {
        padding: 10px 0; /* Еще меньше отступы на мобильных */
    }
    
    .logo h1 {
        font-size: 20px; /* Уменьшаем размер заголовка */
    }
    
    .logo-icon img {
        max-height: 30px !important; /* Уменьшаем логотип */
    }
    
    /* Уменьшаем кнопку переключения темы */
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .header-content {
        gap: 10px; /* Уменьшаем расстояние между элементами */
    }
    
    /* Основной контент */
    main {
        padding: 20px 0; /* Уменьшили с 40px */
        min-height: calc(100vh - 80px); /* Уменьшили высоту */
        gap: 20px; /* Уменьшаем расстояние между элементами */
    }
    
    /* Навигационное меню */
    .nav-menu {
        flex-direction: column;
        padding: 15px; /* Уменьшаем внутренние отступы */
    }
    
    .nav-item {
        min-width: 100%;
    }
    
    /* Контент секций */
    .content-section {
        padding: 20px; /* Уменьшаем с 30px */
        margin-bottom: 20px; /* Уменьшаем с 30px */
    }
    
    /* Заголовки */
    .section-title {
        font-size: 22px; /* Уменьшаем с 28px */
    }
    
    .section-subtitle {
        font-size: 14px; /* Уменьшаем с 16px */
        margin-bottom: 20px; /* Уменьшаем с 25px */
    }
    
    /* Шаги инструкций */
    .instruction-step {
        margin-bottom: 20px; /* Уменьшаем с 25px */
        padding-bottom: 20px; /* Уменьшаем с 25px */
    }
    
    .step-title {
        font-size: 18px; /* Уменьшаем с 20px */
        margin-bottom: 10px; /* Уменьшаем с 12px */
    }
    
    /* Модальное окно (дополнительная оптимизация) */
    .modal-img {
        max-height: 60vh; /* Уменьшаем с 70vh */
    }
    
    .modal-caption {
        font-size: 13px; /* Еще уменьшаем */
        padding: 8px;
        margin-top: 15px;
    }
    
    /* Grid элементы */
    .model-list {
        grid-template-columns: 1fr;
    }
    
    /* Кнопки загрузки */
    .download-link {
        padding: 8px 16px; /* Уменьшаем */
        margin: 8px 4px;
        font-size: 14px;
    }
    
    /* Футер */
    footer {
        padding: 15px 0; /* Уменьшаем с 25px */
        font-size: 13px; /* Уменьшаем текст */
    }
    
    .container {
        padding: 0 15px; /* Уменьшаем боковые отступы на мобильных */
    }
}

/* Для очень маленьких экранов (например, iPhone SE) */
@media (max-width: 375px) {
    .logo h1 {
        font-size: 18px;
    }
    
    .logo-icon img {
        max-height: 25px !important;
    }
    
    header {
        padding: 8px 0;
    }
    
    .header-content {
        gap: 8px;
    }
    
    .theme-toggle {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .section-title {
        font-size: 20px;
        gap: 8px;
    }
    
    .section-title i {
        font-size: 20px;
    }
    
    .content-section {
        padding: 16px;
    }
    
    .code-block {
        padding: 12px;
        font-size: 13px;
    }
    
    .note, .warning, .success, .tip {
        padding: 12px;
    }
}
/* ===== ЖЁСТКО убираем подчёркивание в меню (ПК + мобилки) ===== */
.nav-menu a,
.nav-menu a:hover,
.nav-menu a:focus,
.nav-menu a:active,
.nav-menu a:visited {
    text-decoration: none !important;
}
