/* 교사 화면(teacher.html) 전용 스타일 */

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success-color: #16a34a;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --bg-color: #f1f5f9;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', sans-serif;
}

body {
  background-color: #FBF7EE;
  background-image: url('../images/hunmin-bg.svg');
  background-repeat: repeat;
  background-attachment: fixed;
  background-size: 500px 500px;
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* 컨테이너 */
.teacher-container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* =========================================
   교사 로그인 화면
   ========================================= */
.login-card {
  max-width: 520px;
  margin: 20px auto 0;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
  text-align: center;
}

.login-card h1 {
  font-size: 28px;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.login-card p {
  color: var(--text-muted);
  font-size: 17px;
  margin-bottom: 24px;
}

.teacher-class-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.teacher-class-btn {
  padding: 18px 8px;
  font-size: 20px;
  font-weight: 800;
  background-color: #f8fafc;
  color: #334155;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}

.teacher-class-btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.teacher-class-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-hover);
}

/* 6자리 PIN 디스플레이 */
.pin6-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.pin6-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background-color: #f8fafc;
  transition: all 0.2s;
}

.pin6-dot.filled {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: scale(1.15);
}

/* =========================================
   교사 대시보드 상단 바 & 기간 필터
   ========================================= */
.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background-color: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title h2 {
  font-size: 22px;
  font-weight: 800;
  color: #1e3a8a;
}

.badge-class {
  background-color: #dbeafe;
  color: #1e40af;
  font-size: 15px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
}

.btn-logout {
  background: none;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* 기간 선택 바 */
.period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.period-title {
  font-size: 17px;
  font-weight: 700;
  color: #475569;
}

.period-buttons {
  display: flex;
  gap: 8px;
}

.period-btn {
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 700;
  background-color: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.period-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.period-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* =========================================
   요약 통계 카드
   ========================================= */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

.summary-card {
  background-color: #ffffff;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.summary-value {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}

.summary-value.warning {
  color: var(--warning-color);
}

/* =========================================
   대시보드 메인 섹션 공통
   ========================================= */
.dash-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.dash-card-title {
  font-size: 20px;
  font-weight: 800;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 2열 레이아웃 (반 전체 막대그래프 + TOP 5) */
.class-overview-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

@media (max-width: 800px) {
  .class-overview-grid {
    grid-template-columns: 1fr;
  }
}

.chart-wrapper {
  position: relative;
  min-height: 280px;
}

/* TOP 5 낱말 리스트 */
.top5-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top5-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

.top5-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #e2e8f0;
  font-weight: 800;
  font-size: 14px;
  color: #334155;
  margin-right: 10px;
}

.top5-item:nth-child(1) .top5-rank {
  background-color: #fef08a;
  color: #854d0e;
}
.top5-item:nth-child(2) .top5-rank {
  background-color: #e2e8f0;
  color: #475569;
}
.top5-item:nth-child(3) .top5-rank {
  background-color: #fed7aa;
  color: #9a3412;
}

.top5-word {
  font-weight: 800;
  color: #1e293b;
  font-size: 18px;
}

.top5-count {
  font-weight: 700;
  color: var(--danger-color);
  background-color: #fee2e2;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 14px;
}

/* =========================================
   학생 한 명 보기
   ========================================= */
.student-filter-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .student-filter-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.student-tag-btn {
  aspect-ratio: 1;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.student-tag-btn.has-data {
  background-color: #ffffff;
  color: #1e293b;
  border-color: #94a3b8;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.student-tag-btn.has-data:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.student-tag-btn.active {
  background-color: var(--primary-color) !important;
  color: #ffffff !important;
  border-color: var(--primary-hover) !important;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3) !important;
}

.student-detail-panel {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 20px;
}

.student-recent-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.student-recent-table th,
.student-recent-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  font-size: 15px;
}

.student-recent-table th {
  background-color: #f1f5f9;
  font-weight: 700;
  color: #475569;
}

/* =========================================
   선생님 확인 목록 (검토 및 수정)
   ========================================= */
.check-table {
  width: 100%;
  border-collapse: collapse;
}

.check-table th,
.check-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  font-size: 15px;
}

.check-table th {
  background-color: #f8fafc;
  font-weight: 700;
  color: #475569;
}

.type-select {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  background-color: #ffffff;
  outline: none;
}

.type-select:focus {
  border-color: var(--primary-color);
}

.btn-confirm-ok {
  background-color: #10b981;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-confirm-ok:hover {
  background-color: #059669;
}

.btn-confirm-edit {
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-confirm-edit:hover {
  background-color: var(--primary-hover);
}

.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 16px;
}
