/* MAGIC ENGLISH Phase 5 — Unified 4+1 GNB & First-Screen Diet CSS */
:root {
  --me-gnb-bg: #0f172a;
  --me-gnb-border: rgba(148, 163, 184, 0.22);
  --me-primary: #4f46e5;
  --me-primary-light: #818cf8;
}

.me-unified-gnb {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(90deg, #0b1120 0%, #1e293b 100%);
  color: #f8fafc;
  border-bottom: 1px solid var(--me-gnb-border);
  position: sticky;
  top: 0;
  z-index: 9500;
  padding: 0.55rem 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Malgun Gothic", sans-serif;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.22);
}
.me-unified-gnb-inner {
  max-width: 1640px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
.me-gnb-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.me-gnb-brand-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(129, 140, 248, 0.45);
  color: #c7d2fe;
}
.me-gnb-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.me-gnb-tab {
  text-decoration: none;
  color: #cbd5e1;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.46rem 0.85rem;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.me-gnb-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
.me-gnb-tab.is-active {
  background: var(--me-primary);
  color: #ffffff;
  border-color: rgba(165, 180, 252, 0.4);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}
.me-gnb-utils {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.me-gnb-util-btn {
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.me-gnb-util-btn:hover {
  border-color: var(--me-primary-light);
  color: #ffffff;
}

/* 메인 페이지(index.html) 중복 배너 다이어트 및 슬림 보조 훈련 바 */
body.me-ia-consolidated > header:not(#mainPortalHeader) {
  position: static !important;
}
body.me-ia-consolidated > header:not(#mainPortalHeader) > div > div:first-child {
  display: none !important;
}
body.me-ia-consolidated > header nav {
  width: auto !important;
}
body.me-ia-consolidated > header:not(#mainPortalHeader) nav a[href*="/curriculum.html"],
body.me-ia-consolidated > header:not(#mainPortalHeader) nav a[href*="/vocab-hub.html"],
body.me-ia-consolidated > header nav button[onclick*="jumpToLearningTools"],
body.me-ia-consolidated > header #meTeacherUnlockBtn {
  display: none !important;
}
body.me-ia-consolidated #learningToolsSection {
  display: none !important;
}
body.me-ia-consolidated #meExtToolsDetails {
  margin: 0.5rem auto !important;
}
body.me-ia-consolidated a[href*="streamlit.app"] {
  display: none !important;
}
body.me-ia-consolidated #topAppHeader {
  position: static !important;
}
/* class.html 단독 접속 시 조인 화면에서는 상단 GNB 유지, 화상 통화 진입 시 전체 화면 확보 */
body.me-ia-consolidated #join-screen {
  height: calc(100dvh - 52px) !important;
}
body.me-ia-consolidated:has(#join-screen.hidden) > .me-unified-gnb {
  display: none !important;
}

.me-slim-drill-bar {
  max-width: 1640px;
  width: calc(100% - 2rem);
  box-sizing: border-box;
  margin: 0.35rem auto 0.1rem;
  padding: 0.36rem 0.9rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.8rem;
}
.me-slim-drill-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
}
.me-slim-drill-links a,
.me-slim-drill-links button {
  text-decoration: none;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.79rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.14s ease;
}
.me-slim-drill-links a:hover,
.me-slim-drill-links button:hover {
  background: #eef2ff;
  color: #4338ca;
  border-color: #818cf8;
}

/* 시각적 전체 메뉴(사이트맵) 모달 */
.me-sitemap-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 1rem;
}
.me-sitemap-backdrop.is-open { display: flex; }
.me-sitemap-dialog {
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  max-width: 960px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}
.me-sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.me-sitemap-col {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
}
.me-sitemap-col h4 {
  margin: 0 0 0.6rem 0;
  font-size: 0.94rem;
  color: #1e293b;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.45rem;
}
.me-sitemap-col a {
  display: block;
  text-decoration: none;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  border-radius: 7px;
  margin-bottom: 2px;
}
.me-sitemap-col a:hover {
  background: #eef2ff;
  color: #4338ca;
}

@media print {
  .me-unified-gnb,
  .me-slim-drill-bar,
  .me-sitemap-backdrop,
  .me-admin-center-backdrop {
    display: none !important;
  }
}

/* ==========================================================================
   선생님 통합 관리자 센터 모달 (#meAdminCenterBackdrop) — 출결 · 수업도구 · 카톡예약 · 맞춤단어장 관리
   ========================================================================== */
.me-gnb-util-btn.is-admin-unlocked {
  border-color: rgba(16, 185, 129, 0.6) !important;
  background: rgba(16, 185, 129, 0.14) !important;
  color: #6ee7b7 !important;
}
.me-admin-center-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.78);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 0.9rem;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Malgun Gothic", sans-serif;
}
.me-admin-center-backdrop.is-open {
  display: flex;
}
.me-admin-auth-card {
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  max-width: 410px;
  border-radius: 22px;
  padding: 1.75rem;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid #e2e8f0;
  text-align: center;
}
.me-admin-hub-dialog {
  background: #f8fafc;
  color: #0f172a;
  width: 100%;
  max-width: 1320px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.me-admin-hub-head {
  background: linear-gradient(90deg, #0b1120 0%, #1e293b 100%);
  color: #ffffff;
  padding: 1rem 1.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}
.me-admin-hub-tabs {
  background: #ffffff;
  padding: 0.65rem 1.35rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.me-admin-tab-btn {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  padding: 0.58rem 1rem;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.me-admin-tab-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.me-admin-tab-btn.is-active {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4338ca;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}
.me-admin-hub-body {
  padding: 1.25rem 1.35rem 1.6rem;
  overflow-y: auto;
  flex: 1;
}
.me-adm-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}
.me-adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.58rem 1rem;
  font-size: 0.83rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.12s ease;
}
.me-adm-btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}
.me-adm-btn.is-outline {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}
.me-adm-btn.is-outline:hover {
  background: #f8fafc;
  border-color: #64748b;
}
.me-adm-class-tools {
  margin-top: 1.05rem;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  padding: 1.35rem 1.45rem;
  display: grid;
  grid-template-columns: 1.15fr minmax(280px, 430px);
  align-items: center;
  gap: 1.2rem;
}
@media (max-width: 820px) {
  .me-adm-class-tools {
    grid-template-columns: 1fr;
  }
  .me-admin-hub-body {
    padding: 0.95rem;
  }
}
.me-adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.me-adm-table th,
.me-adm-table td {
  border: 1px solid #e2e8f0;
  padding: 0.65rem 0.8rem;
  text-align: left;
}
.me-adm-table th {
  background: #f8fafc;
  font-weight: 800;
  white-space: nowrap;
}
