/* Стили для заданий */
.assignment-container {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.assignment-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Скрываем permalink символы */
.prose .headerlink,
.headerlink {
  display: none !important;
}

/* Стили для сворачиваемых секций */
.collapse-transition {
  transition: all 0.3s ease-in-out;
  overflow: hidden;
}

.section-header {
  transition: all 0.2s ease;
}

.section-header:hover {
  transform: translateY(-1px);
}

.chevron-icon {
  transition: transform 0.2s ease;
}

/* Анимация для иконки сворачивания */
.collapsed .chevron-icon {
  transform: rotate(180deg);
}

/* Улучшенные hover эффекты */
.action-button {
  transition: all 0.15s ease;
}

.action-button:hover {
  transform: scale(1.1);
}

/* Стили для курсов */
.course-header {
  transition: all 0.2s ease;
}

.course-header:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Градиенты для разных курсов */
.course-selenium {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.course-pytest {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.course-default {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Дополнительные стили именно для описаний заданий */
.prose.prose-lg h2 {
  color: #1f2937 !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  margin-top: 0 !important;
  margin-bottom: 1.5rem !important;
  border-bottom: 2px solid #e5e7eb !important;
  padding-bottom: 0.5rem !important;
}

.dark .prose.prose-lg h2 {
  color: #f9fafb !important;
  border-bottom-color: #4b5563 !important;
}

.prose.prose-lg h3 {
  color: #374151 !important;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  margin-top: 2rem !important;
  margin-bottom: 1rem !important;
}

.dark .prose.prose-lg h3 {
  color: #e5e7eb !important;
}

.prose.prose-lg p {
  color: #4b5563 !important;
  margin-bottom: 1rem !important;
  line-height: 1.7 !important;
  font-size: 1rem !important;
}

.dark .prose.prose-lg p {
  color: #d1d5db !important;
}

.prose.prose-lg ol,
.prose.prose-lg ul {
  margin: 1.5rem 0 !important;
  padding-left: 2rem !important;
}

.prose.prose-lg ul {
  list-style-type: disc !important;
  list-style-position: outside !important;
}

.prose.prose-lg ol {
  list-style-type: decimal !important;
  list-style-position: outside !important;
}

.prose.prose-lg ol li,
.prose.prose-lg ul li {
  margin: 0.5rem 0 !important;
  color: #374151 !important;
  line-height: 1.6 !important;
  font-size: 1rem !important;
  display: list-item !important;
}

.dark .prose.prose-lg ol li,
.dark .prose.prose-lg ul li {
  color: #d1d5db !important;
}

.prose.prose-lg ul li::marker {
  color: #6366f1 !important;
}

.prose.prose-lg ol li::marker {
  color: #6366f1 !important;
  font-weight: 600 !important;
}

/* Вложенные списки для prose-lg - ИСПРАВЛЕНО */
.prose.prose-lg ul ul, 
.prose.prose-lg ol ol, 
.prose.prose-lg ul ol, 
.prose.prose-lg ol ul {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
  padding-left: 2rem !important;
  display: block !important;
}

.prose.prose-lg ul ul {
  list-style-type: circle !important;
}

.prose.prose-lg ul ul ul {
  list-style-type: square !important;
}

.prose.prose-lg ol ol {
  list-style-type: lower-alpha !important;
}

.prose.prose-lg ol ol ol {
  list-style-type: lower-roman !important;
}

/* Обеспечиваем правильные типы списков для элементов prose-lg */
.prose.prose-lg ol ol li {
  list-style-type: lower-alpha !important;
  display: list-item !important;
}

.prose.prose-lg ol ol ol li {
  list-style-type: lower-roman !important;
  display: list-item !important;
}

/* Специфичные стили для вложенных элементов списков */
.prose.prose-lg ul ul li,
.prose.prose-lg ol ol li,
.prose.prose-lg ul ol li,
.prose.prose-lg ol ul li {
  margin: 0.25rem 0 !important;
  line-height: 1.5 !important;
  display: list-item !important;
}

/* Убираем лишние отступы у первого и последнего элемента */
.prose.prose-lg ul ul li:first-child,
.prose.prose-lg ol ol li:first-child,
.prose.prose-lg ul ol li:first-child,
.prose.prose-lg ol ul li:first-child {
  margin-top: 0 !important;
}

.prose.prose-lg ul ul li:last-child,
.prose.prose-lg ol ol li:last-child,
.prose.prose-lg ul ol li:last-child,
.prose.prose-lg ol ul li:last-child {
  margin-bottom: 0 !important;
}

.prose.prose-lg strong {
  color: #1f2937 !important;
  font-weight: 700 !important;
}

.dark .prose.prose-lg strong {
  color: #f9fafb !important;
}

.prose.prose-lg code {
  background-color: #f8fafc;
  color: #475569;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

.dark .prose.prose-lg code {
  background-color: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

/* Prose стили для Markdown */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  color: inherit;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

.prose h1 {
  font-size: 1.875rem;
  line-height: 2.25rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: #1f2937;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.dark .prose h1 {
  color: #f9fafb;
  border-bottom-color: #4b5563;
}

.prose h2 {
  font-size: 1.5rem;
  line-height: 2rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #374151;
  position: relative;
}

.dark .prose h2 {
  color: #e5e7eb;
}

.prose h3 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #4b5563;
}

.dark .prose h3 {
  color: #d1d5db;
}

.prose p {
  margin-top: 1rem;
  margin-bottom: 1rem;
  line-height: 1.7;
  color: #374151;
  font-size: 1rem;
}

.dark .prose p {
  color: #d1d5db;
}

.prose strong {
  font-weight: 700;
  color: #1f2937;
}

.dark .prose strong {
  color: #f9fafb;
}

.prose em {
  font-style: italic;
  color: #4b5563;
}

.dark .prose em {
  color: #9ca3af;
}

/* Responsive images in prose content */
.prose img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: block;
  border: 1px solid #e5e7eb;
}

.dark .prose img {
  border-color: #374151;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Mobile specific image styles */
@media (max-width: 768px) {
  .prose img {
    max-width: 100%;
    width: 100%;
    margin: 1rem auto;
    border-radius: 0.5rem;
  }
}

/* Markdown images specific styles */
.markdown-image {
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: block;
  border: 1px solid #e5e7eb;
}

.dark .markdown-image {
  border-color: #374151;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Mobile specific markdown image styles */
@media (max-width: 768px) {
  .markdown-image {
    max-width: 100%;
    width: 100%;
    margin: 1rem auto;
    border-radius: 0.5rem;
  }
}

/* General image responsiveness - fallback for any images in lesson content */
.lesson-content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: block;
  border: 1px solid #e5e7eb;
}

.dark .lesson-content img {
  border-color: #374151;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Mobile responsiveness for lesson content images */
@media (max-width: 768px) {
  .lesson-content img {
    max-width: 100%;
    width: 100%;
    margin: 1rem auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }
}

/* Красивые таблицы если будут использоваться */
.prose table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
}

.prose table th {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
}

.prose table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}

.dark .prose table td {
  color: #d1d5db;
  border-bottom-color: #4b5563;
}

.prose table tr:nth-child(even) td {
  background-color: #f9fafb;
}

.dark .prose table tr:nth-child(even) td {
  background-color: #1f2937;
}

.prose ul, .prose ol {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-left: 2rem;
}

/* Маркированные списки */
.prose ul {
  list-style-type: disc;
  list-style-position: outside;
}

.prose ul li {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: #374151;
  display: list-item !important;
  list-style: inherit !important;
}

.dark .prose ul li {
  color: #d1d5db;
}

.prose ul li::marker {
  color: #6366f1;
}

/* Нумерованные списки */
.prose ol {
  list-style-type: decimal;
  list-style-position: outside;
}

.prose ol li {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: #374151;
  display: list-item !important;
  list-style: inherit !important;
}

.dark .prose ol li {
  color: #d1d5db;
}

.prose ol li::marker {
  color: #6366f1;
  font-weight: 600;
}

/* Вложенные списки - ИСПРАВЛЕНО */
.prose ul ul, 
.prose ol ol, 
.prose ul ol, 
.prose ol ul,
.lesson-content ul ul,
.lesson-content ol ol,
.lesson-content ul ol,
.lesson-content ol ul {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
  padding-left: 2rem !important;
  display: block !important;
}

/* Правильные типы маркеров для вложенных списков */
.prose ul ul,
.lesson-content ul ul {
  list-style-type: circle !important;
}

.prose ul ul ul,
.lesson-content ul ul ul {
  list-style-type: square !important;
}

.prose ol ol,
.lesson-content ol ol {
  list-style-type: lower-alpha !important;
}

.prose ol ol ol,
.lesson-content ol ol ol {
  list-style-type: lower-roman !important;
}

/* Обеспечиваем правильные отступы для элементов списка */
.prose ol ol li,
.lesson-content ol ol li {
  list-style-type: lower-alpha !important;
  display: list-item !important;
}

.prose ol ol ol li,
.lesson-content ol ol ol li {
  list-style-type: lower-roman !important;
  display: list-item !important;
}

/* Специфичные стили для вложенных элементов списков в обычном prose */
.prose ul ul li,
.prose ol ol li,
.prose ul ol li,
.prose ol ul li {
  margin: 0.25rem 0 !important;
  line-height: 1.5 !important;
  display: list-item !important;
  list-style: inherit !important;
}

/* Убираем лишние отступы у первого и последнего элемента в обычном prose */
.prose ul ul li:first-child,
.prose ol ol li:first-child,
.prose ul ol li:first-child,
.prose ol ul li:first-child {
  margin-top: 0;
}

.prose ul ul li:last-child,
.prose ol ol li:last-child,
.prose ul ol li:last-child,
.prose ol ul li:last-child {
  margin-bottom: 0;
}

.prose code {
  background-color: transparent;
  color: #333333;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Fira Code', monospace;
}

.dark .prose code {
  background-color: transparent;
  color: #f8f8f2;
  border: none;
}

/* Стили для inline кода в описаниях заданий */
.prose.prose-lg code {
  background-color: transparent;
  color: #333333;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Fira Code', monospace;
  border: none;
}

.dark .prose.prose-lg code {
  background-color: transparent;
  color: #f8f8f2;
  border: none;
}

.prose pre {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #f1f5f9;
  padding: 1.5rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid #334155;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  position: relative;
}

.prose pre::before {
  content: '💻 Код:';
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 0.75rem;
  color: #64748b;
  font-family: system-ui, sans-serif;
}

.prose pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 400;
  border: none;
  line-height: 1.5;
}

.prose blockquote {
  border-left: 4px solid #3b82f6;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: normal;
  color: #1e40af;
  position: relative;
}

.prose blockquote::before {
  content: '💡';
  position: absolute;
  left: -2px;
  top: 1rem;
  background: #3b82f6;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.dark .prose blockquote {
  border-left-color: #60a5fa;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.15) 0%, rgba(96, 165, 250, 0.05) 100%);
  color: #93c5fd;
}

/* Специальные блоки для разных типов информации */
.prose .callout {
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  border-left: 4px solid;
  position: relative;
}

.prose .callout-info {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  color: #1e40af;
}

.prose .callout-warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
}

.prose .callout-success {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.prose .callout-error {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* КРАСИВЫЕ ТАБЛИЦЫ С СОВРЕМЕННЫМ ДИЗАЙНОМ */
.prose table,
.lesson-content table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 1.5rem 0 !important;
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 0.75rem !important;
  overflow: hidden !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1) !important;
  font-size: 0.875rem !important;
}

.dark .prose table,
.dark .lesson-content table {
  background: #1f2937 !important;
  border-color: #374151 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2) !important;
}

/* Заголовки таблиц */
.prose th,
.lesson-content th {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  padding: 1rem 1.25rem !important;
  text-align: left !important;
  border-bottom: 2px solid #e5e7eb !important;
  font-size: 0.875rem !important;
  letter-spacing: 0.025em !important;
  text-transform: uppercase !important;
  position: relative !important;
}

.dark .prose th,
.dark .lesson-content th {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%) !important;
  color: #f1f5f9 !important;
  border-bottom-color: #4b5563 !important;
}

/* Ячейки таблиц */
.prose td,
.lesson-content td {
  padding: 1rem 1.25rem !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: top !important;
  line-height: 1.5 !important;
  color: #374151 !important;
  transition: background-color 0.2s ease !important;
}

.dark .prose td,
.dark .lesson-content td {
  border-bottom-color: #374151 !important;
  color: #d1d5db !important;
}

/* Чередующиеся строки */
.prose tr:nth-child(even) td,
.lesson-content tr:nth-child(even) td {
  background-color: #f9fafb !important;
}

.dark .prose tr:nth-child(even) td,
.dark .lesson-content tr:nth-child(even) td {
  background-color: #111827 !important;
}

/* Hover эффект для строк */
.prose tbody tr:hover td,
.lesson-content tbody tr:hover td {
  background-color: #f0f9ff !important;
  transform: scale(1.01) !important;
  transition: all 0.2s ease !important;
}

.dark .prose tbody tr:hover td,
.dark .lesson-content tbody tr:hover td {
  background-color: #1e3a8a !important;
}

/* Изображения в таблицах */
.prose table img,
.lesson-content table img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  margin: 0.5rem 0 !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.prose table img:hover,
.lesson-content table img:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

/* Obsidian изображения */
.obsidian-image {
  cursor: pointer !important;
}

.obsidian-image:hover {
  filter: brightness(1.1) !important;
}

/* Заглушки изображений в темной теме */
.dark .prose table img[src*="data:image/svg"],
.dark .lesson-content table img[src*="data:image/svg"] {
  filter: invert(1) !important;
  opacity: 0.8 !important;
}

/* Улучшенные стили для изображений в материалах */
.prose img,
.lesson-content img {
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  background: white !important;
  padding: 0.25rem !important;
}

.dark .prose img,
.dark .lesson-content img {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

/* Адаптивность таблиц */
@media (max-width: 768px) {
  .prose table,
  .lesson-content table {
    font-size: 0.75rem !important;
    margin: 1rem 0 !important;
  }
  
  .prose th,
  .lesson-content th,
  .prose td,
  .lesson-content td {
    padding: 0.75rem 0.5rem !important;
  }
  
  .prose table img,
  .lesson-content table img {
    max-width: 150px !important;
  }
}

/* Таблицы с одной колонкой (как в примере) */
.prose table td:only-child,
.lesson-content table td:only-child {
  text-align: center !important;
  padding: 1.5rem !important;
}

/* Стили для контента в ячейках таблицы */
.prose table p,
.lesson-content table p {
  margin: 0 !important;
  line-height: 1.4 !important;
}

.prose table strong,
.lesson-content table strong {
  color: #1e40af !important;
}

.dark .prose table strong,
.dark .lesson-content table strong {
  color: #60a5fa !important;
}

/* Animation для появления элементов */
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slide-up 0.5s ease-out forwards;
}

/* Стили для line-clamp */
.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Кастомные стили для highlight.js */
.hljs {
  background: #1f2937 !important;
  color: #e5e7eb !important;
  border-radius: 0.5rem;
  padding: 1rem;
}

/* Отзывчивая сетка для заданий */
@media (max-width: 768px) {
  .assignment-container {
    margin-bottom: 2rem;
  }
  
  .prose {
    font-size: 0.875rem;
  }
}

/* Стили для файлового загрузчика */
.file-upload-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.file-upload-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Стили для статуса задания */
.assignment-status {
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Кастомный скроллбар */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Preview modal specific styles */
#previewModal .prose {
  line-height: 1.6;
  font-size: 1rem;
}

#previewModal .prose h1 {
  font-size: 1.875rem;
  font-weight: 800;
  margin-bottom: 1rem;
  margin-top: 0;
}

#previewModal .prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

#previewModal .prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

#previewModal .prose p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

#previewModal .prose ul, 
#previewModal .prose ol {
  margin: 1rem 0;
}

#previewModal .prose li {
  margin: 0.25rem 0;
}

/* Enhanced code highlighting in preview */
#previewModal .prose pre {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #d1d5db;
  font-size: 0.875rem;
}

.dark #previewModal .prose pre {
  border-color: #374151;
}

/* Scroll behavior for preview modal */
#previewModal .flex-1 {
  scroll-behavior: smooth;
}

#previewModal .flex-1::-webkit-scrollbar {
  width: 8px;
}

#previewModal .flex-1::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

#previewModal .flex-1::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

#previewModal .flex-1::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark #previewModal .flex-1::-webkit-scrollbar-track {
  background: #374151;
}

.dark #previewModal .flex-1::-webkit-scrollbar-thumb {
  background: #6b7280;
}

.dark #previewModal .flex-1::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Preview modal animation */
#previewModal.flex {
  animation: fadeIn 0.2s ease-out;
}

#previewModal .bg-white {
  animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Красивые стили для ссылок в материалах уроков */
.prose a,
.lesson-content a {
  color: #3b82f6 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  position: relative !important;
  border-bottom: 2px solid transparent !important;
  transition: all 0.3s ease !important;
  padding: 0.125rem 0.25rem !important;
  border-radius: 0.25rem !important;
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%) !important;
}

.prose a:hover,
.lesson-content a:hover {
  color: #1d4ed8 !important;
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.15) 0%, rgba(147, 51, 234, 0.15) 100%) !important;
  border-bottom-color: #3b82f6 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2) !important;
}

.prose a:active,
.lesson-content a:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2) !important;
}

/* Темная тема для ссылок */
.dark .prose a,
.dark .lesson-content a {
  color: #60a5fa !important;
  background: linear-gradient(120deg, rgba(96, 165, 250, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%) !important;
}

.dark .prose a:hover,
.dark .lesson-content a:hover {
  color: #93c5fd !important;
  background: linear-gradient(120deg, rgba(96, 165, 250, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%) !important;
  border-bottom-color: #60a5fa !important;
  box-shadow: 0 4px 8px rgba(96, 165, 250, 0.3) !important;
}

/* Внешние ссылки с иконкой */
.prose a[href^="http"]:not([href*="localhost"]):not([href*="127.0.0.1"])::after,
.lesson-content a[href^="http"]:not([href*="localhost"]):not([href*="127.0.0.1"])::after {
  content: " ↗" !important;
  font-size: 0.75rem !important;
  opacity: 0.7 !important;
  margin-left: 0.25rem !important;
  transition: opacity 0.2s ease !important;
}

.prose a[href^="http"]:hover::after,
.lesson-content a[href^="http"]:hover::after {
  opacity: 1 !important;
}

/* Ссылки на файлы */
.prose a[href$=".pdf"]::before,
.lesson-content a[href$=".pdf"]::before {
  content: "📄 " !important;
  margin-right: 0.25rem !important;
}

.prose a[href$=".zip"]::before,
.lesson-content a[href$=".zip"]::before,
.prose a[href$=".rar"]::before,
.lesson-content a[href$=".rar"]::before {
  content: "📦 " !important;
  margin-right: 0.25rem !important;
}

.prose a[href$=".doc"]::before,
.lesson-content a[href$=".doc"]::before,
.prose a[href$=".docx"]::before,
.lesson-content a[href$=".docx"]::before {
  content: "📝 " !important;
  margin-right: 0.25rem !important;
}

/* Email ссылки */
.prose a[href^="mailto:"]::before,
.lesson-content a[href^="mailto:"]::before {
  content: "✉️ " !important;
  margin-right: 0.25rem !important;
}

/* GitHub ссылки */
.prose a[href*="github.com"]::before,
.lesson-content a[href*="github.com"]::before {
  content: "🐙 " !important;
  margin-right: 0.25rem !important;
}

/* YouTube ссылки */
.prose a[href*="youtube.com"]::before,
.lesson-content a[href*="youtube.com"]::before,
.prose a[href*="youtu.be"]::before,
.lesson-content a[href*="youtu.be"]::before {
  content: "🎥 " !important;
  margin-right: 0.25rem !important;
}

/* Анимация при загрузке страницы для ссылок */
.prose a,
.lesson-content a {
  animation: linkFadeIn 0.6s ease-out !important;
}

@keyframes linkFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Focus стили для доступности */
.prose a:focus,
.lesson-content a:focus {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px !important;
  border-radius: 0.375rem !important;
}

/* КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ ВЛОЖЕННЫХ СПИСКОВ */
/* Высокоприоритетные стили для гарантированного отображения вложенных списков */

/* Нумерованные списки: 1, 2, 3... */
div.lesson-content ol,
.prose ol {
  list-style-type: decimal !important;
  counter-reset: list-counter !important;
}

/* Первый уровень вложенности: a, b, c... */
div.lesson-content ol ol,
.prose ol ol {
  list-style-type: lower-alpha !important;
  padding-left: 2rem !important;
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

/* Второй уровень вложенности: i, ii, iii... */
div.lesson-content ol ol ol,
.prose ol ol ol {
  list-style-type: lower-roman !important;
  padding-left: 2rem !important;
}

/* Третий уровень вложенности: 1, 2, 3... (мелкие) */
div.lesson-content ol ol ol ol,
.prose ol ol ol ol {
  list-style-type: decimal !important;
  padding-left: 2rem !important;
  font-size: 0.9em !important;
}

/* Элементы списков с явными типами */
div.lesson-content ol > li,
.prose ol > li {
  display: list-item !important;
  list-style-type: decimal !important;
  margin: 0.5rem 0 !important;
}

div.lesson-content ol ol > li,
.prose ol ol > li {
  display: list-item !important;
  list-style-type: lower-alpha !important;
  margin: 0.25rem 0 !important;
}

div.lesson-content ol ol ol > li,
.prose ol ol ol > li {
  display: list-item !important;
  list-style-type: lower-roman !important;
  margin: 0.25rem 0 !important;
}

/* Дополнительная поддержка для маркированных списков */
div.lesson-content ul ul,
.prose ul ul {
  list-style-type: circle !important;
  padding-left: 2rem !important;
}

div.lesson-content ul ul ul,
.prose ul ul ul {
  list-style-type: square !important;
  padding-left: 2rem !important;
}

/* Стили для модального окна с AI альтернативными решениями */
.ai-alternatives-modal {
  /* Базовые стили для контента */
  color: #374151;
  line-height: 1.7;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dark .ai-alternatives-modal {
  color: #d1d5db;
}

/* Заголовки в модальном окне */
.ai-alternatives-modal h1 {
  color: #1f2937 !important;
  font-size: 1.875rem !important;
  line-height: 2.25rem !important;
  font-weight: 700 !important;
  margin-top: 0 !important;
  margin-bottom: 1.5rem !important;
  border-bottom: 2px solid #e5e7eb !important;
  padding-bottom: 0.5rem !important;
}

.dark .ai-alternatives-modal h1 {
  color: #f9fafb !important;
  border-bottom-color: #4b5563 !important;
}

.ai-alternatives-modal h2 {
  color: #1f2937 !important;
  font-size: 1.5rem !important;
  line-height: 2rem !important;
  font-weight: 600 !important;
  margin-top: 2rem !important;
  margin-bottom: 1rem !important;
  border-bottom: 1px solid #e5e7eb !important;
  padding-bottom: 0.25rem !important;
}

.dark .ai-alternatives-modal h2 {
  color: #f9fafb !important;
  border-bottom-color: #4b5563 !important;
}

.ai-alternatives-modal h3 {
  color: #374151 !important;
  font-size: 1.25rem !important;
  line-height: 1.75rem !important;
  font-weight: 600 !important;
  margin-top: 1.5rem !important;
  margin-bottom: 0.75rem !important;
}

.dark .ai-alternatives-modal h3 {
  color: #e5e7eb !important;
}

.ai-alternatives-modal h4 {
  color: #4b5563 !important;
  font-size: 1.125rem !important;
  line-height: 1.75rem !important;
  font-weight: 600 !important;
  margin-top: 1.25rem !important;
  margin-bottom: 0.75rem !important;
}

.dark .ai-alternatives-modal h4 {
  color: #d1d5db !important;
}

.ai-alternatives-modal h5,
.ai-alternatives-modal h6 {
  color: #6b7280 !important;
  font-size: 1rem !important;
  line-height: 1.5rem !important;
  font-weight: 600 !important;
  margin-top: 1rem !important;
  margin-bottom: 0.5rem !important;
}

.dark .ai-alternatives-modal h5,
.dark .ai-alternatives-modal h6 {
  color: #9ca3af !important;
}

/* Параграфы */
.ai-alternatives-modal p {
  color: #374151 !important;
  font-size: 1rem !important;
  line-height: 1.7 !important;
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
}

.dark .ai-alternatives-modal p {
  color: #d1d5db !important;
}

/* Списки */
.ai-alternatives-modal ul,
.ai-alternatives-modal ol {
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
  padding-left: 2rem !important;
}

.ai-alternatives-modal ul {
  list-style-type: disc !important;
  list-style-position: outside !important;
}

.ai-alternatives-modal ol {
  list-style-type: decimal !important;
  list-style-position: outside !important;
}

.ai-alternatives-modal ul li,
.ai-alternatives-modal ol li {
  color: #374151 !important;
  font-size: 1rem !important;
  line-height: 1.6 !important;
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
  display: list-item !important;
  list-style: inherit !important;
}

.dark .ai-alternatives-modal ul li,
.dark .ai-alternatives-modal ol li {
  color: #d1d5db !important;
}

.ai-alternatives-modal ul li::marker {
  color: #6366f1 !important;
}

.ai-alternatives-modal ol li::marker {
  color: #6366f1 !important;
  font-weight: 600 !important;
}

/* Код */
.ai-alternatives-modal code {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  padding: 0.125rem 0.375rem !important;
  border-radius: 0.25rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  border: 1px solid #e2e8f0 !important;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace !important;
}

.dark .ai-alternatives-modal code {
  background-color: #1e293b !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

/* Блоки кода */
.ai-alternatives-modal pre {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.5rem !important;
  padding: 1rem !important;
  margin: 1.5rem 0 !important;
  overflow-x: auto !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace !important;
}

.dark .ai-alternatives-modal pre {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

.ai-alternatives-modal pre code {
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: #475569 !important;
  font-size: inherit !important;
}

.dark .ai-alternatives-modal pre code {
  color: #94a3b8 !important;
}

/* Жирный текст */
.ai-alternatives-modal strong {
  color: #1f2937 !important;
  font-weight: 700 !important;
}

.dark .ai-alternatives-modal strong {
  color: #f9fafb !important;
}

/* Курсив */
.ai-alternatives-modal em {
  color: #4b5563 !important;
  font-style: italic !important;
}

.dark .ai-alternatives-modal em {
  color: #9ca3af !important;
}

/* Цитаты */
.ai-alternatives-modal blockquote {
  border-left: 4px solid #6366f1 !important;
  padding-left: 1rem !important;
  margin: 1.5rem 0 !important;
  color: #6b7280 !important;
  font-style: italic !important;
  background-color: #f8fafc !important;
  padding: 1rem !important;
  border-radius: 0 0.5rem 0.5rem 0 !important;
}

.dark .ai-alternatives-modal blockquote {
  background-color: #1e293b !important;
  color: #9ca3af !important;
}

/* Ссылки */
.ai-alternatives-modal a {
  color: #6366f1 !important;
  text-decoration: underline !important;
  transition: color 0.2s ease !important;
}

.ai-alternatives-modal a:hover {
  color: #4f46e5 !important;
}

.dark .ai-alternatives-modal a {
  color: #818cf8 !important;
}

.dark .ai-alternatives-modal a:hover {
  color: #a5b4fc !important;
}

/* Таблицы */
.ai-alternatives-modal table {
  width: 100% !important;
  margin: 1.5rem 0 !important;
  border-collapse: collapse !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 0.5rem !important;
  overflow: hidden !important;
}

.dark .ai-alternatives-modal table {
  border-color: #374151 !important;
}

.ai-alternatives-modal table th {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  color: white !important;
  padding: 0.75rem 1rem !important;
  text-align: left !important;
  font-weight: 600 !important;
}

.ai-alternatives-modal table td {
  padding: 0.75rem 1rem !important;
  border-bottom: 1px solid #e5e7eb !important;
  color: #374151 !important;
}

.dark .ai-alternatives-modal table td {
  color: #d1d5db !important;
  border-bottom-color: #4b5563 !important;
}

.ai-alternatives-modal table tr:nth-child(even) td {
  background-color: #f9fafb !important;
}

.dark .ai-alternatives-modal table tr:nth-child(even) td {
  background-color: #1f2937 !important;
}

/* Горизонтальные линии */
.ai-alternatives-modal hr {
  border: none !important;
  border-top: 1px solid #e5e7eb !important;
  margin: 2rem 0 !important;
}

.dark .ai-alternatives-modal hr {
  border-top-color: #4b5563 !important;
}

/* Вложенные списки */
.ai-alternatives-modal ul ul,
.ai-alternatives-modal ol ol,
.ai-alternatives-modal ul ol,
.ai-alternatives-modal ol ul {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
  padding-left: 1.5rem !important;
}

.ai-alternatives-modal ul ul {
  list-style-type: circle !important;
}

.ai-alternatives-modal ul ul ul {
  list-style-type: square !important;
}

.ai-alternatives-modal ol ol {
  list-style-type: lower-alpha !important;
}

.ai-alternatives-modal ol ol ol {
  list-style-type: lower-roman !important;
}

/* Подсветка для выделенного кода */
.ai-alternatives-modal .highlight {
  background-color: #fef3c7 !important;
  padding: 0.125rem 0.25rem !important;
  border-radius: 0.25rem !important;
  color: #92400e !important;
}

.dark .ai-alternatives-modal .highlight {
  background-color: #451a03 !important;
  color: #fcd34d !important;
}