/* WordMaster - 공통 스타일 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4facfe;
  --primary-dark: #00c4ff;
  --accent: #f093fb;
  --success: #43e97b;
  --danger: #ff6b6b;
  --warning: #ffd93d;
  --bg-dark: #0f1624;
  --bg-card: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.1);
  --text: #fff;
  --text-muted: rgba(255,255,255,0.5);
  --radius: 16px;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: #0f1624;
  color: var(--text);
  line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, #4facfe, #00c4ff); color: #fff; }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(79,172,254,0.4); transform: translateY(-1px); }
.btn-accent { background: linear-gradient(135deg, #f093fb, #f5576c); color: #fff; }
.btn-accent:hover { box-shadow: 0 6px 20px rgba(240,147,251,0.4); transform: translateY(-1px); }
.btn-success { background: linear-gradient(135deg, #43e97b, #38f9d7); color: #fff; }
.btn-success:hover { box-shadow: 0 6px 20px rgba(67,233,123,0.4); transform: translateY(-1px); }
.btn-danger { background: linear-gradient(135deg, #ff6b6b, #ee0979); color: #fff; }
.btn-danger:hover { box-shadow: 0 6px 20px rgba(255,107,107,0.4); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.1); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 14px; }
.btn-icon { padding: 8px 12px; }

/* Card */
.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(10px);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Nav */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
}
.nav-brand span { background: linear-gradient(135deg,#4facfe,#00f2fe); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-teacher { background: rgba(240,147,251,0.15); color: #f093fb; border: 1px solid rgba(240,147,251,0.3); }
.badge-student { background: rgba(79,172,254,0.15); color: #4facfe; border: 1px solid rgba(79,172,254,0.3); }

/* Form */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  margin-bottom: 7px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 15px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: rgba(79,172,254,0.5);
  background: rgba(79,172,254,0.05);
  box-shadow: 0 0 0 3px rgba(79,172,254,0.08);
}
.form-input::placeholder, .form-textarea::placeholder { color: rgba(255,255,255,0.25); }
.form-select { appearance: none; cursor: pointer; }
.form-select option { background: #1e2a4a; }
.form-textarea { resize: vertical; min-height: 80px; }

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.85);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255,255,255,0.03); }
.data-table tr:last-child td { border-bottom: none; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: rgba(67,233,123,0.15); color: #43e97b; }
.badge-danger { background: rgba(255,107,107,0.15); color: #ff6b6b; }
.badge-warning { background: rgba(255,217,61,0.15); color: #ffd93d; }
.badge-info { background: rgba(79,172,254,0.15); color: #4facfe; }
.badge-purple { background: rgba(240,147,251,0.15); color: #f093fb; }
.badge-gray { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }

/* Stat Card */
.stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-label { font-size: 12px; color: rgba(255,255,255,0.45); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 32px; font-weight: 800; color: #fff; }
.stat-sub { font-size: 13px; color: rgba(255,255,255,0.4); }

/* Progress */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #4facfe, #00f2fe);
  transition: width 0.5s ease;
}

/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  gap: 4px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  background: rgba(30,42,74,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  max-width: 320px;
}
.toast.success { border-left: 3px solid #43e97b; }
.toast.error { border-left: 3px solid #ff6b6b; }
.toast.info { border-left: 3px solid #4facfe; }
@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100px); opacity: 0; }
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: linear-gradient(145deg, #1a2540, #131d36);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  width: 100%;
  animation: modalIn 0.25s ease;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes modalIn {
  from { transform: scale(0.93) translateY(15px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: rgba(255,255,255,0.4);
}
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(79,172,254,0.2);
  border-top-color: #4facfe;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255,255,255,0.3);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state p { font-size: 15px; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* Sidebar layout */
.page-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}
.sidebar {
  width: 240px;
  background: rgba(255,255,255,0.02);
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 20px 12px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Noto Sans KR', sans-serif;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.nav-item.active { background: rgba(79,172,254,0.12); color: #4facfe; }
.nav-item i { width: 18px; text-align: center; }
.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 14px 6px;
}
.page-content { flex: 1; padding: 28px; overflow-x: hidden; }

/* Responsive */
@media (max-width: 900px) {
  .page-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; display: flex; overflow-x: auto; padding: 12px; }
  .sidebar-nav { flex-direction: row; flex-wrap: nowrap; }
  .nav-section-label { display: none; }
  .page-content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .navbar { padding: 12px 16px; }
  .card { padding: 16px; }
}
