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

:root {
  --bg:        #09090b;
  --surface:   #111113;
  --surface2:  #18181b;
  --border:    #27272a;
  --border2:   #3f3f46;
  --accent:    #a78bfa;
  --accent2:   #7c3aed;
  --green:     #4ade80;
  --yellow:    #facc15;
  --red:       #f87171;
  --blue:      #60a5fa;
  --text:      #fafafa;
  --text2:     #a1a1aa;
  --text3:     #71717a;
  --radius:    12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #c4b5fd; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ── NAV ── */
nav {
  background: rgba(9,9,11,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -.02em;
  text-decoration: none;
}
.nav-brand .logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
}
.nav-brand .tag {
  font-size: .65rem;
  font-weight: 700;
  background: rgba(167,139,250,.15);
  color: var(--accent);
  border: 1px solid rgba(167,139,250,.25);
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: .04em;
}

.nav-links {
  display: flex;
  gap: .1rem;
  list-style: none;
}
.nav-links a {
  color: var(--text2);
  padding: .45rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  transition: all .15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); }
.nav-links a.active { color: var(--accent); background: rgba(167,139,250,.1); }

.nav-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.nav-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #6d28d9, #a78bfa);
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
}
.btn-logout {
  background: transparent;
  color: var(--text3);
  border: 1px solid var(--border);
  padding: .3rem .75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .8rem;
  font-family: inherit;
  transition: all .15s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; background: none; border: none; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text2); border-radius: 2px; transition: all .25s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── LAYOUT ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.page-header { margin-bottom: 2.5rem; }
.page-header h1 {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: .4rem;
}
.page-header p { color: var(--text2); font-size: .95rem; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: border-color .2s;
}
.card:hover { border-color: var(--border2); }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  gap: .75rem;
}

/* ── BADGES ── */
.badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-beginner    { background: rgba(74,222,128,.1);  color: var(--green);  border: 1px solid rgba(74,222,128,.2); }
.badge-intermediate{ background: rgba(250,204,21,.1);  color: var(--yellow); border: 1px solid rgba(250,204,21,.2); }
.badge-advanced    { background: rgba(248,113,113,.1); color: var(--red);    border: 1px solid rgba(248,113,113,.2); }

/* ── CODE ── */
pre, code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .83rem;
}
pre {
  background: #0d0d10;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.7;
  position: relative;
}
pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent2), var(--accent), transparent);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
code {
  background: rgba(167,139,250,.1);
  border: 1px solid rgba(167,139,250,.15);
  color: #c4b5fd;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .82em;
}
pre code { background: none; border: none; padding: 0; color: #e4e4e7; font-size: inherit; }

/* ── CALLOUTS ── */
.callout {
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.callout-icon { font-size: 1rem; flex-shrink: 0; margin-top: .05rem; }
.callout-body { flex: 1; }
.callout-body strong { display: block; margin-bottom: .2rem; font-size: .88rem; }
.callout.info   { background: rgba(96,165,250,.07); border: 1px solid rgba(96,165,250,.2); color: #bfdbfe; }
.callout.info strong { color: var(--blue); }
.callout.task   { background: rgba(74,222,128,.06); border: 1px solid rgba(74,222,128,.18); color: #bbf7d0; }
.callout.task strong { color: var(--green); }
.callout.hint   { background: rgba(250,204,21,.06); border: 1px solid rgba(250,204,21,.18); color: #fef08a; }
.callout.hint strong { color: var(--yellow); }

/* ── HINT TOGGLE ── */
.hint-toggle {
  background: none;
  border: 1px dashed var(--border2);
  color: var(--yellow);
  padding: .35rem .85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .8rem;
  font-family: inherit;
  margin-bottom: .65rem;
  transition: all .15s;
}
.hint-toggle:hover { border-color: var(--yellow); background: rgba(250,204,21,.05); }
.hint-box { display: none; }

/* ── ACCORDION ── */
details { margin-top: .85rem; }
summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 500;
  padding: .4rem .85rem;
  border: 1px solid rgba(167,139,250,.25);
  border-radius: var(--radius-sm);
  transition: all .15s;
}
summary:hover { background: rgba(167,139,250,.08); }
summary::before { content: '▶'; font-size: .6rem; transition: transform .2s; }
details[open] summary::before { transform: rotate(90deg); }
.solution-body { margin-top: .85rem; }

/* ── SEPARATOR ── */
.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* ── QUIZ ── */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: 1rem 0;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .8rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  font-size: .9rem;
}
.quiz-option:hover { border-color: var(--accent); background: rgba(167,139,250,.06); }
.quiz-option.correct { border-color: var(--green); background: rgba(74,222,128,.08); }
.quiz-option.wrong   { border-color: var(--red);   background: rgba(248,113,113,.08); }
.opt-key {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: .8rem;
  width: 20px;
  flex-shrink: 0;
}
.quiz-feedback {
  display: none;
  padding: .9rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  line-height: 1.55;
}
.quiz-feedback.correct { background: rgba(74,222,128,.08);  border: 1px solid rgba(74,222,128,.2);  color: #bbf7d0; }
.quiz-feedback.wrong   { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.2); color: #fecaca; }

/* ── LOGIN ── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(109,40,217,.25) 0%, transparent 60%);
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .logo-big {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto .9rem;
  box-shadow: 0 0 30px rgba(124,58,237,.35);
}
.login-logo h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; }
.login-logo p  { color: var(--text3); font-size: .85rem; margin-top: .3rem; }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: .45rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.form-group input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  color: var(--text);
  font-size: .92rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167,139,250,.12);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  padding: .7rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: .5rem;
  font-family: inherit;
  letter-spacing: .01em;
  transition: opacity .15s, transform .1s;
}
.btn-primary:hover { opacity: .9; }
.btn-primary:active { transform: scale(.99); }

.alert-error {
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.25);
  color: var(--red);
  padding: .7rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── DASHBOARD GRID ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.stat-card.purple::after { background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.stat-card.green::after  { background: linear-gradient(90deg, #16a34a, var(--green)); }
.stat-card.yellow::after { background: linear-gradient(90deg, #ca8a04, var(--yellow)); }
.stat-card.blue::after   { background: linear-gradient(90deg, #1d4ed8, var(--blue)); }
.stat-card .val { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .15rem; }
.stat-card.purple .val { color: var(--accent); }
.stat-card.green .val  { color: var(--green); }
.stat-card.yellow .val { color: var(--yellow); }
.stat-card.blue .val   { color: var(--blue); }
.stat-card .lbl { font-size: .78rem; color: var(--text3); font-weight: 500; }

/* ── QUICK LINKS ── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .75rem;
  margin-bottom: 2rem;
}
.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  color: var(--text);
  text-decoration: none;
  transition: all .2s;
  display: block;
}
.quick-card:hover { border-color: var(--accent); background: rgba(167,139,250,.05); transform: translateY(-1px); color: var(--text); }
.quick-card .qicon { font-size: 1.5rem; margin-bottom: .65rem; }
.quick-card strong { display: block; font-size: .95rem; margin-bottom: .25rem; }
.quick-card p { font-size: .8rem; color: var(--text3); line-height: 1.5; }

/* ── LIST ROWS ── */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row a { font-size: .9rem; font-weight: 500; color: var(--text); }
.list-row a:hover { color: var(--accent); }

/* ── THEORY PAGE ── */
.section-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

table.dt {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  margin-bottom: 1.25rem;
}
table.dt th {
  background: var(--surface2);
  color: var(--text2);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.dt td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: top;
}
table.dt tr:last-child td { border-bottom: none; }
table.dt tr:hover td { background: rgba(255,255,255,.02); }
table.dt code { font-size: .8em; }

/* ── TABS ── */
.tabs {
  display: flex;
  gap: .3rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  flex-wrap: wrap;
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text3);
  padding: .6rem 1rem .75rem;
  cursor: pointer;
  font-size: .875rem;
  font-family: inherit;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.tab-btn:hover { color: var(--text2); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── TOOL CARDS (decompiler page) ── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .75rem;
}
.tool-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.tool-card strong { display: block; margin-bottom: .3rem; font-size: .9rem; }
.tool-card p { font-size: .8rem; color: var(--text3); line-height: 1.5; }

/* ── FOOTER NOTE ── */
.page-footer {
  text-align: center;
  color: var(--text3);
  font-size: .82rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.page-footer a { color: var(--text2); }

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  nav { padding: 0 1rem; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .75rem 1rem;
    flex-direction: column;
    gap: .2rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .6rem .85rem; }
  .hamburger { display: flex; }
  .nav-right .nav-avatar,
  .nav-right span.email-label { display: none; }
  .container { padding: 1.5rem 1rem 3rem; }
  .page-header h1 { font-size: 1.5rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  table.dt { font-size: .78rem; }
  table.dt th, table.dt td { padding: .5rem .65rem; }
  pre { font-size: .76rem; }
  .quick-grid { grid-template-columns: 1fr; }
}
