/* ============================================================
   Course Student — Curriculum browser (shared: curriculum.html + index.html)
   Theme-agnostic; light-theme overrides live in curriculum-light.css.
   ============================================================ */

/* ===== Page header ===== */
.crm-page { padding: 48px 0 90px; position: relative; z-index: 1; }
.crm-head { text-align: center; margin-bottom: 24px; }
.crm-head h1 {
  font-size: clamp(34px, 4.4vw, 50px); font-weight: 800;
  letter-spacing: -.5px; margin-bottom: 8px; color: var(--text);
}
.crm-head h1 .accent {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.crm-head p { color: var(--muted); font-size: clamp(14px, 1.1vw, 16px); line-height: 1.6; margin: 0; }

/* Homepage #manahij — tighter header rhythm above stage chips */
.manahij .section-head { margin-bottom: 10px; }
.manahij .section-head .eyebrow { margin-bottom: 8px; }
.manahij .section-head h2 { margin-bottom: 0; }
.manahij .section-head p { margin-bottom: 0; line-height: 1.65; }

/* ===== Stage selector ===== */
.crm-stages {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px; margin-bottom: 18px;
}
.crm-stage {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 14px 20px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text); font-weight: 700; font-size: 15px;
  text-align: center; min-width: 132px;
  transition: transform .25s, box-shadow .25s, border-color .25s, background .25s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.crm-stage-text {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; text-align: center; line-height: 1.25;
}
.crm-stage-ar { font-size: inherit; font-weight: inherit; }
.crm-stage i {
  color: var(--gold-light); font-size: 20px; transition: color .25s;
  flex-shrink: 0; line-height: 1;
}
.crm-stage:hover, .crm-stage:focus-visible {
  border-color: var(--gold); transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(212, 160, 23, .14); outline: none;
}
.crm-stage.active {
  background: linear-gradient(135deg, var(--crimson), var(--crimson-action));
  border-color: transparent; color: #fff;
  box-shadow: 0 12px 28px rgba(176, 32, 53, .32);
}
.crm-stage.active i { color: var(--gold-light); }
.crm-stage.active .tr-sub { color: rgba(255, 255, 255, .78); opacity: 1; }

/* ===== Bilingual Turkish sub-lines ===== */
.tr-sub {
  display: block; font-size: 11px; color: var(--muted);
  opacity: .8; line-height: 1.35; unicode-bidi: isolate;
}

/* ===== Grade tabs ===== */
.crm-grades {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px; margin-bottom: 28px;
}
.crm-grade {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 11px 18px; border-radius: 999px;
  background: transparent; border: 1.5px solid var(--line-strong);
  color: var(--gold-light); font-weight: 600; font-size: 13.5px;
  transition: all .22s; text-align: center; min-width: 0;
}
.crm-grade-ar { line-height: 1.25; }
.crm-grade:hover { border-color: var(--gold); background: rgba(212, 160, 23, .06); }
.crm-grade.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-color: transparent; color: #1a0608;
  box-shadow: 0 8px 22px rgba(212, 160, 23, .3);
}
.crm-grade.active .tr-sub { color: rgba(26, 6, 8, .72); opacity: 1; }

/* ===== Subject grid ===== */
/* Centered wrapping flex so any count (3, 4, 7…) forms centered rows. */
.crm-grid {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch;
  gap: 18px;
}
/* Soft swap when switching grade/stage (toggled by curriculum.js). */
.crm-fade { transition: opacity .17s ease, transform .17s ease; }
.crm-fade.is-out { opacity: 0; transform: translateY(6px); }
@media (prefers-reduced-motion: reduce) {
  .crm-fade { transition: none; }
}
.crm-card {
  flex: 0 0 260px; max-width: 260px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 0; padding: 26px 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--card), var(--surface-1));
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  transition: transform .25s, box-shadow .25s, border-color .25s;
  cursor: pointer; position: relative; overflow: hidden;
}
.crm-card:hover, .crm-card:focus-visible {
  transform: translateY(-5px); border-color: var(--gold);
  box-shadow: 0 22px 48px rgba(123, 13, 30, .3); outline: none;
}
.crm-card-ic {
  width: 50px; height: 50px; border-radius: 14px;
  display: grid; place-items: center; flex-shrink: 0;
  background: rgba(212, 160, 23, .1); border: 1px solid var(--line-strong);
  color: var(--gold-light);
  margin: 6px 0 14px;
}
.crm-card-ic i { font-size: 22px; }
.crm-card h3 {
  width: 100%; font-size: 17px; font-weight: 800; line-height: 1.45;
  color: var(--text); margin: 0 0 6px;
}
.crm-card .tr-sub {
  width: 100%; font-size: 12.5px; margin-bottom: 4px;
}
.crm-card-meta {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: auto; padding-top: 14px;
  font-size: 11.5px; color: var(--muted); opacity: .72;
}
.crm-card-meta i { color: var(--gold-light); font-size: 10px; opacity: .85; }
.crm-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  max-width: calc(100% - 20px);
}
.crm-badge.is-free { background: rgba(91, 232, 145, .12); color: #5be891; border: 1px solid rgba(91, 232, 145, .3); }
.crm-badge.is-locked { background: rgba(255, 255, 255, .06); color: var(--muted); border: 1px solid var(--line); }

/* ===== Empty / soon state ===== */
.crm-soon {
  text-align: center; padding: 70px 24px;
  border: 1.5px dashed var(--line-strong); border-radius: 22px;
  background: rgba(212, 160, 23, .03);
}
.crm-soon-illu { max-width: 180px; margin: 0 auto 16px; }
.crm-soon i { font-size: 46px; color: var(--gold-light); margin-bottom: 18px; display: block; }
.crm-soon h3 { font-size: 24px; font-weight: 800; margin-bottom: 10px; color: var(--text); }
.crm-soon p { color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 460px; margin: 0 auto; }

/* ===== Subject placeholder modal ===== */
.crm-modal { position: fixed; inset: 0; z-index: 200; display: none; }
.crm-modal.is-open { display: block; }
.crm-modal-overlay { position: absolute; inset: 0; background: rgba(13, 3, 5, .68); backdrop-filter: blur(4px); }
.crm-modal-dialog {
  position: relative; z-index: 1; width: min(640px, calc(100% - 40px));
  margin: 8vh auto 0; max-height: 84vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--card), var(--surface-1));
  border: 1px solid var(--line-strong); border-radius: 22px;
  padding: 32px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.crm-modal-close {
  position: absolute; top: 16px; left: 16px;
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  color: var(--muted); display: grid; place-items: center; font-size: 15px;
  transition: all .2s;
}
.crm-modal-close:hover { color: var(--text); border-color: var(--gold); }
.crm-modal-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.crm-modal-ic {
  width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--gold-light);
  background: rgba(212, 160, 23, .1); border: 1px solid var(--line-strong);
}
.crm-modal-ic i { font-size: 26px; }
.crm-modal-head h2 { font-size: 22px; font-weight: 800; color: var(--text); margin: 0; }
.crm-modal-tr { font-size: 13px; margin-top: 4px; margin-bottom: 2px; }
.crm-modal-head small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.crm-modal-blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.crm-block {
  text-align: center; padding: 24px 14px; border-radius: 16px;
  background: rgba(212, 160, 23, .04); border: 1px solid var(--line);
}
.crm-block i { font-size: 26px; color: var(--gold-light); margin-bottom: 12px; display: block; }
.crm-block strong { display: block; font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.crm-block span { font-size: 12px; color: var(--muted); }

/* ===== Responsive ===== */
/* 2-up: flex-basis accounts for half the 14px gap so two cards fill the row. */
@media (max-width: 768px) {
  .crm-grid { gap: 14px; }
  .crm-card { flex-basis: calc(50% - 7px); max-width: calc(50% - 7px); }
}
@media (max-width: 640px) {
  .crm-card { padding: 22px 14px 16px; }
  .crm-card-ic { width: 42px; height: 42px; margin-bottom: 12px; }
  .crm-card-ic i { font-size: 19px; }
  .crm-card h3 { font-size: 15px; line-height: 1.4; }
  .crm-badge { font-size: 9.5px; padding: 4px 8px; top: 8px; left: 8px; }
  .crm-card-meta { font-size: 10.5px; padding-top: 12px; }
  .crm-modal-blocks { grid-template-columns: 1fr; }
  .crm-stage { padding: 14px 16px; font-size: 14px; min-width: 108px; }
  .crm-stage i { font-size: 18px; }
  .crm-grade { padding: 10px 14px; font-size: 12.5px; }
  .crm-grade .tr-sub, .crm-stage .tr-sub { font-size: 10px; }
  .crm-card .tr-sub { font-size: 11.5px; }
}
/* 1-up on small phones, still centered. */
@media (max-width: 480px) {
  .crm-card { flex-basis: 100%; max-width: 100%; }
}

