/* 학생 화면: 상단 셸/탭, 원형 게이지, 숙제 현황, 교재 카드, 쪽 목록.
   원래 style.css 한 파일이었다. base.html 의 읽는 순서를 바꾸면
   나중 규칙이 앞 규칙을 덮어쓰는 순서가 깨진다. */

/* =========================
   학생: 상단 셸 / 탭
   ========================= */

.student-shell {
  background: var(--surface);
  border-radius: var(--r-container);
  box-shadow: var(--raised);
  padding: 14px 14px 0;
  margin-bottom: 22px;
}

/* 네이비 웰컴 배너 (design.md §5) — 흰 셸 안에 얹히는 딥네이비 카드 */
.welcome-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--navy);
  color: #ffffff;
  border-radius: 14px;
  padding: 18px 18px;
}

.welcome-banner .welcome-text {
  flex: 1;
  min-width: 0;
}

.welcome-banner .mini-logo {
  color: rgba(255, 255, 255, 0.62);
}

.welcome-banner h1 {
  margin: 2px 0 3px;
  color: #ffffff;
  font-size: 22px;
}

.welcome-banner p {
  margin: 0;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
}

/* 원형 라인아트 아바타 */
.avatar {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  color: currentColor;
}

.welcome-banner .avatar {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.icon-btn.ghost {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 16px;
}

.icon-btn.ghost:active {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

/* 셸 안쪽 요소는 배너와 같은 좌우 여백을 갖는다 */
.student-shell .student-top {
  padding: 10px 8px 0;
}

.student-shell .student-tabs {
  padding: 0 12px;
}

.student-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.student-top.compact {
  align-items: center;
  padding-bottom: 20px;
}

.student-top h1 {
  margin: 2px 0 2px;
}

.student-top p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.mini-logo {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--raised-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 18px;
  text-decoration: none;
  flex-shrink: 0;
}

.icon-btn:active {
  box-shadow: var(--inset);
}

.back-link {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--raised-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
}

.back-link:active {
  box-shadow: var(--inset);
}

/* 탭은 플랫: 활성만 파랑 텍스트 + 밑줄 */
.student-tabs {
  display: flex;
  gap: 26px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding: 0 4px;
}

.student-tabs a {
  padding: 14px 2px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2.5px solid transparent;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.student-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.student-section {
  margin-bottom: 26px;
}

.student-section h2 {
  font-size: 16.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 0 4px;
}

.info-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
}

/* =========================
   학생 홈: 원형 게이지
   ========================= */

.gauge-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--raised-sm);
  padding: 26px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 정답률만큼 티얼로 채워지는 진행 링.
   --pct 는 student_home.html 이 인라인으로 넘긴다 (0~100). */
.gauge-outer {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) calc(var(--pct, 0) * 1%),
    var(--surface-soft) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-inner {
  width: 152px;
  height: 152px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.gauge-inner strong {
  font-size: 44px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
}

.gauge-inner strong em {
  font-style: normal;
  font-size: 20px;
  color: var(--muted);
  margin-left: 2px;
}

.gauge-inner span {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.gauge-caption {
  margin: 16px 0 0;
  font-size: 14.5px;
  color: var(--muted);
  font-weight: 600;
}

.gauge-caption strong {
  color: var(--danger);
  font-weight: 800;
}

/* =========================
   학생 홈: 숙제 현황 행 + 도넛 링
   ========================= */

.status-row-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--raised-sm);
  padding: 15px 18px;
}

.status-count {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--inset);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.status-row.done .status-count { color: var(--green); }
.status-row.warn .status-count { color: var(--orange); }
.status-row.todo .status-count { color: var(--muted); }

.status-text {
  flex: 1;
  min-width: 0;
}

.status-text strong {
  display: block;
  font-size: 15.5px;
}

.status-text span {
  font-size: 13px;
  color: var(--muted);
}

.ring {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}

.ring-track,
.ring-fill {
  fill: none;
  stroke-width: 3.6;
  stroke-linecap: round;
}

.ring-track {
  stroke: var(--border);
}

.ring-fill {
  stroke: var(--accent);
}

.status-row.done .ring-fill { stroke: var(--green); }
.status-row.warn .ring-fill { stroke: var(--orange); }
.status-row.todo .ring-fill { stroke: var(--muted); }

/* =========================
   학생: 교재 카드
   ========================= */

.book-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.book-card {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--raised-sm);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
}

.book-card:active {
  box-shadow: var(--inset);
}

.book-cover {
  width: 86px;
  min-height: 104px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--inset);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.book-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.book-small {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.blue-label {
  color: var(--accent);
  font-weight: 800;
}

.book-info h3 {
  font-size: 16.5px;
  margin: 0 0 10px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-row strong {
  font-size: 13px;
  color: var(--accent);
  font-weight: 800;
  flex-shrink: 0;
}

.progress-bar {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--inset);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.progress-caption {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* =========================
   학생: 페이지(숙제) 목록 + 필터
   ========================= */

.student-page-filter {
  margin-bottom: 16px;
}

.filter-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  padding: 0 4px 8px;
}

.filter-label-row strong {
  color: var(--text);
}

.student-filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px;
  -webkit-overflow-scrolling: touch;
}

.student-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--choice-border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  min-height: 40px;
}

.student-filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.student-filter-tab.active strong {
  color: #ffffff;
}

.student-filter-tab strong {
  color: var(--accent);
}

.student-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page-homework-card {
  display: block;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--raised-sm);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
}

.page-homework-card:active {
  box-shadow: var(--inset);
}

.page-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.page-homework-card h3 {
  font-size: 17px;
  margin: 0 0 2px;
}

.page-homework-card > p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 8px;
}

.page-card-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}


/* 숙제 현황 카드를 눌러서 그 상태의 숙제 목록으로 들어갈 수 있게 한다.
   (예전에는 숫자만 보여주고 클릭이 안 됐다.) */
a.status-row {
  text-decoration: none;
  color: inherit;
}

a.status-row:active {
  box-shadow: var(--inset);
}

.status-chev {
  margin-left: auto;
  padding-left: 4px;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
}

/* 화살표가 생겼으므로 링 그래프가 끝까지 밀리지 않게 한다 */
a.status-row .ring {
  margin-left: 0;
}
