/* ==========================================================================
   AROQA — Academic Subjects Feature Stylesheet (Phase 6 + Phase 12B Upgrade)
   Owner: features/subjects
   Identity: STRUCTURED ACADEMIC CURRICULUM
   Scope: Dashboard Academic Subjects (state.view === 'dashboard', state.section === 'subjects')
   ========================================================================== */

.subjects-curriculum-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.subjects-curriculum-page > * {
  min-width: 0;
}

.subjects-curriculum-page .filter-pills {
  flex-wrap: wrap;
  max-width: 100%;
}

.filter-pills button .filter-count {
  opacity: 0.72;
  font-size: 0.78em;
  margin-inline-start: 4px;
}

.featured-course {
  min-height: 270px;
  display: grid;
  grid-template-columns: 1fr 260px;
  align-items: center;
  gap: 24px;
  padding: 32px clamp(24px, 3.8vw, 46px);
  border: 1px solid rgba(93, 221, 239, 0.2);
  background: radial-gradient(circle at 82% 50%, #1b8ba430, transparent 32%),
    linear-gradient(150deg, #0b1925, #071119);
}

.featured-course > div:first-child {
  max-width: 690px;
}

.featured-course-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 6px;
}

.course-code-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(93, 212, 231, 0.12);
  border: 1px solid rgba(93, 212, 231, 0.28);
  color: #7ce6f7;
  font: 700 11px/1.2 "Space Grotesk", monospace;
  letter-spacing: 0.08em;
}

.subjects-context-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #b7ccd7;
  font-size: 12px;
  font-weight: 700;
}

.subjects-context-badge.is-unavailable {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.34);
  color: #fcd34d;
}

.featured-course h2 {
  margin: 8px 0;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.15;
}

.featured-course p {
  margin: 0 0 18px;
  color: #899eaa;
}

.featured-course .premium-progress {
  max-width: 530px;
}

.featured-course small {
  display: block;
  margin-top: 7px;
  color: #849ca9;
}

.featured-course .primary-btn {
  min-height: 44px;
  margin-top: 18px;
  border-radius: 12px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.course-radar {
  position: relative;
  width: 196px;
  height: 196px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 1px solid #8beaff2b;
  border-radius: 50%;
  box-shadow: 0 0 0 18px #8beaff05, 0 0 54px #3bc7df18;
}

.course-radar:before,
.course-radar:after {
  content: "";
  position: absolute;
  background: #8beaff18;
}

.course-radar:before {
  width: 1px;
  height: 100%;
}

.course-radar:after {
  width: 100%;
  height: 1px;
}

.course-radar span {
  font: 700 34px "Space Grotesk";
}

.course-radar i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ui-cyan);
  box-shadow: 0 0 14px var(--ui-cyan);
}

.course-radar i:nth-of-type(1) {
  top: 30px;
  left: 66px;
}

.course-radar i:nth-of-type(2) {
  bottom: 45px;
  right: 28px;
}

.course-radar i:nth-of-type(3) {
  bottom: 50px;
  left: 40px;
  background: var(--ui-violet);
}

/* Course Syllabus & Specification Panel */
.subject-detail-panel {
  padding: 24px 28px;
  border-radius: 20px;
  border: 1px solid rgba(93, 212, 231, 0.26);
  background: linear-gradient(155deg, rgba(11, 26, 39, 0.96), rgba(6, 15, 24, 0.98));
  display: grid;
  gap: 18px;
}

.subject-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.subject-detail-header h3 {
  margin: 6px 0 4px;
  font-size: 22px;
}

.subject-detail-header p {
  margin: 0;
  color: #8fa6b3;
  font-size: 13.5px;
}

.subject-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.subject-spec-cell {
  padding: 13px 15px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(148, 163, 184, 0.13);
  display: grid;
  gap: 5px;
}

.subject-spec-cell span {
  color: #8299a6;
  font-size: 11.5px;
  font-weight: 700;
}

.subject-spec-cell strong {
  color: #eef9fc;
  font-size: 14px;
  font-weight: 800;
}

.subject-chapter-list {
  display: grid;
  gap: 10px;
}

.subject-chapter-item {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.subject-chapter-item.is-verified {
  border-color: rgba(93, 212, 231, 0.28);
  background: rgba(93, 212, 231, 0.05);
}

.chapter-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(93, 212, 231, 0.1);
  border: 1px solid rgba(93, 212, 231, 0.22);
  color: #7ee7f8;
  font: 700 11px "Space Grotesk", monospace;
}

.chapter-copy {
  display: grid;
  gap: 3px;
}

.chapter-copy strong {
  font-size: 14px;
  color: #effafd;
}

.chapter-copy small {
  color: #839aa7;
  font-size: 12.5px;
  line-height: 1.5;
}

.chapter-state-pill {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.chapter-state-pill.is-muted {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.22);
  color: #94a3b8;
}

.subject-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Curriculum Empty & Preview States */
.subjects-context-banner,
.subjects-preview-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
  border-radius: 18px;
}

.subjects-preview-notice {
  border-color: rgba(245, 158, 11, 0.32);
  background: linear-gradient(145deg, rgba(35, 26, 12, 0.78), rgba(11, 20, 31, 0.95));
}

.subjects-curriculum-empty,
.subjects-filter-empty {
  padding: 28px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(155deg, rgba(12, 24, 36, 0.94), rgba(7, 15, 24, 0.97));
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
}

.subjects-curriculum-empty h3,
.subjects-filter-empty h4 {
  margin: 4px 0;
  font-size: 20px;
}

.subjects-curriculum-empty p,
.subjects-filter-empty p {
  margin: 0;
  max-width: 780px;
  color: #8da4b1;
  line-height: 1.65;
}

.subjects-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.content-section {
  margin-top: 8px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 15px;
}

.course-card {
  position: relative;
  min-height: 236px;
  padding: 22px;
  border: 1px solid var(--ui-line);
  border-radius: 19px;
  background: linear-gradient(150deg, #0e1c28, #071019);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.course-card.is-selected {
  border-color: rgba(93, 212, 231, 0.52);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(93, 212, 231, 0.22);
}

.course-card.is-pinned {
  border-color: rgba(56, 225, 255, 0.38);
}

.course-card:after {
  content: "";
  position: absolute;
  inset: auto -45px -55px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #5dddef12;
  pointer-events: none;
}

.course-card.tone-violet:after {
  background: #7e77ff16;
}

.course-card.tone-blue:after {
  background: #4a8fff15;
}

.course-card.tone-teal:after {
  background: #55dab817;
}

.course-card:hover {
  transform: translateY(-3px);
  border-color: #89eafa3b;
  box-shadow: 0 20px 48px #0005;
}

.course-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.course-code-group {
  display: grid;
  gap: 5px;
}

.course-card-top > span {
  color: #5dd4e7;
  font: 700 9px "Space Grotesk";
  letter-spacing: 0.12em;
}

.course-category-tag {
  color: #7d96a4;
  font-size: 11.5px;
  font-weight: 600;
}

.course-ring {
  --value: 50;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--ui-cyan) calc(var(--value) * 1%), #ffffff0c 0);
  position: relative;
  flex: 0 0 auto;
}

.course-ring:before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #0a151f;
}

.course-ring b {
  position: relative;
  font: 700 10px "Space Grotesk";
}

.course-card h3 {
  margin: 18px 0 6px;
  font-size: 17px;
}

.course-card p {
  margin: 0;
  color: #869eab;
  font-size: 13px;
}

.course-availability-note {
  display: block;
  margin-top: 8px;
  color: #6b8492;
  font-size: 11.5px;
  line-height: 1.45;
}

.course-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.course-actions button {
  height: 36px;
  padding: 0 13px;
  border: 1px solid #99ecfa22;
  border-radius: 10px;
  background: #ffffff06;
  color: #b7d7e0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.course-actions button:first-child {
  flex: 1;
}

.course-actions button:last-child {
  width: 38px;
  padding: 0;
  display: grid;
  place-items: center;
}

.course-actions button[aria-pressed="true"] {
  background: rgba(93, 212, 231, 0.16);
  border-color: rgba(93, 212, 231, 0.45);
  color: #e6fbff;
}

.course-actions .ui-icon {
  width: 14px;
}

.review-queue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 8px;
  padding: 25px;
}

.review-queue h3 {
  margin: 5px 0;
  font-size: 18px;
}

.review-queue p {
  max-width: 760px;
  margin: 0;
  color: #758c98;
}

.review-queue button[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 1280px) {
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .subject-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .subjects-curriculum-page .section-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .featured-course {
    min-height: 320px;
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 16px;
  }

  .featured-course > div:first-child {
    min-width: 0;
  }

  .subject-detail-panel {
    padding: 18px 16px;
  }

  .course-radar {
    display: none;
  }

  .course-grid,
  .subject-detail-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .subject-chapter-item {
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
  }

  .subject-detail-header,
  .subjects-context-banner,
  .subjects-preview-notice,
  .review-queue {
    align-items: stretch;
    flex-direction: column;
  }
}

.aroqa-reduced-motion .subjects-curriculum-page *,
@media (prefers-reduced-motion: reduce) {
  .course-card {
    transition: none !important;
  }
}
