/* ============================================================
   PrakWeb MI 2A — Custom Stylesheet
   ============================================================ */

:root {
  --primary:   #4f46e5;
  --primary-l: #6366f1;
  --purple:    #7c3aed;
  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --info:      #06b6d4;
  --bg:        #f0f2f8;
  --card-bg:   #ffffff;
  --border:    #e5e7eb;
  --text:      #1f2937;
  --muted:     #6b7280;
  --font:      'Inter', system-ui, sans-serif;
  --radius:    16px;
  --shadow:    0 2px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }
body { font-family: var(--font); color: var(--text); }
.bg-app { background: var(--bg); }

/* ── Typography helpers ─────────────────────────────────── */
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.letter-spacing-1 { letter-spacing: .5px; }
.text-purple { color: var(--purple) !important; }
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Navbar glass ───────────────────────────────────────── */
.navbar-glass {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
}
.navbar-brand { font-size: 1.1rem; font-weight: 800; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-glow {
  box-shadow: 0 0 0 3px rgba(79,70,229,.12), var(--shadow-lg);
  border: 1px solid rgba(79,70,229,.2);
}
.bg-gradient-soft {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
}

/* ── Welcome Banner ─────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  border-radius: 20px;
  padding: 2rem 2.5rem;
  box-shadow: 0 12px 40px rgba(79,70,229,.35);
}
.welcome-icon {
  width: 80px; height: 80px;
  background: rgba(255,255,255,.15);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: #fff;
}
.badge-nim  { background: rgba(255,255,255,.2); color: #fff; font-size: .8rem; padding: .4rem .8rem; border-radius: 30px; }
.badge-class { background: rgba(255,255,255,.15); color: rgba(255,255,255,.9); font-size: .8rem; padding: .4rem .8rem; border-radius: 30px; }

/* ── Progress Steps ─────────────────────────────────────── */
.steps-bar { display: flex; align-items: center; gap: 0; background: #fff; border-radius: 14px; padding: 1rem 1.5rem; box-shadow: var(--shadow); }
.step { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: var(--muted); background: #f9fafb;
  transition: .3s;
}
.step.active .step-dot { border-color: var(--primary); color: var(--primary); background: rgba(79,70,229,.08); }
.step.done .step-dot   { border-color: var(--success); background: var(--success); color: #fff; }
.step span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.step.active span, .step.done span { color: var(--text); }
.step-line { flex-grow: 1; height: 2px; background: var(--border); margin: 0 .5rem; transition: .3s; }
.step-line.done { background: var(--success); }

/* ── Roll Button ────────────────────────────────────────── */
.roll-icon {
  width: 100px; height: 100px; border-radius: 28px;
  background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(124,58,237,.12));
  display: flex; align-items: center; justify-content: center;
}
.btn-roll {
  border-radius: 50px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border: none;
  transition: .3s;
  position: relative; overflow: hidden;
}
.btn-roll::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.15) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-100%); transition: .5s;
}
.btn-roll:hover::after { transform: translateX(100%); }
.btn-roll:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(79,70,229,.4); }

/* ── Project Card ───────────────────────────────────────── */
.card-project { border: none; overflow: hidden; }
.card-header-project {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  padding: 1.5rem 2rem;
}
.project-number {
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: #fff;
}

/* ── Schema Code ────────────────────────────────────────── */
.schema-card { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.schema-header { background: #1e1b4b; color: rgba(255,255,255,.8); padding: .6rem 1rem; font-size: .8rem; font-family: var(--font); }
.schema-code { margin: 0; border-radius: 0; font-size: .75rem; max-height: 260px; overflow-y: auto; }
.schema-code code { font-size: .75rem !important; }

/* ── Status items ───────────────────────────────────────── */
.status-item { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid rgba(0,0,0,.05); font-size: .9rem; }
.status-item:last-child { border-bottom: none; }

/* ── Badges soft ────────────────────────────────────────── */
.bg-primary-soft   { background: rgba(79,70,229,.1)  !important; }
.bg-success-soft   { background: rgba(16,185,129,.1) !important; }
.bg-warning-soft   { background: rgba(245,158,11,.1) !important; }
.bg-danger-soft    { background: rgba(239,68,68,.1)  !important; }
.bg-info-soft      { background: rgba(6,182,212,.1)  !important; }
.bg-secondary-soft { background: rgba(107,114,128,.1)!important; }
.text-info   { color: var(--info)    !important; }
.text-purple { color: var(--purple)  !important; }

/* ── Progress page header ───────────────────────────────── */
.progress-header {
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1040;
}

/* ── Stats bar ──────────────────────────────────────────── */
.stats-bar { display: flex; gap: 2rem; flex-wrap: wrap; }
.stat-item { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); }
.stat-item span { font-size: 1.1rem; font-weight: 700; color: var(--text); }

/* ── Load progress bar ──────────────────────────────────── */
.load-progress-bar { height: 3px; background: rgba(79,70,229,.15); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.load-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--purple)); border-radius: 2px; transition: width .3s; }

/* ── Cache banner ───────────────────────────────────────── */
.cache-banner {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: rgba(255,255,255,.9);
  border-radius: 12px; padding: .7rem 1.2rem;
  font-size: .85rem; display: flex; align-items: center;
}

/* ── Table ──────────────────────────────────────────────── */
.table-head-sticky th {
  background: #f9fafb; position: sticky; top: 0; z-index: 2;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .5px;
  font-weight: 700; color: var(--muted);
  border-bottom: 2px solid var(--border);
}
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--primary) !important; }

/* ── Commit badges ──────────────────────────────────────── */
.commit-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .7rem; border-radius: 20px; font-size: .85rem; font-weight: 700;
}
.commit-high   { background: rgba(16,185,129,.12); color: #059669; }
.commit-medium { background: rgba(245,158,11,.12);  color: #d97706; }
.commit-low    { background: rgba(239,68,68,.12);   color: #dc2626; }
.commit-none   { background: rgba(107,114,128,.1);  color: var(--muted); }

/* ── Skeleton loading ───────────────────────────────────── */
.skeleton-row td { padding: .8rem !important; }
.skel {
  height: 14px; border-radius: 8px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  display: inline-block; vertical-align: middle;
}
.skel-sm  { width: 60px; }
.skel-md  { width: 120px; }
.skel-lg  { width: 180px; }
.skel-full { width: 100%; }
.skel-badge { width: 70px; height: 22px; border-radius: 30px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Admin sidebar ──────────────────────────────────────── */
.admin-sidebar {
  width: 240px; min-height: 100vh;
  background: #1e1b4b;
  padding: 0; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.5rem 1.5rem 1rem;
  color: #fff; font-size: 1rem; font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { font-size: 1.3rem; color: var(--primary-l); }
.sidebar-nav { padding: 1rem .75rem; display: flex; flex-direction: column; gap: .25rem; }
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; border-radius: 10px;
  color: rgba(255,255,255,.65); text-decoration: none;
  font-size: .9rem; font-weight: 500;
  transition: .2s;
}
.sidebar-link i { width: 18px; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: rgba(99,102,241,.3); color: #fff; }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); }
.avatar-sm {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(99,102,241,.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-l); font-size: .9rem;
}

/* ── Stat cards ─────────────────────────────────────────── */
.stat-card { border-radius: 16px; padding: 1.25rem; position: relative; overflow: hidden; }
.stat-card-blue   { background: linear-gradient(135deg,#dbeafe,#eff6ff); }
.stat-card-purple { background: linear-gradient(135deg,#ede9fe,#f5f3ff); }
.stat-card-green  { background: linear-gradient(135deg,#d1fae5,#ecfdf5); }
.stat-card-orange { background: linear-gradient(135deg,#ffedd5,#fff7ed); }
.stat-icon { font-size: 1.6rem; margin-bottom: .5rem; opacity: .6; }
.stat-card-blue .stat-icon { color: #2563eb; }
.stat-card-purple .stat-icon { color: var(--purple); }
.stat-card-green .stat-icon { color: var(--success); }
.stat-card-orange .stat-icon { color: #f97316; }
.stat-val { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-lbl { font-size: .8rem; color: var(--muted); margin-top: .25rem; }

/* ── Misc ───────────────────────────────────────────────── */
.btn-xs { padding: .2rem .5rem; font-size: .75rem; }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 10px; }
.btn-ghost:hover { background: var(--bg); }
.font-monospace { font-family: 'JetBrains Mono', 'Courier New', monospace; }
.repo-info { background: #f9fafb; border-radius: 12px; padding: .75rem 1rem; }

/* ── Commit detail modal ────────────────────────────────── */
.commit-entry { border-left: 3px solid var(--primary); padding: .5rem 1rem; margin-bottom: .75rem; border-radius: 0 8px 8px 0; background: #f9fafb; }
.commit-sha  { font-family: monospace; background: #e5e7eb; padding: .1rem .4rem; border-radius: 4px; font-size: .75rem; }
.commit-msg  { font-size: .9rem; font-weight: 600; margin: .25rem 0 .1rem; }
.commit-meta { font-size: .75rem; color: var(--muted); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 767px) {
  .steps-bar { flex-wrap: wrap; gap: .5rem; }
  .step-line { display: none; }
  .stats-bar { gap: 1rem; }
  .welcome-banner { padding: 1.5rem; }
  .login-body { padding: 1.5rem; }
}
