/* CurriculumView — Minimalistic curriculum page */

.curriculum-page {
  max-width: 990px;
  margin: 0 auto;
  padding: 1.5rem 2rem 80px 2rem;
  font-size: 110%;
}

.curriculum-header {
  text-align: center;
  margin-bottom: 2rem;
}

.curriculum-logo {
  height: 48px;
  margin-bottom: 0.25rem;
}

.curriculum-page .page-title {
  font-size: 2.2rem;
  font-weight: 300;
  color: #222;
  margin-bottom: 0.75rem;
}

.curriculum-page .page-subtitle {
  font-size: 1rem;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ── Search ──────────────────────────────────────── */

.curriculum-search {
  position: relative;
  max-width: 440px;
  margin: 1rem auto 0;
}

.curriculum-search .fa-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  font-size: 0.85rem;
  pointer-events: none;
}

.curriculum-search input {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 2rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}

.curriculum-search .search-clear {
  left: 8px;
  right: auto;
}

.curriculum-search input:focus {
  border-color: var(--primary-color);
}

.empty-search {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #999;
  font-size: 0.95rem;
}

/* ── Global actions ──────────────────────────────── */

.global-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.75rem;
  padding-right: 72px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  background: #fff;
  color: #666;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.action-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(0, 113, 227, 0.03);
}

.action-btn i {
  font-size: 0.7rem;
}

/* Expand/collapse button in module header row */
.module-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.2rem 0.55rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #888;
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  align-self: center;
}

.module-expand-btn i {
  font-size: 0.65rem;
}

.module-expand-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(0, 113, 227, 0.03);
}

/* ── Timeline layout ──────────────────────────────── */

.timeline-label {
  position: relative;
  right: -23px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #999;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.curriculum-timeline {
  position: relative;
}

.curriculum-timeline::before {
  content: '';
  position: absolute;
  right: 35px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, #d0d0d0 0%, rgba(200, 200, 200, 0.15) 100%);
}

/* ── Module block ─────────────────────────────────── */

.module-block {
  position: relative;
  margin-bottom: 0.6rem;
  padding-right: 72px;
}

/* ── Module header ────────────────────────────────── */

.module-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  transition: all 0.2s ease;
  position: relative;
}

.module-header:hover {
  border-color: #ccc;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.module-block.expanded .module-header {
  border-color: #d0d5dd;
  border-radius: 8px 8px 0 0;
}

/* Number badge on timeline */
.module-number-badge {
  position: absolute;
  right: -52px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: #0071E3;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  z-index: 1;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 113, 227, 0.15);
}

.module-block.draft .module-number-badge {
  background: #bbb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.module-info {
  flex: 1;
  min-width: 0;
}

.module-block .module-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #222;
  margin: 0 0 0.15rem 0;
  line-height: 1.4;
}

.module-subtitle {
  font-size: 0.82rem;
  color: #888;
  margin: 0 0 0.2rem 0;
  font-weight: 400;
}

.module-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #aaa;
}

.meta-sep {
  color: #ddd;
}

.draft-badge {
  background: #f5f5f5;
  color: #aaa;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-right: 0.2rem;
}

/* Expand icon */
.expand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #ccc;
  transition: transform 0.25s ease, color 0.25s ease;
  flex-shrink: 0;
  align-self: center;
  font-size: 0.8rem;
}

.expand-icon.open {
  transform: rotate(180deg);
  color: #0071E3;
}

.expand-icon.small {
  width: 20px;
  height: 20px;
  font-size: 0.65rem;
}

/* ── Module body (expanded) ───────────────────────── */

.module-body {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 0.85rem 1.1rem;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.module-desc-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #f0f0f0;
}

.module-desc {
  flex: 1;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.55;
  margin: 0;
}

/* ── Chapters ─────────────────────────────────────── */

.chapters-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.chapter-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  transition: background 0.15s ease;
}

.chapter-header:hover {
  background: #f7f8fa;
}

.chapter-order {
  width: 22px;
  height: 22px;
  background: #f0f0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #777;
  flex-shrink: 0;
}

.chapter-block.expanded .chapter-order {
  background: rgba(0, 113, 227, 0.08);
  color: #0071E3;
}

.chapter-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  color: #333;
  margin: 0;
}

.chapter-count {
  font-size: 0.7rem;
  color: #bbb;
  flex-shrink: 0;
  background: #f5f5f5;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Subjects ─────────────────────────────────────── */

.subjects-list {
  padding: 0.25rem 0 0.35rem 0;
  margin-right: 2.5rem;
  border-right: 1px solid #eee;
  animation: slideDown 0.15s ease;
}

.subject-item {
  padding: 0.35rem 0.85rem;
  position: relative;
}

.subject-item::before {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 1px;
  background: #ddd;
}

.subject-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: #444;
  margin: 0 0 0.1rem 0;
}

.subject-desc {
  font-size: 0.76rem;
  color: #999;
  line-height: 1.4;
  margin: 0;
}

/* ── Draft modules ────────────────────────────────── */

.module-block.draft .module-header {
  border-color: #eee;
  background: #fafafa;
}

.module-block.draft .module-title {
  color: #aaa;
}

.module-block.draft .module-header:hover {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
  border-color: #ddd;
}

/* ── Loading/Error ────────────────────────────────── */

.loading-state,
.error-state {
  text-align: center;
  padding: 2.5rem;
  color: #999;
  font-size: 1rem;
}

.error-state {
  color: #dc3545;
}

/* ── Disclaimer ───────────────────────────────────── */

.curriculum-disclaimer {
  text-align: center;
  font-size: 1.01rem;
  font-style: italic;
  color: #c0392b;
  line-height: 1.65;
  margin: 0 auto 1.8rem;
  max-width: 680px;
  padding: 0.9rem 1.4rem;
  background: rgba(192, 57, 43, 0.03);
  border: 1px solid rgba(192, 57, 43, 0.15);
  border-radius: 8px;
}

/* ── Tablet (768px – 1024px) ─────────────────────── */

@media (max-width: 1024px) {
  .curriculum-page {
    max-width: 100%;
    padding: 1.25rem 1.5rem 80px 1.5rem;
  }

  .curriculum-page .page-title {
    font-size: 1.9rem;
  }

  .module-block .module-title {
    font-size: 1rem;
  }

  .module-subtitle {
    font-size: 0.78rem;
  }
}

/* ── Phone (< 768px) ────────────────────────────── */

@media (max-width: 767px) {
  .curriculum-page {
    padding: 0.75rem 0.75rem 40px 0.75rem;
    font-size: 100%;
  }

  .curriculum-header {
    margin-bottom: 1.25rem;
  }

  .curriculum-logo {
    height: 36px;
  }

  .curriculum-page .page-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .curriculum-page .page-subtitle {
    font-size: 0.85rem;
    flex-direction: column;
    gap: 0.25rem;
  }

  .curriculum-search {
    margin: 0.75rem auto 0;
  }

  .curriculum-search input {
    font-size: 0.85rem;
    padding: 0.5rem 2rem 0.5rem 1.75rem;
  }

  .curriculum-disclaimer {
    font-size: 0.72rem;
    margin: 0 auto 1rem;
  }

  /* Hide timeline line on phone */
  .curriculum-timeline::before {
    display: none;
  }

  .timeline-label {
    right: 0;
    font-size: 0.65rem;
    margin-bottom: 0.3rem;
  }

  .module-block {
    padding-right: 0;
    margin-bottom: 0.5rem;
  }

  .module-number-badge {
    position: static;
    transform: none;
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
    flex-shrink: 0;
  }

  .module-header {
    padding: 0.65rem 0.75rem;
    gap: 0.5rem;
  }

  .module-block .module-title {
    font-size: 0.92rem;
  }

  .module-subtitle {
    font-size: 0.75rem;
  }

  .module-meta {
    font-size: 0.7rem;
  }

  .expand-icon {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }

  .module-body {
    padding: 0.65rem 0.75rem;
  }

  .module-desc {
    font-size: 0.82rem;
  }

  .global-actions {
    padding-right: 0;
    gap: 0.5rem;
  }

  .action-btn {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
  }

  .module-expand-btn {
    font-size: 0.68rem;
    padding: 0.15rem 0.4rem;
  }

  /* Chapters */
  .chapter-header {
    padding: 0.4rem 0.5rem;
    gap: 0.5rem;
  }

  .chapter-order {
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
  }

  .chapter-title {
    font-size: 0.82rem;
  }

  .chapter-count {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }

  /* Subjects */
  .subjects-list {
    margin-right: 1.25rem;
  }

  .subject-item {
    padding: 0.3rem 0.65rem;
  }

  .subject-title {
    font-size: 0.78rem;
  }

  .subject-desc {
    font-size: 0.72rem;
  }
}
