/* ========================================
   Wissensgraph - Kritische Geschichtswissenschaft
   ======================================== */

:root {
  /* Colors */
  --bg-primary: #0f1419;
  --bg-secondary: #1a1f26;
  --bg-tertiary: #242b33;
  --bg-hover: #2d353f;

  --text-primary: #e7e9ea;
  --text-secondary: #8b98a5;
  --text-muted: #6e7681;

  --accent-primary: #4A90D9;
  --accent-hover: #5da0e9;

  --border-color: #2f3840;
  --border-light: #3d454d;

  /* Node colors */
  --node-work: #4A90D9;
  --node-author: #166534;
  --node-author-accent: #22c55e;
  --node-section: #E67E22;
  --node-central: #991B1B;

  /* Difficulty colors */
  --diff-intro: #2ECC71;
  --diff-medium: #F39C12;
  --diff-advanced: #E74C3C;

  /* Sizing */
  --sidebar-width: 280px;
  --sidebar-right-width: 340px;
  --header-height: 60px;
  --footer-height: 36px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ========================================
   Header
   ======================================== */
.header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  color: var(--accent-primary);
}

.header-title h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-title .subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.stats {
  display: flex;
  gap: 16px;
}

.stat {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat strong {
  color: var(--text-primary);
}

.graph-controls {
  display: flex;
  gap: 4px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

/* ========================================
   Main Layout
   ======================================== */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ========================================
   Sidebars
   ======================================== */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-left {
  width: var(--sidebar-width);
}

.sidebar-right {
  width: var(--sidebar-right-width);
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.sidebar-section {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.section-title svg {
  opacity: 0.7;
}

.section-title .count {
  margin-left: auto;
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}

/* Filter Groups */
.filter-group {
  margin-bottom: 16px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Radio & Checkbox Options */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  padding: 4px 0;
}

.radio-option input,
.checkbox-option input {
  display: none;
}

.radio-custom,
.checkbox-custom {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-radius: 50%;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.checkbox-custom {
  border-radius: 4px;
}

.radio-option input:checked + .radio-custom,
.checkbox-option input:checked + .checkbox-custom {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
}

.radio-custom::after,
.checkbox-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform var(--transition-fast);
}

.radio-custom::after {
  width: 6px;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 50%;
}

.checkbox-custom::after {
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3L4.5 8.5L2 6' stroke='%230f1419' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
}

.radio-option input:checked + .radio-custom::after,
.checkbox-option input:checked + .checkbox-custom::after {
  transform: translate(-50%, -50%) scale(1);
}

/* Section Checkboxes with Colors */
.section-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.section-label {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Difficulty Badges */
.difficulty-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.difficulty-badge.intro,
.difficulty-badge[data-level="Einführung"] {
  background: rgba(46, 204, 113, 0.2);
  color: var(--diff-intro);
}

.difficulty-badge.medium,
.difficulty-badge[data-level="Mittel"] {
  background: rgba(243, 156, 18, 0.2);
  color: var(--diff-medium);
}

.difficulty-badge.advanced,
.difficulty-badge[data-level="Fortgeschritten"] {
  background: rgba(231, 76, 60, 0.2);
  color: var(--diff-advanced);
}

/* Legend */
.legend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-shape {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.legend-shape.work {
  background: var(--node-work);
  border-radius: 50%;
}

.legend-shape.author {
  background: var(--node-author);
  border: 2px solid var(--node-author-accent);
  border-radius: 7px;
}

.legend-shape.section {
  background: var(--node-section);
  border-radius: 3px;
}

.legend-shape.central {
  background: var(--node-central);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(153, 27, 27, 0.5);
}

/* Works List */
.works-list-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.works-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  margin: 0 -16px;
  padding: 0 16px;
}

.works-list::-webkit-scrollbar {
  width: 6px;
}

.works-list::-webkit-scrollbar-track {
  background: transparent;
}

.works-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.works-list::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

.work-item {
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-left: 3px solid transparent;
}

.work-item:hover {
  background: var(--bg-hover);
}

.work-item.hidden {
  display: none;
}

.work-item.active {
  background: var(--bg-tertiary);
  border-left-color: var(--accent-primary);
}

.work-item-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.work-item-title {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================
   Graph Container
   ======================================== */
.graph-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

#graph {
  width: 100%;
  height: 100%;
}

/* Graph Tooltip */
.graph-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity var(--transition-fast);
  max-width: 280px;
  z-index: 100;
}

.graph-tooltip.visible {
  opacity: 1;
}

.tooltip-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.tooltip-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tooltip-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========================================
   Detail Panel (Right Sidebar)
   ======================================== */
.detail-panel {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 200px;
  color: var(--text-muted);
  padding: 40px;
}

.detail-placeholder.hidden {
  display: none;
}

.detail-placeholder svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.detail-placeholder p {
  font-size: 13px;
  line-height: 1.6;
}

.detail-content {
  animation: fadeIn 0.2s ease;
  flex-shrink: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-content.hidden {
  display: none !important;
}

.detail-header {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.detail-type-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-type-badge.work {
  background: rgba(74, 144, 217, 0.2);
  color: var(--node-work);
}

.detail-type-badge.author {
  background: rgba(22, 101, 52, 0.3);
  color: var(--node-author-accent);
}

.detail-type-badge.section {
  background: rgba(230, 126, 34, 0.2);
  color: var(--node-section);
}

.detail-section-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.detail-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.detail-authors {
  font-size: 14px;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.detail-publication {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.detail-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.language-badge {
  font-size: 12px;
  color: var(--text-primary);
}

.detail-summary {
  margin-bottom: 20px;
}

/* Catalog Links Section */
.catalog-links {
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--accent-blue);
}

.catalog-links h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.catalog-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.catalog-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-blue);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.catalog-link:hover {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

.catalog-link::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.catalog-link:hover::before {
  filter: brightness(0) invert(1);
}

.detail-summary h4,
.related-works h4,
.author-works h4,
.section-works h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.detail-summary p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}

.related-works ul,
.author-works ul,
.section-works ul {
  list-style: none;
}

.related-works li,
.author-works li,
.section-works li {
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: 13px;
}

.related-works li:hover,
.author-works li:hover,
.section-works li:hover {
  background: var(--bg-hover);
}

.related-work-author,
.section-work-author {
  font-weight: 500;
  color: var(--text-primary);
}

.related-work-title,
.section-work-title {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 2px;
}

.section-code {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  height: var(--footer-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ========================================
   Graph Nodes & Links (D3 Styles)
   ======================================== */
.node {
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.node:hover {
  opacity: 0.8;
}

.node-work circle {
  stroke: var(--bg-primary);
  stroke-width: 2px;
}

.node-author rect {
  stroke: var(--bg-primary);
  stroke-width: 2px;
}

.node-section rect {
  stroke: var(--bg-primary);
  stroke-width: 2px;
  rx: 4px;
}

.node-central circle {
  stroke: #ffffff;
  stroke-width: 3px;
  filter: drop-shadow(0 0 10px rgba(231, 76, 60, 0.5));
}

.node-label {
  font-size: 10px;
  fill: var(--text-secondary);
  pointer-events: none;
  text-anchor: middle;
}

.node-section .node-label {
  font-weight: 600;
  fill: var(--text-primary);
}

.link {
  stroke: var(--border-color);
  stroke-opacity: 0.4;
  fill: none;
}

.link.highlighted {
  stroke: var(--accent-primary);
  stroke-opacity: 0.8;
  stroke-width: 2px;
}

.node.dimmed {
  opacity: 0.15;
}

.node.highlighted circle,
.node.highlighted rect {
  stroke: var(--accent-primary);
  stroke-width: 3px;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 1200px) {
  :root {
    --sidebar-width: 240px;
    --sidebar-right-width: 300px;
  }
}

@media (max-width: 900px) {
  .sidebar-left {
    display: none;
  }

  .sidebar-right {
    position: fixed;
    right: 0;
    top: var(--header-height);
    bottom: var(--footer-height);
    z-index: 50;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
  }

  .sidebar-right.open {
    transform: translateX(0);
  }
}

/* Filter Section Scrollable */
.filter-section {
  max-height: 45vh;
  overflow-y: auto;
}

.filter-section::-webkit-scrollbar {
  width: 4px;
}

.filter-section::-webkit-scrollbar-track {
  background: transparent;
}

.filter-section::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

/* ========================================
   Author Biography Styles
   ======================================== */
.author-dates {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-style: italic;
}

.author-biography,
.author-key-works,
.author-sources {
  margin-bottom: 20px;
}

.author-biography h4,
.author-key-works h4,
.author-sources h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.author-biography p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  text-align: justify;
}

.author-key-works ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.author-key-works li {
  font-size: 13px;
  color: var(--text-primary);
  padding: 8px 12px;
  margin: 0 -12px;
  border-radius: 6px;
  border-left: 3px solid var(--node-author-accent);
  background: var(--bg-tertiary);
  margin-bottom: 6px;
  line-height: 1.5;
}

.author-key-works li:last-child {
  margin-bottom: 0;
}

.author-sources p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
}

/* ========================================
   New Features: v2.0
   ======================================== */

/* Header Actions */
.header-actions {
  display: flex;
  gap: 4px;
  margin-right: 12px;
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.visible {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(80vh - 70px);
}

/* Welcome Modal */
.welcome-modal {
  max-width: 520px;
}

.welcome-header {
  text-align: center;
  padding: 32px 24px 24px;
}

.welcome-icon {
  color: var(--accent-primary);
  margin-bottom: 16px;
}

.welcome-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}

.welcome-body {
  padding: 0 24px 24px;
}

.welcome-body p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.feature-icon {
  font-size: 20px;
}

.feature-item span:last-child {
  font-size: 13px;
  color: var(--text-primary);
}

.welcome-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Tour */
.tour-highlight {
  border: 2px solid var(--accent-primary);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
  animation: tour-pulse 2s ease-in-out infinite;
}

@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6); }
  50% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65); }
}

.tour-tooltip {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  width: 300px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.tour-step-indicator {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tour-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.tour-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.tour-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tour-nav-right {
  display: flex;
  gap: 8px;
}

.tour-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.tour-skip {
  background: transparent;
  color: var(--text-muted);
}

.tour-skip:hover {
  color: var(--text-secondary);
}

.tour-prev {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.tour-prev:hover {
  background: var(--bg-hover);
}

.tour-next {
  background: var(--accent-primary);
  color: white;
}

.tour-next:hover {
  background: var(--accent-hover);
}

/* Learning Paths Panel */
.learning-paths-panel {
  position: fixed;
  top: var(--header-height);
  right: -420px;
  width: 400px;
  height: calc(100vh - var(--header-height) - var(--footer-height));
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.learning-paths-panel.visible {
  right: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.panel-close:hover {
  color: var(--text-primary);
}

.panel-description {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.learning-paths-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.learning-path-card {
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  border-left: 4px solid;
}

.path-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  margin-bottom: 8px;
}

.path-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.path-description {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.path-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.path-steps-count,
.path-hours {
  font-size: 12px;
  color: var(--text-muted);
}

.path-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.path-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.path-details.expanded {
  max-height: 500px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.path-steps-list {
  list-style: none;
}

.path-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.path-step:last-child {
  border-bottom: none;
}

.path-step.completed .step-content {
  opacity: 0.6;
}

.path-step.completed .step-work-title {
  text-decoration: line-through;
}

.step-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.step-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.step-number {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.step-content {
  flex: 1;
  cursor: pointer;
}

.step-work-title {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.step-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

/* About Modal */
.about-modal {
  max-width: 560px;
}

.about-section {
  margin-bottom: 24px;
}

.about-section:last-child {
  margin-bottom: 0;
}

.about-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.version-info {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 12px 16px;
}

.version-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.version-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.version-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.data-health-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-bottom: 12px;
}

.data-health-status.healthy {
  border-left: 3px solid var(--diff-intro);
}

.data-health-status.has-warnings {
  border-left: 3px solid var(--diff-medium);
}

.health-text {
  font-size: 14px;
  color: var(--text-primary);
}

.data-health-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-item {
  background: var(--bg-tertiary);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-value.warning {
  color: var(--diff-medium);
}

.changelog-container {
  max-height: 250px;
  overflow-y: auto;
}

.changelog-entry {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.changelog-entry:last-child {
  margin-bottom: 0;
}

.changelog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.changelog-version {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
}

.changelog-date {
  font-size: 12px;
  color: var(--text-muted);
}

.changelog-changes {
  padding-left: 20px;
  margin: 0;
}

.changelog-changes li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}

/* Difficulty Info */
.difficulty-with-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.info-icon-btn:hover {
  color: var(--accent-primary);
  background: var(--bg-hover);
}

.difficulty-popup {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  width: 300px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: popup-fade-in 0.2s ease;
}

@keyframes popup-fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  border-left: 4px solid;
}

.popup-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.popup-close:hover {
  color: var(--text-primary);
}

.popup-description {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.difficulty-popup h5 {
  padding: 0 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.popup-criteria {
  padding: 0 16px 16px;
  margin: 0;
  padding-left: 32px;
}

.popup-criteria li {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 6px;
}

/* Section Intro & Assignments */
.section-intro {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

.section-intro.placeholder {
  border-left: 3px solid var(--diff-medium);
}

.section-intro h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wip-badge {
  font-size: 10px;
  background: var(--diff-medium);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.section-intro p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.no-content {
  font-style: italic;
  color: var(--text-muted);
}

.intro-sources {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.intro-sources h5 {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.intro-sources ul {
  padding-left: 16px;
  margin: 0;
}

.intro-sources li {
  font-size: 12px;
  color: var(--text-secondary);
}

.intro-sources a {
  color: var(--accent-primary);
}

.section-assignments {
  margin: 16px 0;
}

.section-assignments h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  color: var(--accent-primary);
  background: var(--bg-hover);
}

.copy-btn.copied {
  color: var(--diff-intro);
}

.assignment-group {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.assignment-group h5 {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.assignment-list {
  padding-left: 20px;
  margin: 0;
}

.assignment-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.assignment-list.mini li {
  border-left: 2px solid var(--diff-intro);
  padding-left: 10px;
  margin-left: -20px;
  list-style: none;
}

.assignment-list.term-paper li {
  border-left: 2px solid var(--accent-primary);
  padding-left: 10px;
  margin-left: -20px;
  list-style: none;
}
