

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

/* результат ответа */
.task-solution { margin-top: 12px; }
.user-answer {
  display:flex; align-items:center; gap:10px;
  padding:12px 14px; border-radius:10px;
  background:#eef6ff; border:2px solid #cfe7ff;
}
.user-answer.correct {
  background:#eafaf1; border-color:#b9f2cc;
}
.user-answer.wrong {
  background:#fff0f0; border-color:#ffc7c7;
}
.user-answer .answer-status { margin-left:auto; }
.user-answer.wrong .answer-status { color:#e74c3c; }
.user-answer.correct .answer-status { color:#27ae60; }
.user-answer .answer-hint { color:#e74c3c; font-weight:600; }

.theory-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 1.05rem;
}
.lesson-section {
  margin: 40px 0;
  padding: 25px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-progress {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
}

.section-progress.completed {
  background: #e6ffed;
  color: #27ae60;
}
.section-progress.in-progress {
  background: #fff7e6;
  color: #f39c12;
}

.theory-block {
  margin-bottom: 30px;
}
.theory-block h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}
.theory-text p {
  margin-bottom: 10px;
}

.formula-block {
  background: #f9f9f9;
  border-left: 4px solid #3498db;
  padding: 12px;
  margin: 15px 0;
  border-radius: 6px;
}
.formula {
  font-family: 'Courier New', monospace;
  font-size: 16px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
}
.rule-card {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px;
}
.rule-title {
  font-weight: bold;
  margin-bottom: 5px;
}
.rule-formula {
  font-family: monospace;
  color: #3498db;
  margin-bottom: 5px;
}
.rule-example {
  font-size: 13px;
  color: #555;
}

.key-points {
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 15px;
}
.key-points h4 {
  margin-bottom: 10px;
}
.key-points ul {
  padding-left: 20px;
  list-style: disc;
}
.key-points li {
  margin-bottom: 6px;
}

.theory-content h1, 
.theory-content h2, 
.theory-content h3 {
    margin: 1.5rem 0 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.theory-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
    list-style: disc;
}

.theory-content li {
    margin-bottom: 0.5rem;
}

.theory-content img {
    max-width: 100%;
    margin: 1rem auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.theory-content a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.theory-content a:hover {
    text-decoration: underline;
}

/* Навигация урока */
.lesson-nav {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lesson-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lesson-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.lesson-breadcrumb a:hover {
    color: var(--primary);
}

.lesson-breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

.lesson-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Мини прогресс в навигации */
.lesson-progress-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-circle {
    position: relative;
    width: 40px;
    height: 40px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
}

/* Таймер урока */
.lesson-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
}

/* Основной контент урока */
.lesson-main {
    padding-top: 80px;
    background: var(--bg-primary);
    min-height: 100vh;
}

.lesson-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    padding: 20px;
}

/* Боковая панель */
.lesson-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 25px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.lesson-nav-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-secondary);
}

.lesson-nav-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.lesson-nav-progress {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Навигация по разделам урока */
.lesson-navigation {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 25px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    border: 2px solid transparent;
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

.nav-item.completed {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--accent);
}

.nav-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.nav-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.nav-item .nav-icon {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.completed .nav-icon {
    background: var(--accent);
    color: white;
}

.nav-item.active .nav-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-content {
    flex: 1;
}

.nav-title {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.nav-description {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
}

.nav-time {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Достижения урока */
.lesson-achievements {
    border-top: 1px solid var(--bg-secondary);
    padding-top: 20px;
}

.lesson-achievements h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.achievement-item.earned {
    color: var(--accent);
}

.achievement-item.earned i {
    color: var(--accent);
}

/* Основной контент */
.lesson-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Заголовок урока */
.lesson-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lesson-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.lesson-number,
.lesson-subject {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.lesson-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

.lesson-description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
    line-height: 1.5;
}

.lesson-stats {
    display: flex;
    gap: 25px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.lesson-actions {
    display: flex;
    gap: 15px;
}

.lesson-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.lesson-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lesson-actions .btn-primary {
    background: white;
    color: var(--primary);
}

.lesson-actions .btn-primary:hover {
    background: #f8fafc;
}

/* Разделы урока */
.lesson-section {
    padding: 40px;
    border-bottom: 1px solid var(--bg-secondary);
}

.lesson-section:last-child {
    border-bottom: none;
}

.lesson-section.locked {
    opacity: 0.6;
    pointer-events: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-secondary);
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header i {
    color: var(--primary);
}

.section-progress {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-progress.completed {
    background: var(--accent);
    color: white;
}

.section-progress.in-progress {
    background: var(--warning);
    color: white;
}

.section-progress.locked {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Теоретическая часть */
.theory-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.theory-block {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
}

.theory-block h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.theory-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.theory-text p {
    margin-bottom: 15px;
}

.theory-text strong {
    color: var(--primary);
}

/* Формулы */
.formula-block {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.formula {
    font-family: 'Times New Roman', serif;
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 500;
}

.formula.answer {
    background: var(--accent);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
}

/* Интерактивная демонстрация */
.interactive-demo {
    background: white;
    padding: 25px;
    border-radius: var(--radius-lg);
    border: 1px solid #e5e7eb;
    margin: 20px 0;
}

.interactive-demo h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.demo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.demo-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.demo-controls input[type="range"] {
    width: 200px;
}

#derivative-canvas {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
}

/* Правила дифференцирования */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.rule-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid #e5e7eb;
    text-align: center;
    transition: var(--transition);
}

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

.rule-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.rule-formula {
    font-family: 'Times New Roman', serif;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.rule-example {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Ключевые моменты */
.key-points {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    padding: 25px;
    border-radius: var(--radius-lg);
    margin: 20px 0;
}

.key-points h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.key-points ul {
    list-style: none;
    padding: 0;
}

.key-points li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.key-points li::before {
    content: '✓';
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Примеры решения */
.examples-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.example-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.example-header {
    background: var(--primary);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.example-number {
    font-weight: 700;
    font-size: 1.1rem;
}

.example-difficulty {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.example-difficulty.easy {
    background: var(--accent);
}

.example-difficulty.medium {
    background: var(--warning);
}

.example-difficulty.hard {
    background: var(--danger);
}

.example-problem {
    padding: 25px;
    background: white;
}

.example-problem h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.example-solution {
    padding: 25px;
}

.example-solution.collapsed .solution-steps {
    display: none;
}

.solution-toggle {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.solution-toggle:hover {
    background: var(--primary-dark);
}

.solution-steps {
    margin-top: 20px;
}

.solution-step {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
}

.step-number {
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content p {
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* Практические задания */
.practice-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.practice-task {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    transition: var(--transition);
    overflow: hidden;
}

.practice-task.completed {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.05);
}

.practice-task.active {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.practice-task.locked {
    opacity: 0.6;
    pointer-events: none;
}

.task-header {
    padding: 20px 25px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--bg-secondary);
}

.task-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.task-number {
    font-weight: 700;
    color: var(--text-primary);
}

.task-difficulty {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.task-difficulty.easy {
    background: var(--accent);
}

.task-difficulty.medium {
    background: var(--warning);
}

.task-difficulty.hard {
    background: var(--danger);
}

.task-points {
    background: var(--gradient-primary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.task-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.task-status.completed {
    color: var(--accent);
}

.task-status i {
    font-size: 0.8rem;
}

.task-content {
    padding: 25px;
}

.task-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* Решение пользователя */
.task-solution {
    margin: 20px 0;
}

.user-answer {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: var(--radius-md);
    border: 2px solid var(--bg-secondary);
}

.user-answer.correct {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.05);
}

.user-answer.incorrect {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.answer-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.answer-text {
    font-family: 'Times New Roman', serif;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.answer-status {
    margin-left: auto;
    font-size: 1.2rem;
}

.user-answer.correct .answer-status {
    color: var(--accent);
}

.user-answer.incorrect .answer-status {
    color: var(--danger);
}

/* Ввод ответа */
.task-input {
    margin: 20px 0;
}

.task-input label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.answer-input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: var(--radius-md);
    border: 2px solid #e5e7eb;
    transition: var(--transition);
}

.answer-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.function-prefix {
    font-family: 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.answer-input input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Times New Roman', serif;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.check-answer {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.check-answer:hover {
    background: var(--primary-dark);
}

/* Подсказки */
.answer-hints {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hint-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hint-item i {
    color: var(--primary);
}

/* Инструменты задания */
.task-tools {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.tool-btn {
    background: var(--bg-secondary);
    border: 1px solid #e5e7eb;
    color: var(--text-secondary);
    padding: 8px 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* Калькулятор производных */
.practice-tool {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.tool-header {
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.1);
}

.tool-header h4 {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calculator-content {
    padding: 25px;
}

.calc-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.calc-input input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: 15px;
}

.calc-buttons {
    margin-bottom: 20px;
}

.calc-result {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: var(--radius-lg);
}

.result-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.step-label {
    font-weight: 600;
}

.step-formula {
    font-family: 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Тест */
.test-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.test-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.test-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.test-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.test-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 500px;
}

.test-requirements {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: var(--radius-lg);
    text-align: left;
}

.test-requirements h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--text-secondary);
}

.requirement.completed {
    color: var(--accent);
}

.requirement.in-progress {
    color: var(--warning);
}

/* Панель заметок */
.notes-panel {
    position: fixed;
    top: 80px;
    right: -350px;
    width: 350px;
    height: calc(100vh - 80px);
    background: var(--bg-card);
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.notes-panel.active {
    right: 0;
}

.notes-header {
    padding: 20px;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notes-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-notes {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
}

.notes-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.note-item {
    margin-bottom: 15px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.note-timestamp {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.note-text {
    color: var(--text-primary);
    line-height: 1.4;
}

.notes-input {
    padding: 20px;
    border-top: 1px solid var(--bg-secondary);
}

.notes-input textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    padding: 12px;
    resize: vertical;
    margin-bottom: 10px;
}

.add-note {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.add-note:hover {
    background: var(--primary-dark);
}

/* Нижняя навигация */
.lesson-navigation-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    padding: 15px 0;
    z-index: 999;
}

.lesson-navigation-bottom .nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.lesson-progress-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.progress-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: var(--transition);
    cursor: pointer;
}

.dot.completed {
    background: var(--accent);
}

.dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .lesson-container {
        grid-template-columns: 250px 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    .lesson-header {
        padding: 30px;
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .lesson-title {
        font-size: 2rem;
    }
}

@media (max-width: 1024px) {
    .lesson-container {
        grid-template-columns: 1fr;
    }
    
    .lesson-sidebar {
        position: static;
        order: 2;
    }
    
    .lesson-content {
        order: 1;
    }
    
    .lesson-navigation {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .nav-item {
        min-width: 200px;
    }
    
    .rules-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .lesson-main {
        padding-bottom: 100px;
    }
    
    .lesson-breadcrumb {
        display: none;
    }
    
    .lesson-controls {
        gap: 10px;
    }
    
    .lesson-progress-mini .progress-text {
        display: none;
    }
    
    .lesson-header {
        padding: 20px;
    }
    
    .lesson-title {
        font-size: 1.5rem;
    }
    
    .lesson-stats {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .lesson-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .lesson-section {
        padding: 25px 20px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .theory-block,
    .example-solution,
    .task-content {
        padding: 20px;
    }
    
    .solution-step {
        flex-direction: column;
        gap: 15px;
    }
    
    .task-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .task-info {
        flex-wrap: wrap;
    }
    
    .notes-panel {
        width: 100%;
        right: -100%;
    }
    
    .lesson-navigation-bottom .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .lesson-container {
        padding: 10px;
    }
    
    .lesson-header {
        padding: 15px;
    }
    
    .lesson-section {
        padding: 20px 15px;
    }
    
    .theory-block,
    .example-card,
    .practice-task {
        margin: 0 -5px;
    }
    
    .demo-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .demo-controls input[type="range"] {
        width: 100%;
    }
}

/* Анимации */
@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.lesson-section {
    animation: slideInUp 0.5s ease-out;
}

.practice-task {
    animation: slideInRight 0.3s ease-out;
}

/* Печать */
@media print {
    .lesson-nav,
    .lesson-sidebar,
    .lesson-navigation-bottom,
    .notes-panel,
    .lesson-actions,
    .task-tools {
        display: none !important;
    }
    
    .lesson-container {
        grid-template-columns: 1fr;
        padding: 0;
    }
    
    .lesson-content {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .lesson-header {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #ccc;
    }
}

/* Специальные эффекты для формул */
.formula {
    position: relative;
}

.formula::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    z-index: -1;
    border-radius: inherit;
}

/* Hover эффекты */
.rule-card:hover .rule-formula {
    color: var(--primary-dark);
    transform: scale(1.05);
    transition: var(--transition);
}

.nav-item:hover .nav-icon {
    transform: scale(1.1);
}

/* Focus состояния для доступности */
.nav-item:focus,
.tool-btn:focus,
.check-answer:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .formula-block {
        background: var(--bg-secondary);
        border-color: var(--text-secondary);
    }
    
    .interactive-demo {
        background: var(--bg-secondary);
        border-color: var(--text-secondary);
    }
    
    .rule-card {
        background: var(--bg-secondary);
        border-color: var(--text-secondary);
    }
}