/* ================================================== */
/* 1. ШАПКА СТРАНИЦЫ (СИНЯЯ) */
/* ================================================== */
.course-page-header { background: linear-gradient(135deg, #673ab7 0%, #2196f3 100%); color: #ffffff; padding: 60px 0; margin-bottom: 0; }
.course-page-header .page-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 15px; line-height: 1.2; color: #ffffff; }
.course-page-header .breadcrumbs { font-size: 0.95rem; color: rgba(255, 255, 255, 0.9); display: flex; flex-wrap: wrap; align-items: center; line-height: 1.5; }
.course-page-header .breadcrumbs a { color: rgba(255, 255, 255, 0.8); text-decoration: none; transition: color 0.2s; }
.course-page-header .breadcrumbs a:hover { color: #ffffff; }
.course-page-header .breadcrumbs .separator { margin: 0 10px; color: rgba(255, 255, 255, 0.6); font-size: 0.8rem; }
.course-page-header .breadcrumbs .current { color: #ffffff; font-weight: 600; }

/* ================================================== */
/* 2. БЛОК ПРОГРЕССА И ЗАГОЛОВОК КУРСА */
/* ================================================== */
.course-header-block { background-color: var(--card-bg); border-radius: var(--border-radius-lg); padding: 30px 40px; margin-bottom: 30px; border: 1px solid #e5e7eb; box-shadow: var(--shadow-sm); }
.course-header-block h1 { font-size: 2.2rem; font-weight: 800; color: var(--primary-color); margin: 0 0 20px 0; }
.progress-label { font-size: 0.9rem; font-weight: 600; color: var(--text-medium); margin-bottom: 8px; display: block; }
.progress-bar-container { width: 100%; height: 12px; background-color: #e5e7eb; border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary-light), var(--secondary-color)); border-radius: 6px; transition: width 0.5s ease-in-out; }

/* ================================================== */
/* 3. ОСНОВНОЙ КОНТЕЙНЕР (СЕТКА) */
/* ================================================== */
.course-container { display: grid; grid-template-columns: 300px 1fr; gap: 30px; align-items: flex-start; margin-bottom: 30px; }

/* ================================================== */
/* 4. САЙДБАР (НАВИГАЦИЯ) */
/* ================================================== */
.course-sidebar { position: sticky; top: 100px; background-color: var(--card-bg); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm); border: 1px solid #e5e7eb; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--primary-light) #f1f1f1; }
.course-sidebar::-webkit-scrollbar { width: 6px; }
.course-sidebar::-webkit-scrollbar-thumb { background-color: var(--primary-light); border-radius: 3px; }
.sidebar-header { padding: 20px; border-bottom: 1px solid #e5e7eb; background-color: #f9fafb; }
.sidebar-header h3 { font-size: 1.2rem; font-weight: 700; margin: 0; color: var(--text-dark); display: flex; align-items: center; gap: 10px; }
.course-nav ul { padding: 10px; margin: 0; list-style: none; }
.course-nav li a { display: flex; align-items: flex-start; padding: 12px 15px; border-radius: var(--border-radius-md); color: var(--text-medium); transition: all 0.2s ease; text-decoration: none; border-left: 4px solid transparent; line-height: 1.4; }
.course-nav li a:hover { background-color: #f8fafc; color: var(--text-dark); }
.course-nav li.active a { background-color: #f7f5ff; color: var(--primary-color); font-weight: 700; border-left: 4px solid var(--primary-color); }
.lesson-number { flex-shrink: 0; font-size: 1rem; font-weight: 600; color: var(--text-light); width: 24px; text-align: right; margin-right: 15px; margin-top: 2px; }
.course-nav li.active a .lesson-number { color: var(--primary-color); }

/* ================================================== */
/* 5. КОНТЕНТ УРОКА (СТАТЬЯ) */
/* ================================================== */
.lesson-article { background-color: var(--card-bg); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm); border: 1px solid #e5e7eb; overflow: hidden; }
.lesson-header { padding: 30px 40px; border-bottom: 1px solid #e5e7eb; background-color: #fff; }
.lesson-header h2 { font-size: 2.2rem; font-weight: 800; color: var(--text-dark); line-height: 1.3; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 15px; }
.lesson-header h2 i { color: var(--primary-color); margin-top: 5px; font-size: 1.8rem; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.9rem; color: var(--text-light); }
.lesson-meta span { display: flex; align-items: center; }
.lesson-meta i { margin-right: 8px; }

/* ТЕЛО СТАТЬИ (ТИПОГРАФИКА) */
.lesson-body { padding: 40px; font-size: 1.1rem; line-height: 1.8; color: var(--text-medium); overflow-x: hidden; }
.lesson-body h3 { font-size: 1.6rem; font-weight: 700; color: var(--secondary-color); margin: 40px 0 20px; padding-bottom: 10px; border-bottom: 2px solid #e5e7eb; }
.lesson-body h4 { font-size: 1.3rem; font-weight: 700; color: var(--text-dark); margin: 30px 0 15px; }
.lesson-body p { margin-bottom: 20px; }
.lesson-body ul, .lesson-body ol { padding-left: 25px; margin-bottom: 20px; }
.lesson-body li { margin-bottom: 10px; }
.lesson-body a { color: var(--primary-color); text-decoration: underline; }
.lesson-body blockquote { border-left: 4px solid var(--primary-color); padding: 20px 25px; margin: 30px 0; font-style: italic; color: var(--text-dark); font-size: 1.1rem; background-color: #f8fafc; border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0; }
.lesson-body img { width: 100%; height: auto; border-radius: var(--border-radius-lg); margin: 25px 0; box-shadow: var(--shadow-md); }
.lesson-body iframe { width: 100%; max-width: 100%; border-radius: 12px; margin: 20px 0; }

/* ДОПОЛНИТЕЛЬНЫЕ ЭЛЕМЕНТЫ В КОНТЕНТЕ */
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 30px 0; }
.comparison-item { background-color: #f8fafc; border: 1px solid #e5e7eb; border-radius: var(--border-radius-lg); padding: 25px; text-align: center; }
.comparison-item h5 { font-size: 1.1rem; font-weight: 700; margin-bottom: 15px; }
.comparison-item p { font-size: 0.9rem; color: var(--text-medium); line-height: 1.6; }
.comparison-item img { height: 200px; width: auto; margin: 15px auto; box-shadow: none; max-width: 100%; object-fit: contain; }

/* ТАБЛИЦЫ - ИСПРАВЛЕННАЯ ВЕРСИЯ */
.content-table { width: 100%; max-width: 100%; border-collapse: collapse; margin: 30px 0; box-shadow: var(--shadow-sm); border: 1px solid #e5e7eb; border-radius: var(--border-radius-lg); overflow-x: auto; -webkit-overflow-scrolling: touch; display: block; }
.content-table th, .content-table td { padding: 15px; text-align: left; border-bottom: 1px solid #e5e7eb; min-width: 150px; }
.content-table thead { background-color: var(--primary-color); color: white; }
.content-table th { font-weight: 600; }
.content-table tbody tr:nth-child(even) { background-color: #f8fafc; }
.content-table tbody tr:hover { background-color: #f1f5f9; }

.info-box { background-color: #eff6ff; border-left: 4px solid #3b82f6; border-radius: var(--border-radius-md); padding: 25px; margin: 30px 0; }
.info-box h4 { color: #1e40af; margin-top: 0; display: flex; align-items: center; gap: 10px; }
.info-box ul { list-style: none; padding-left: 0; }
.info-box li { margin-bottom: 8px; }
.info-box strong { color: #1e3a8a; }

/* НАВИГАЦИЯ (КНОПКИ) */
.lesson-navigation { display: flex; justify-content: space-between; padding: 30px 40px; border-top: 1px solid #e5e7eb; background-color: #f9fafb; gap: 20px; }
.nav-button { display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; border-radius: var(--border-radius-md); font-weight: 600; text-decoration: none; transition: all 0.2s ease; }
.nav-button.prev { background-color: #ffffff; border: 1px solid #e5e7eb; color: var(--text-medium); }
.nav-button.prev:hover { background-color: #e5e7eb; color: var(--text-dark); }
.nav-button.next { background-color: var(--primary-color); color: white; }
.nav-button.next:hover { background-color: var(--primary-dark); }
.nav-button.disabled { background-color: #f3f4f6; color: #d1d5db; cursor: not-allowed; pointer-events: none; }

/* ================================================== */
/* 6. ВИДЖЕТЫ (ДРУГИЕ КУРСЫ И СТАТЬИ) */
/* ================================================== */
.other-courses-section { margin-bottom: 30px; }
.other-courses-section .section-header { padding: 0 0 20px 0; border-bottom: 1px solid #e5e7eb; margin-bottom: 20px; }
.other-courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }
.course-card-widget-full { display: block; background-color: var(--card-bg); border-radius: var(--border-radius-lg); padding: 18px; box-shadow: var(--shadow-sm); border: 1px solid #e5e7eb; text-decoration: none; transition: all 0.2s ease; }
.course-card-widget-full:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--primary-color); }
.course-widget-title { font-size: 1.1rem; font-weight: 700; color: var(--text-dark); margin: 0 0 5px 0; }
.course-card-widget-full .course-meta { margin-bottom: 10px; gap: 15px; font-size: 0.85rem; color: var(--text-medium); display: flex; }
.course-card-widget-full .course-meta span { display: flex; align-items: center; }
.course-card-widget-full .course-meta i { margin-right: 6px; color: var(--primary-color); }
.course-widget-description { font-size: 0.9rem; color: var(--text-medium); line-height: 1.6; margin: 0; }
.related-news-section { margin-top: 40px; border-top: 1px solid #e5e7eb; padding-top: 30px; }
.related-news-section .section-header { margin-bottom: 30px; }
.related-news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }
.news-card { background-color: var(--card-bg); border-radius: var(--border-radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: all 0.2s ease; border: 1px solid #e5e7eb; }
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: #d1d5db; }
.news-card .news-image { position: relative; display: block; }
.news-card .news-image img { width: 100%; height: 180px; object-fit: cover; transition: transform .3s ease; }
.news-card:hover .news-image img { transform: scale(1.05); }
.news-card .news-category { position: absolute; top: 15px; left: 15px; background-color: var(--primary-color); color: white; padding: 5px 10px; border-radius: var(--border-radius-md); font-size: 0.8rem; font-weight: 500; }
.news-card .news-content { padding: 20px; }
.news-card .news-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; line-height: 1.4; }
.news-card .news-title a { color: var(--text-dark); text-decoration: none; }
.news-card .news-title a:hover { color: var(--primary-color); }
.news-card .news-meta { font-size: 0.85rem; color: var(--text-light); display: flex; gap: 15px; }
.news-card .news-meta span { display: flex; align-items: center; }
.news-card .news-meta i { margin-right: 6px; }

/* ================================================== */
/* 7. АДАПТИВНОСТЬ (MOBILE OPTIMIZATION) */
/* ================================================== */

/* Планшеты и меньше (до 992px) */
@media (max-width: 992px) {
    .course-container { display: flex; flex-direction: column; gap: 20px; }
    .lesson-article { order: 1; width: 100%; }
    .course-sidebar { order: 2; width: 100%; position: static; max-height: none; margin-bottom: 30px; }
    .lesson-header h2 { font-size: 1.8rem; }
    .course-header-block { padding: 25px; }
}

/* Мобильные телефоны (до 768px) */
@media (max-width: 768px ) {
    .course-page-header { padding: 30px 0; }
    .comparison-grid { grid-template-columns: 1fr; }
    .lesson-header { padding: 15px; }
    .lesson-header h2 { font-size: 1.5rem; gap: 10px; }
    .lesson-header h2 i { font-size: 1.3rem; margin-top: 3px; }
    .lesson-body { padding: 15px; font-size: 1rem; line-height: 1.6; overflow-x: hidden; }
    .lesson-body h3 { font-size: 1.3rem; margin-top: 30px; }
    .lesson-navigation { padding: 20px; flex-direction: column; gap: 15px; }
    .nav-button { width: 100%; justify-content: center; padding: 14px; }
    .course-header-block h1 { font-size: 1.6rem; }
    .other-courses-grid, .related-news-grid { grid-template-columns: 1fr; }
    .info-box { padding: 15px; }
    .lesson-body blockquote { padding: 15px; font-size: 1rem; margin: 20px 0; }
    
    /* ТАБЛИЦЫ - МОБИЛЬНАЯ АДАПТАЦИЯ */
    .content-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 20px 0; border-radius: var(--border-radius-md); max-width: calc(97vw - 40px); width: 100%; }
    .content-table th, .content-table td { white-space: nowrap; padding: 10px 12px; font-size: 0.85rem; min-width: 120px; }
}

/* Маленькие телефоны (до 576px) */
@media (max-width: 576px) {
    .course-header-block { padding: 15px; }
    .lesson-header h1, .lesson-header h2 { font-size: 1.4rem; line-height: 1.3; }
    .comparison-item img { height: auto; max-height: 180px; }
    
    /* ТАБЛИЦЫ - МАЛЕНЬКИЕ ЭКРАНЫ */
    .content-table { margin: 15px 0; }
    .content-table th, .content-table td { padding: 8px 10px; font-size: 0.8rem; min-width: 100px; }
}