/* ============================================================
   LMS ROBLOX STUDIO - stylesheet (tema Roblox, playful)
   ============================================================ */

:root {
  --red: #E2231A;
  --red-light: #FF4A3D;
  --red-dark: #B81B13;
  --dark: #1F2937;
  --gray: #6B7280;
  --gray-light: #9CA3AF;
  --bg: #FAFAFC;
  --line: #E5E7EB;
  --green: #00B06F;
  --gold: #F5CD30;
  --blue: #3B82F6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MjAiIGhlaWdodD0iNDIwIiB2aWV3Qm94PSIwIDAgNDIwIDQyMCI+CiAgPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjRTIyMzFBIiBzdHJva2Utd2lkdGg9IjIiIG9wYWNpdHk9IjAuMDgiPgogICAgPHJlY3QgeD0iNTAiIHk9IjUwIiB3aWR0aD0iNDIiIGhlaWdodD0iNDIiIHJ4PSI5IiB0cmFuc2Zvcm09InJvdGF0ZSg0NSA3MSA3MSkiLz4KICAgIDxyZWN0IHg9IjMwMCIgeT0iMTAwIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSI3IiB0cmFuc2Zvcm09InJvdGF0ZSg0NSAzMTcgMTE3KSIvPgogICAgPHJlY3QgeD0iMTIwIiB5PSIyOTAiIHdpZHRoPSI1MCIgaGVpZ2h0PSI1MCIgcng9IjExIiB0cmFuc2Zvcm09InJvdGF0ZSg0NSAxNDUgMzE1KSIvPgogICAgPHJlY3QgeD0iMzMwIiB5PSIzMTAiIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgcng9IjYiIHRyYW5zZm9ybT0icm90YXRlKDQ1IDM0NSAzMjUpIi8+CiAgICA8cmVjdCB4PSIyMDAiIHk9IjE5MCIgd2lkdGg9IjIyIiBoZWlnaHQ9IjIyIiByeD0iNSIgdHJh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AgbDMgLTkgbDMgOSBsMyAtMyBsLTYgLTYgbC02IDYgbDMgMyB6Ii8+CiAgPC9nPgo8L3N2Zz4K");
  background-repeat: repeat;
  background-size: 420px 420px;
  color: var(--dark);
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.2px;
}
.topbar .brand .logo {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--red-light), var(--red));
  border-radius: 7px;
  transform: rotate(45deg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(226,35,26,0.35);
}
.topbar .brand .logo .dot {
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 3px;
}
.topbar .brand .tag {
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--red); border-radius: 999px; padding: 3px 9px;
  margin-left: 2px; letter-spacing: 0.3px;
}
.topbar .right { display: flex; align-items: center; gap: 12px; }
.topbar .whoami { font-size: 13px; color: var(--gray); }
.topbar .whoami b { color: var(--dark); }
.topbar .btn-logout {
  font-size: 13px; color: var(--red); font-weight: 700;
  border: 1.5px solid var(--red); background: #fff;
  border-radius: 999px; padding: 7px 16px;
  transition: background 0.15s ease, color 0.15s ease;
}
.topbar .btn-logout:hover { background: var(--red); color: #fff; }

/* ---------- Auth (login) ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(226,35,26,0.10), transparent 42%),
    radial-gradient(circle at 85% 85%, rgba(245,205,48,0.16), transparent 42%),
    var(--bg);
}
.auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 34px 34px;
  width: 100%;
  max-width: 410px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.10);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
}
.auth-card .logo-big {
  width: 62px; height: 62px;
  background: linear-gradient(135deg, var(--red-light), var(--red));
  border-radius: 14px;
  transform: rotate(45deg);
  margin: 14px auto 30px;
  position: relative;
  box-shadow: 0 8px 20px rgba(226,35,26,0.35);
}
.auth-card .logo-big .dot {
  position: absolute; width: 24px; height: 24px;
  background: #fff; border-radius: 6px;
  top: 19px; left: 19px;
}
.auth-card h1 { font-size: 24px; text-align: center; margin-bottom: 6px; letter-spacing: -0.3px; }
.auth-card .sub { font-size: 13.5px; color: var(--gray); text-align: center; margin-bottom: 28px; }
.auth-card label { display: block; font-size: 13px; color: var(--dark); margin-bottom: 7px; font-weight: 700; }
.auth-card input {
  width: 100%; padding: 13px 15px; font-size: 15px;
  border: 1.5px solid #D1D5DB; border-radius: 12px; margin-bottom: 18px;
  font-family: inherit; background: #FAFAFC;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-card input:focus { outline: none; border-color: var(--red); background: #fff; box-shadow: 0 0 0 4px rgba(226,35,26,0.12); }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--gray); }
.auth-switch a { color: var(--red); font-weight: 700; }
.auth-error {
  background: #FEE2E2; color: #B91C1C; border: 1px solid #FECACA;
  border-radius: 12px; padding: 11px 14px; font-size: 13px; margin-bottom: 16px;
}

/* ---------- Tombol ---------- */
.btn {
  display: inline-block; border: none; cursor: pointer;
  border-radius: 12px; font-family: inherit; font-weight: 700;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--red-light), var(--red));
  color: #fff; padding: 13px 18px; font-size: 15px; width: 100%;
  box-shadow: 0 6px 16px rgba(226,35,26,0.30);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(226,35,26,0.40); transform: translateY(-1px); }
.btn-ghost {
  background: #fff; color: var(--gray);
  border: 1.5px solid #D1D5DB; padding: 11px 16px; font-size: 13px;
}
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-small { padding: 8px 14px; font-size: 13px; }
.btn-success {
  background: linear-gradient(135deg, #00C87F, var(--green));
  color: #fff; padding: 13px 20px; font-size: 15px;
  box-shadow: 0 6px 16px rgba(0,176,111,0.30);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,176,111,0.40); }

/* ---------- Layout utama ---------- */
.container { max-width: 1000px; margin: 0 auto; padding: 32px 20px 70px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 26px; letter-spacing: -0.3px; }
.page-head .sub { font-size: 14px; color: var(--gray); margin-top: 5px; }

/* ---------- Peta (map) ---------- */
.map { margin-bottom: 36px; }
.map-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}
.map-header .progress-text { font-size: 14px; color: var(--gray); font-weight: 700; }
.map-header .progress-text strong { color: var(--red); font-size: 16px; }
.map-track {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 64px 30px 32px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.map-line {
  position: absolute;
  top: 96px;
  left: 56px; right: 56px;
  height: 7px;
  background: #E5E7EB;
  border-radius: 4px;
}
.map-line-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(245,205,48,0.6);
}
.map-nodes {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}
.node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  gap: 12px;
  cursor: pointer;
}
.node .stud {
  width: 72px; height: 72px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 800;
  background: #fff;
  border: 2.5px solid #E5E7EB;
  color: var(--gray-light);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.node:hover .stud { transform: translateY(-4px); }
.node .node-label {
  font-size: 12px; color: var(--gray);
  max-width: 120px; line-height: 1.3;
  font-weight: 700;
}

/* node selesai */
.node.done .stud {
  background: linear-gradient(135deg, var(--red-light), var(--red));
  border-color: var(--red);
  color: #fff;
  animation: pop 0.45s ease;
  box-shadow: 0 8px 20px rgba(226,35,26,0.40);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.node.done .node-label { color: var(--red); }

/* node aktif */
.node.current .stud {
  border-color: var(--red);
  color: var(--red);
  background: #fff;
  animation: pulse 1.6s infinite;
  box-shadow: 0 6px 16px rgba(226,35,26,0.18);
}
.node.current .node-label { color: var(--dark); font-weight: 800; }

/* node terkunci */
.node.locked { cursor: not-allowed; }
.node.locked .stud {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #C4C9D1;
}
.node.locked .node-label { color: #C4C9D1; }

/* avatar karakter kecil */
.avatar {
  position: absolute;
  top: -48px;
  width: 32px; height: 40px;
  background: linear-gradient(160deg, var(--red-light), var(--red));
  border-radius: 8px 8px 5px 5px;
  box-shadow: 0 4px 10px rgba(226,35,26,0.35);
  animation: hop 1.4s infinite;
}
.avatar::before, .avatar::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  top: 11px;
}
.avatar::before { left: 8px; }
.avatar::after { right: 8px; }
.avatar .mouth {
  position: absolute;
  width: 9px; height: 3.5px;
  background: #fff;
  top: 23px; left: 11.5px;
  border-radius: 2px;
}
.avatar .feet {
  position: absolute;
  bottom: -4px; left: 6px; right: 6px;
  height: 5px;
  background: var(--dark);
  border-radius: 3px;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226,35,26,0.45); }
  50% { box-shadow: 0 0 0 16px rgba(226,35,26,0); }
}
@keyframes pop {
  0% { transform: scale(0.4); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-11px); }
}

/* ---------- Kartu materi ---------- */
.materi-list { display: flex; flex-direction: column; gap: 14px; }
.materi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.materi-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,0.08); border-color: #D1D5DB; }
.materi-card .num {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 12px; background: #F3F4F6; color: var(--gray);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
}
.materi-card.done .num { background: linear-gradient(135deg, var(--red-light), var(--red)); color: #fff; }
.materi-card.current { border-color: var(--red); box-shadow: 0 6px 18px rgba(226,35,26,0.12); }
.materi-card.current .num { background: #FEE2E2; color: var(--red); }
.materi-card .info { flex: 1; min-width: 0; }
.materi-card .info .t { font-weight: 800; font-size: 15.5px; }
.materi-card .info .d { font-size: 12.5px; color: var(--gray); margin-top: 3px; }
.materi-card .state {
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  padding: 6px 13px; border-radius: 999px;
}
.state-done { background: #DCFCE7; color: #166534; }
.state-now { background: var(--red); color: #fff; }
.state-lock { background: #F3F4F6; color: #9CA3AF; }

/* ---------- Halaman materi ---------- */
.lesson {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 32px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.lesson h2 { font-size: 22px; margin-bottom: 10px; letter-spacing: -0.3px; }
.lesson .intro {
  font-size: 15px; line-height: 1.7;
  margin-bottom: 22px; padding: 16px 18px;
  background: linear-gradient(135deg, #FFFBEB, #FFF7E0);
  border: 1px solid #FDE68A; border-radius: 14px;
  color: #92400E;
}
.lesson h3 { font-size: 17.5px; margin: 28px 0 10px; color: var(--dark); }
.lesson h3::before { content: '▸ '; color: var(--red); }
.lesson p { font-size: 15px; line-height: 1.75; color: #374151; margin-bottom: 12px; }
.lesson ul { margin: 0 0 14px 22px; font-size: 15px; line-height: 1.75; color: #374151; }
.lesson ul li { margin-bottom: 7px; }
.lesson .code {
  background: linear-gradient(180deg, #23262B, #1A1D21);
  color: #D1FADF;
  border: 1px solid #2E3338;
  border-left: 4px solid var(--red);
  border-radius: 12px;
  padding: 18px 20px;
  font-family: 'Consolas', 'Menlo', 'Courier New', monospace;
  font-size: 13.5px;
  line-height: 1.7;
  overflow-x: auto;
  margin: 14px 0 20px;
  white-space: pre;
}
.lesson .note {
  background: linear-gradient(135deg, #FEF2F2, #FDE9E7);
  border: 1px solid #FECACA;
  border-left: 5px solid var(--red);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 20px 0;
}
.lesson .note strong { display: block; color: #B91C1C; font-size: 15px; margin-bottom: 7px; }
.lesson .note p { color: #7F1D1D; font-size: 14.5px; margin: 0; }
.lesson .tip {
  background: linear-gradient(135deg, #ECFDF5, #DCFCE7);
  border: 1px solid #A7F3D0;
  border-radius: 14px;
  padding: 15px 18px;
  margin: 20px 0;
  font-size: 14.5px; color: #065F46; line-height: 1.65;
}
.lesson .tip::before { content: '💡 '; }

/* ---------- Form kumpul tugas ---------- */
.submit-box {
  background: #fff;
  border: 2px dashed #D1D5DB;
  border-radius: 20px;
  padding: 28px 30px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}
.submit-box h3 { font-size: 18px; margin-bottom: 6px; }
.submit-box .hint { font-size: 13px; color: var(--gray); margin-bottom: 20px; }
.submit-box textarea {
  width: 100%; min-height: 170px;
  border: 1.5px solid #D1D5DB; border-radius: 14px;
  padding: 15px; font-size: 14px;
  font-family: 'Consolas', 'Menlo', monospace;
  background: #FAFAFC;
  resize: vertical; margin-bottom: 16px;
}
.submit-box textarea:focus { outline: none; border-color: var(--red); background: #fff; box-shadow: 0 0 0 4px rgba(226,35,26,0.10); }
.submit-box .file-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.submit-box input[type="file"] { font-size: 13px; }
.submit-box .or { color: var(--gray-light); font-size: 13px; }
.submit-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.success-msg {
  background: #DCFCE7; color: #166534; border: 1px solid #A7F3D0;
  border-radius: 12px; padding: 13px 16px; font-size: 14px; margin-bottom: 16px;
}

/* ---------- Admin ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 20px 22px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,0.08); }
.stat-card .v { font-size: 30px; font-weight: 800; color: var(--dark); }
.stat-card .l { font-size: 12.5px; color: var(--gray); margin-top: 5px; }
.stat-card.accent { border-top: 4px solid var(--red); }
.stat-card.accent .v { color: var(--red); }

.table-wrap {
  overflow-x: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #FAFAFC; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFAFC; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.pill-done { background: #DCFCE7; color: #166534; }
.pill-empty { background: #F3F4F6; color: #C4C9D1; }

.admin-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  font-size: 13.5px; padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--gray);
  cursor: pointer; font-weight: 700;
  transition: all 0.15s ease;
}
.tab:hover { border-color: var(--red); color: var(--red); }
.tab.active { background: linear-gradient(135deg, var(--red-light), var(--red)); border-color: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(226,35,26,0.30); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin-bottom: 22px; box-shadow: 0 4px 14px rgba(0,0,0,0.04); }
.panel h3 { font-size: 16px; margin-bottom: 16px; }
pre.view-code {
  background: linear-gradient(180deg, #23262B, #1A1D21);
  color: #D1FADF; border-radius: 12px;
  padding: 16px; font-size: 13px; line-height: 1.65;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
  font-family: 'Consolas', 'Menlo', monospace;
}

.back-link { font-size: 13px; color: var(--gray); margin-bottom: 18px; display: inline-block; font-weight: 600; }
.back-link:hover { color: var(--red); }

/* ---------- Confetti ---------- */
.confetti {
  position: fixed; top: -12px; z-index: 999;
  width: 12px; height: 18px;
  animation: fall linear forwards;
  pointer-events: none;
  border-radius: 2px;
}
@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.7; }
}

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .node .stud { width: 54px; height: 54px; font-size: 21px; border-radius: 14px; }
  .map-track { padding: 58px 16px 26px; }
  .map-line { left: 32px; right: 32px; top: 88px; }
  .lesson, .submit-box { padding: 22px 16px; }
  .node .node-label { font-size: 10.5px; }
}
