/* ============================================================
   KT-PROJECTS LMS — Global Stylesheet
   pages/css/style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-0: #06080f;
  --bg-1: #0c0f1d;
  --bg-2: #111525;
  --bg-3: #171c30;
  --bg-4: #1d233b;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);

  --blue:      #5b8af0;
  --blue-glow: rgba(91,138,240,0.18);
  --blue-soft: rgba(91,138,240,0.1);
  --green:     #34d48e;
  --green-soft:rgba(52,212,142,0.1);
  --amber:     #f0b429;
  --amber-soft:rgba(240,180,41,0.1);
  --red:       #f06b6b;
  --red-soft:  rgba(240,107,107,0.1);
  --purple:    #a78bfa;
  --purple-soft:rgba(167,139,250,0.1);
  --cyan:      #22d3ee;
  --cyan-soft: rgba(34,211,238,0.1);

  --text-1: #e8eaf3;
  --text-2: #8b90aa;
  --text-3: #4a4f68;
  --text-4: #2e3350;

  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ───────────────────────────────────────────── */
h1 { font-size: 28px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 22px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 17px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }
p  { color: var(--text-2); line-height: 1.7; }
a  { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 12px; color: var(--text-3); }
code { font-family: var(--font-mono); font-size: 12px; background: var(--bg-4); padding: 2px 6px; border-radius: 4px; color: var(--cyan); }

/* ── Layout ───────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}
.main-content { flex: 1; overflow-x: hidden; padding: 32px 36px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.w-full { width: 100%; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 24px;
}
.sidebar-logo .logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
}
.sidebar-logo .logo-text { font-size: 15px; font-weight: 700; }
.sidebar-logo .logo-sub  { font-size: 10px; color: var(--text-3); }

.sidebar-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-4);
  padding: 0 10px;
  margin: 16px 0 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.15s;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--bg-3); color: var(--text-1); }
.nav-item.active { background: var(--blue-soft); color: var(--blue); }
.nav-item .nav-icon { font-size: 17px; width: 20px; text-align: center; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}

.sidebar-user {
  margin-top: auto;
  padding: 12px 10px;
  background: var(--bg-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.sidebar-user .user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user .user-name { font-size: 13px; font-weight: 600; }
.sidebar-user .user-role { font-size: 11px; color: var(--text-3); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-hover { transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; cursor: pointer; }
.card-hover:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.stat-icon { font-size: 28px; margin-bottom: 12px; }
.stat-value { font-size: 32px; font-weight: 700; line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-sub   { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #4a78e0; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(91,138,240,0.4); }
.btn-secondary { background: var(--bg-4); color: var(--text-1); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-3); border-color: var(--border-hover); }
.btn-danger  { background: var(--red-soft); color: var(--red); border: 1px solid rgba(240,107,107,0.2); }
.btn-danger:hover:not(:disabled) { background: rgba(240,107,107,0.2); }
.btn-success { background: var(--green-soft); color: var(--green); border: 1px solid rgba(52,212,142,0.2); }
.btn-success:hover:not(:disabled) { background: rgba(52,212,142,0.2); }
.btn-ghost   { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-3); color: var(--text-1); }
.btn-sm  { padding: 6px 14px; font-size: 12px; }
.btn-lg  { padding: 13px 28px; font-size: 15px; }
.btn-icon { padding: 9px; width: 38px; height: 38px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-4); }
.form-select { appearance: none; cursor: pointer; }
.form-select option { background: var(--bg-2); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 5px; }
.input-group { display: flex; gap: 8px; }
.input-group .form-input { flex: 1; }

/* ── Badges / Pills ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-blue   { background: var(--blue-soft);   color: var(--blue); }
.badge-green  { background: var(--green-soft);  color: var(--green); }
.badge-amber  { background: var(--amber-soft);  color: var(--amber); }
.badge-red    { background: var(--red-soft);    color: var(--red); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-cyan   { background: var(--cyan-soft);   color: var(--cyan); }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}
.modal-backdrop.show { opacity: 1; }
.modal-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s;
}
.modal-backdrop.show .modal-box { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-title  { font-size: 17px; font-weight: 700; }
.modal-close  { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all 0.15s; }
.modal-close:hover { background: var(--red-soft); color: var(--red); border-color: rgba(240,107,107,0.2); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ── Alert / Notification Bar ─────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.alert-warning { background: var(--amber-soft); border: 1px solid rgba(240,180,41,0.2); color: var(--amber); }
.alert-success { background: var(--green-soft);  border: 1px solid rgba(52,212,142,0.2); color: var(--green); }
.alert-error   { background: var(--red-soft);    border: 1px solid rgba(240,107,107,0.2); color: var(--red); }
.alert-info    { background: var(--blue-soft);   border: 1px solid rgba(91,138,240,0.2);  color: var(--blue); }

/* ── Toast ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease forwards;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Progress bar ─────────────────────────────────────────── */
.progress { height: 6px; background: var(--bg-4); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.progress-bar.blue   { background: var(--blue); }
.progress-bar.green  { background: var(--green); }
.progress-bar.amber  { background: var(--amber); }

/* ── Avatar ───────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 13px;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.avatar-md { width: 38px; height: 38px; font-size: 14px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* ── Video Player ─────────────────────────────────────────── */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #000;
  border: 1px solid var(--border);
}
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-3);
}
.video-placeholder .play-icon { font-size: 48px; opacity: 0.4; }

/* ── Section Headers ──────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 { margin-bottom: 6px; }
.page-header p  { font-size: 14px; }
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 16px; font-weight: 700; }

/* ── Divider ──────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); }

/* ── Lecture List Item ────────────────────────────────────── */
.lecture-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--bg-3);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 8px;
}
.lecture-item:hover { border-color: var(--border-hover); background: var(--bg-4); }
.lecture-item.active { border-color: var(--blue); background: var(--blue-soft); }
.lecture-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-4);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-3);
  flex-shrink: 0;
}
.lecture-num.done { background: var(--green-soft); color: var(--green); }
.lecture-info { flex: 1; min-width: 0; }
.lecture-info .title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lecture-info .meta  { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ── Course Card ──────────────────────────────────────────── */
.course-card { overflow: hidden; }
.course-card .course-thumb {
  height: 140px;
  background: linear-gradient(135deg, var(--bg-4), var(--bg-3));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin: -20px -20px 16px;
  border-bottom: 1px solid var(--border);
}
.course-card .course-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.course-card .course-meta  { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.course-card .course-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  padding: 5px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  width: fit-content;
}
.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn.active { background: var(--bg-4); color: var(--text-1); }
.tab-btn:hover:not(.active) { color: var(--text-1); }

/* ── Misc ─────────────────────────────────────────────────── */
.text-blue   { color: var(--blue); }
.text-green  { color: var(--green); }
.text-amber  { color: var(--amber); }
.text-red    { color: var(--red); }
.text-purple { color: var(--purple); }
.text-muted  { color: var(--text-2); }
.text-dim    { color: var(--text-3); }
.font-mono   { font-family: var(--font-mono); }
.font-bold   { font-weight: 700; }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 11px; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.truncate    { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.separator   { height: 1px; background: var(--border); margin: 20px 0; }
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 17px; color: var(--text-2); margin-bottom: 8px; }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main-content { padding: 20px 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .sidebar { display: none; }
  .app-shell { flex-direction: column; }
}
