/* Основные стили и переменные - технологическая палитра */
:root {
    --primary-color: #2C3E50;      /* Темно-синий */
    --secondary-color: #3498DB;    /* Синий */
    --accent-color: #1ABC9C;       /* Бирюзовый */
    --background-light: #ECF0F1;   /* Светло-серый */
    --background-dark: #BDC3C7;    /* Серый */
    --text-dark: #2C3E50;         /* Темно-синий */
    --text-light: #7F8C8D;        /* Средне-серый */
    --border-color: #95A5A6;      /* Серый */
    --shadow-color: rgba(44, 62, 80, 0.1);
    --code-bg: #1E1E1E;           /* Темный фон для кода */
    --code-text: #D4D4D4;         /* Светлый текст для кода */
    --success-color: #27AE60;     /* Зеленый для успеха */
    --warning-color: #F39C12;     /* Оранжевый для предупреждений */
    --error-color: #E74C3C;       /* Красный для ошибок */
    --danger-color: #E74C3C;      /* Красный для ошибок */
    --dark-color: #2C3E50;        /* Темно-синий */
    --light-color: #ECF0F1;       /* Светло-серый */
    --text-color: #2C3E50;        /* Темно-синий */
    --shadow: 0 2px 10px rgba(44, 62, 80, 0.1);
    --shadow-hover: 0 5px 20px rgba(44, 62, 80, 0.15);
}

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

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-dark) 100%);
    min-height: 100vh;
}

/* Шапка и навигация */
header {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-menu a.active {
    background: var(--accent-color);
    color: white;
}

/* Главная секция */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px var(--shadow-color);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    opacity: 0.05;
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    position: relative;
}

.hero h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    position: relative;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    position: relative;
}

/* Контент */
.content article {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 15px;
    box-shadow: 0 3px 15px var(--shadow-color);
    transition: transform 0.3s ease;
}

.content article:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px var(--shadow-color);
}

.content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.content h4 {
    color: var(--secondary-color);
    margin: 1.5rem 0 0.5rem;
    font-size: 1.2rem;
}

.content h5 {
    color: var(--dark-color);
    margin: 1rem 0 0.5rem;
    font-size: 1.1rem;
}

.content p {
    margin-bottom: 1rem;
    color: var(--text-light);
    line-height: 1.8;
}

.content ol, .content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

/* Блоки определений */
.definition-box {
    background: linear-gradient(135deg, #f5f7fa, white);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.definition-box p {
    margin: 0;
    color: var(--text-dark);
}

.definition-box strong {
    color: var(--primary-color);
}

/* Сетка элементов */
.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.element-card {
    background: linear-gradient(135deg, #f5f7fa, white);
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    text-align: center;
}

.element-card:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.element-card h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

/* Типы циклов */
.cycle-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.cycle-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    transition: all 0.3s ease;
}

.cycle-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
}

.cycle-card h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
}

.cycle-note {
    background: #e8f5e9;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    font-size: 0.9em;
    color: var(--success-color);
}

/* Примеры и вариации */
.examples-grid, .for-variations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.example-card, .variation-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
}

/* Вложенные циклы */
.nested-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.nested-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.nested-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* Операторы управления */
.control-operators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.operator-card {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.operator-card:hover {
    border-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* Бесконечные циклы */
.infinite-loops {
    margin: 20px 0;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.warning-box h4 {
    color: var(--warning-color);
    margin-bottom: 10px;
}

.infinite-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.infinite-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

/* Блок-схема */
.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa, white);
    border-radius: 15px;
}

.flowchart-block {
    background: white;
    border: 2px solid var(--primary-color);
    padding: 1rem 2rem;
    margin: 0.5rem 0;
    border-radius: 10px;
    font-weight: 500;
    text-align: center;
    min-width: 200px;
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: all 0.3s ease;
}

.flowchart-block:hover {
    transform: scale(1.05);
    background: var(--secondary-color);
    color: white;
}

.flowchart-block.start,
.flowchart-block.end {
    border-radius: 25px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.flowchart-block.input,
.flowchart-block.output {
    transform: skewX(-10deg);
    background: linear-gradient(135deg, var(--accent-color), #16A085);
    color: white;
    border-color: var(--accent-color);
}

.flowchart-block.input > *,
.flowchart-block.output > * {
    transform: skewX(10deg);
}

.flowchart-block.decision {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    padding: 30px;
    border: none;
}

.flowchart-block.process {
    background: linear-gradient(135deg, #3498DB, #2980B9);
    color: white;
    border-color: var(--secondary-color);
}

.flowchart-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0.25rem 0;
}

.flowchart-arrow-loop {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 10px 0;
}

.flowchart-branches {
    display: flex;
    justify-content: center;
    gap: 100px;
    margin: 20px 0;
}

.branch-left,
.branch-right {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flowchart-arrow-label {
    font-weight: 600;
    color: var(--dark-color);
    margin: 5px;
}

/* Таблица сравнения */
.comparison-table {
    margin: 20px 0;
    overflow-x: auto;
}

/* Примеры кода */
.code-example, .code-preview {
    background: var(--code-bg);
    border-radius: 10px;
    padding: 1.5rem;
    overflow-x: auto;
    margin-top: 1rem;
    box-shadow: 0 3px 10px var(--shadow-color);
    max-width: 100%;
    position: relative;
    /* Защита от копирования */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.code-example::before, .code-preview::before {
    content: 'C#';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.code-example pre, .code-preview pre {
    margin: 0;
    overflow-x: auto;
    max-width: 100%;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.code-example code, .code-preview code {
    color: var(--code-text);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    display: block;
    white-space: pre;
    word-wrap: normal;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Таблицы */
.operators-table, .grading-table {
    margin: 20px 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: #f5f5f5;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Сетка задач */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.task-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 3px 10px var(--shadow-color);
    transition: all 0.3s ease;
}

.task-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px var(--shadow-color);
}

.task-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.task-card ul {
    list-style-position: inside;
    color: var(--text-light);
}

.task-card li {
    margin: 8px 0;
}

/* Оптимизация */
.optimization-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.opt-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
}

.opt-card h4 {
    margin-bottom: 15px;
}

/* Функции */
.features {
    margin-top: 3rem;
}

.features h3 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 3px 15px var(--shadow-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.feature:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.feature-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.feature h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.feature p {
    color: var(--text-light);
}

/* Интерактивные демо */
.example-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.interactive-demo {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.demo-input {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.demo-input label {
    font-weight: 600;
    color: var(--dark-color);
}

.demo-input input,
.demo-input select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    flex: 1;
    min-width: 150px;
}

.demo-input input:focus,
.demo-input select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.demo-input button,
button {
    padding: 10px 25px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-input button:hover,
button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

.demo-result {
    padding: 20px;
    background: #f0f8ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 5px;
    margin: 20px 0;
    font-family: 'Consolas', monospace;
    white-space: pre-wrap;
    min-height: 60px;
}

.demo-steps, .demo-result.table-container {
    max-height: 400px;
    overflow-y: auto;
}

.visual-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    margin-top: 20px;
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 5px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    margin-top: 20px;
}

.number-grid .number {
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.number-grid .prime {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.formula-display {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
    font-family: 'Consolas', monospace;
}

.pattern-display {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    white-space: pre;
    line-height: 1.2;
    margin-top: 20px;
}

.matrix-display {
    overflow-x: auto;
    margin-top: 20px;
}

.matrix-display table {
    border-collapse: separate;
    border-spacing: 5px;
}

.matrix-display td {
    padding: 10px 15px;
    background: var(--primary-color);
    color: white;
    text-align: center;
    border-radius: 5px;
    font-weight: 600;
    min-width: 40px;
}

/* Секция советов */
.tips-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.tip-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.tip-card:hover {
    transform: scale(1.05);
}

.tip-card h4 {
    color: white;
    margin-bottom: 10px;
}

/* Страница О работе */
.info-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.info-table {
    width: 100%;
    border: none;
}

.info-table th {
    background: transparent;
    color: var(--dark-color);
    text-align: left;
    padding: 10px;
    font-weight: 600;
    width: 40%;
}

.info-table td {
    padding: 10px;
    color: #666;
}

/* Цели работы */
.goals-container {
    margin: 20px 0;
}

.goal-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.goal-card.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.goal-icon {
    font-size: 2em;
    margin-bottom: 10px;
    display: block;
}

/* Списки */
.tasks-list {
    margin-left: 20px;
}

.tasks-list > li {
    margin-bottom: 20px;
}

.tasks-list ul {
    margin-top: 10px;
    margin-left: 20px;
}

.tips-list {
    list-style: none;
    margin-left: 0;
}

.tips-list li {
    background: linear-gradient(135deg, #f5f7fa, white);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
    transition: all 0.3s ease;
}

.tips-list li:hover {
    background: linear-gradient(135deg, white, #f5f7fa);
    transform: translateX(5px);
}

/* Технологии */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.tech-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.tech-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Теория */
.theory-box {
    background: linear-gradient(135deg, #f0f8ff, white);
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid var(--secondary-color);
    margin: 1.5rem 0;
}

.theory-sections {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.theory-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

/* Навыки */
.skills-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.skill-category {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-top: 4px solid var(--primary-color);
}

.skill-category h4 {
    margin-bottom: 15px;
}

.skill-category ul {
    list-style-position: inside;
}

.skill-category li {
    margin: 10px 0;
    color: #666;
}

/* Структура отчета */
.report-structure {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.report-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
}

.report-section h4 {
    margin-bottom: 15px;
}

/* Требования к отчету */
.report-requirements {
    background: linear-gradient(135deg, #f0f8ff, white);
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid var(--secondary-color);
    margin: 1.5rem 0;
}

/* Описание задачи */
.task-description {
    background: linear-gradient(135deg, #f0fff4, white);
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid var(--success-color);
    margin: 1.5rem 0;
}

/* Советы по отладке */
.debug-tips {
    background: linear-gradient(135deg, #fff5f5, white);
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid var(--warning-color);
    margin: 1.5rem 0;
}

/* Критерии оценивания */
.grading-criteria {
    margin: 30px 0;
}

.grading-table {
    box-shadow: var(--shadow);
    border-radius: 10px;
    overflow: hidden;
}

.grading-table tfoot {
    background: #f8f9fa;
    font-weight: 600;
}

.grade-scale {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.grade-scale ul {
    list-style: none;
    margin-top: 15px;
}

.grade-scale li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

/* Литература */
.literature-list {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin: 20px 0;
}

.literature-list h4 {
    margin-top: 20px;
    margin-bottom: 15px;
}

.literature-list ol,
.literature-list ul {
    margin-left: 20px;
}

.literature-list li {
    margin: 10px 0;
}

.literature-list a {
    color: var(--primary-color);
    text-decoration: none;
}

.literature-list a:hover {
    text-decoration: underline;
}

/* Контрольные вопросы */
.questions-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.question-block {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--primary-color);
}

.question-block h4 {
    margin-bottom: 20px;
}

.question-block ol {
    margin-left: 20px;
}

.question-block li {
    margin: 12px 0;
    color: #666;
}

/* Типичные ошибки */
.errors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.error-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--danger-color);
    box-shadow: var(--shadow);
}

.error-card h4 {
    color: var(--danger-color);
    margin-bottom: 15px;
}

.error-example {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.error-example .wrong {
    color: var(--danger-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.error-example .correct {
    color: var(--success-color);
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 5px;
}

.error-example code {
    display: block;
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 10px;
    border-radius: 5px;
    margin: 5px 0;
    font-family: 'Consolas', monospace;
}

/* Применение в реальных проектах */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.app-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.app-card:hover {
    transform: scale(1.05);
}

.app-card h4 {
    color: white;
    margin-bottom: 10px;
}

/* Дополнительные задания */
.extra-tasks {
    background: #fff3cd;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--warning-color);
    margin: 20px 0;
}

.extra-tasks h4 {
    margin-bottom: 20px;
}

.extra-tasks ol {
    margin-left: 20px;
}

.extra-tasks li {
    margin: 20px 0;
}

.extra-tasks li strong {
    display: block;
    margin-bottom: 10px;
    color: var(--dark-color);
}

/* Контактная информация */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.contact-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--primary-color);
}

.contact-card h4 {
    margin-bottom: 15px;
}

.contact-card p {
    margin: 8px 0;
    text-align: left;
    color: #666;
}

/* Футер */
footer {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content p {
    margin-bottom: 0.5rem;
    color: white;
}

/* Анимации при загрузке */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero, .content article, .feature {
    animation: fadeIn 0.6s ease-out;
}

.content article:nth-child(2) {
    animation-delay: 0.2s;
}

.content article:nth-child(3) {
    animation-delay: 0.4s;
}

.content article:nth-child(4) {
    animation-delay: 0.6s;
}

/* Адаптивность */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2em;
    }
    
    .hero h2 {
        font-size: 1.5em;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-menu a {
        padding: 15px 20px;
    }
    
    .content {
        padding: 20px;
    }
    
    .flowchart-branches {
        flex-direction: column;
        gap: 20px;
    }
    
    .demo-input {
        flex-direction: column;
    }
    
    .demo-input input,
    .demo-input select,
    .demo-input button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    main {
        padding: 10px;
    }
    
    .hero {
        padding: 30px 15px;
    }
    
    .content {
        padding: 15px;
    }
    
    h3 {
        font-size: 1.5em;
    }
    
    h4 {
        font-size: 1.1em;
    }
    
    .elements-grid,
    .cycle-types,
    .control-operators,
    .task-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Кастомная полоса прокрутки */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--secondary-color), var(--primary-color));
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
}

/* Специально для блоков кода */
.code-example::-webkit-scrollbar-track,
.code-preview::-webkit-scrollbar-track {
    background: var(--code-bg);
}

.code-example::-webkit-scrollbar-thumb,
.code-preview::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

.code-example::-webkit-scrollbar-thumb:hover,
.code-preview::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Печать */
@media print {
    header, footer {
        display: none;
    }
    
    main {
        max-width: 100%;
        padding: 0;
    }
    
    .content article {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .code-example, .code-preview {
        background: #f5f5f5;
        border: 1px solid #ddd;
    }
}