/* ========================================== */
/* SVG RADIAL PROGRESS                         */
/* ========================================== */
.radial-svg { transform: rotate(-90deg); }
.radial-fill { stroke-dasharray: 251.2; stroke-dashoffset: 251.2; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1); }

/* ========================================== */
/* MODAL OVERLAY                               */
/* ========================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 500;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-overlay.show { display: flex; }

body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

/* โมดัลต้องอยู่เหนือปุ่มช่วยเหลือ/ปุ่มลอย เพื่อไม่ให้การแตะในฟอร์มทะลุไปโดนด้านหลัง */
#modal-class { z-index: 9000; touch-action: none; }
#modal-class .bottom-sheet { touch-action: pan-y; overscroll-behavior: contain; }

/* modal กลางจอ (ชื่อเดิม bottom-sheet คงไว้ ใช้ร่วมกันทั้ง 7 modal) */
.bottom-sheet {
  background-color: var(--bg-card);
  width: 450px;
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  overflow-y: auto;
  animation: modalPop 0.22s cubic-bezier(0.34,1.4,0.64,1);
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* bottom sheet มือถือ สไลด์ขึ้นจากล่าง */
@keyframes ckSheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 { font-size: 1.15rem; font-weight: 800; }

/* Student summary modal */
.student-summary-hero {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.student-summary-avatar {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 28px;
  background: var(--av-bg, var(--primary-light));
  color: var(--av-fg, var(--primary));
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
}

.student-summary-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.student-summary-avatar-text {
  max-width: 90px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.student-summary-avatar-text.is-small { font-size: 1.05rem; }
.student-summary-avatar-text.is-tiny { font-size: 0.9rem; }

.student-summary-identity {
  min-width: 0;
}

.student-summary-identity .modal-header {
  gap: 12px;
  margin-bottom: 10px;
}

.student-summary-identity .modal-header h3 {
  min-width: 0;
  font-size: 1.2rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.student-summary-class {
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.student-summary-idline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.student-summary-idline span {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--bg-light);
}

@media (max-width: 540px) {
  .student-summary-hero {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 14px;
  }

  .student-summary-avatar {
    width: 82px;
    height: 82px;
    border-radius: 22px;
    font-size: 1.08rem;
  }
}

/* ========================================== */
/* ANIMATIONS                                  */
/* ========================================== */
.fade-in { animation: fadeIn 0.28s ease; }

/* opacity-only — เลี่ยง translateY ที่ทำให้แถบแท็บ/หัวจอสไลด์กระตุกทุกครั้งที่สลับหน้า
   สลับหน้าเป็น cross-fade นิ่ง ๆ แถบแท็บอยู่กับที่ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes blinker {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* ========================================== */
/* MISC UTILITIES                              */
/* ========================================== */
.empty-state { text-align: center; padding: 36px 12px; color: var(--text-muted); font-weight: 600; }
.empty-state i { font-size: 2.2rem; margin-bottom: 12px; color: var(--border-color); }
.ck-classroom-empty { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 48px 20px; }
.ck-classroom-empty-icon { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 22px; background: var(--primary-light); color: var(--primary); box-shadow: var(--shadow-sm); }
.ck-classroom-empty-icon i { margin: 0; color: currentColor; font-size: 2.25rem; }
.ck-classroom-empty p { margin: 0; color: var(--text-main); font-size: 1rem; font-weight: 700; }
.ck-empty-classroom-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 164px; margin-top: 4px; padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow-md); font-size: .9rem; line-height: 1.25; transition: var(--transition-normal); }
.ck-empty-classroom-plus { position: relative; width: 18px; height: 18px; flex: 0 0 18px; display: inline-block; }
.ck-empty-classroom-plus::before, .ck-empty-classroom-plus::after { content: ''; position: absolute; left: 50%; top: 50%; width: 15px; height: 2px; border-radius: 2px; background: currentColor; transform: translate(-50%, -50%); }
.ck-empty-classroom-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.ck-empty-classroom-cta:hover { background: var(--primary-hover); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.ck-empty-classroom-cta:active { transform: translateY(0); }
@media (max-width: 640px) { .ck-classroom-empty { min-height: 300px; padding: 36px 16px; } .ck-classroom-empty p { text-align: center; font-size: .92rem; } .ck-empty-classroom-cta { width: auto; min-width: 164px; } }
.text-center { text-align: center; }
.login-card { display: flex; flex-direction: column; align-items: center; }
.heatmap-grid-container { display: flex; flex-direction: column; gap: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; min-width: 0; width: 100%; }
.abnormal-list-grid { display: flex; flex-direction: column; gap: 6px; }
.status-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: 12px; white-space: nowrap; }
.class-cards-grid .card:hover { border-color: var(--primary-light-border); transform: translateY(-2px); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7c7cc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a6; }

/* ========================================== */
