/* ===== GRE Prep — bold, energetic, dopamine-forward theme ===== */
:root {
  --bg: #f3f4fb;
  --bg2: #eef0fa;            /* tinted secondary surfaces (rows, inputs, passages) */
  --card: #ffffff;
  --card2: #f6f7fd;          /* secondary buttons / soft surfaces */
  --border: #e8e9f4;
  --border2: #d8dbec;
  --text: #1c2233;
  --muted: #707892;
  --faint: #a2a8bd;

  --accent: #7c5cff;         /* violet — primary */
  --accent-soft: rgba(124, 92, 255, 0.12);
  --pink: #ff5da2;
  --blue: #3b82f6;
  --teal: #14c4b0;
  --lime: #7bdc4e;
  --orange: #ff8a3d;
  --gold: #ffb020;

  --good: #16c08a;
  --good-soft: rgba(22, 192, 138, 0.14);
  --bad: #ff5468;
  --bad-soft: rgba(255, 84, 104, 0.12);
  --warn: #ff9f33;

  --grad-primary: linear-gradient(135deg, #7c5cff 0%, #ff5da2 100%);
  --grad-streak: linear-gradient(135deg, #ff8a3d 0%, #ffc24b 100%);
  --grad-success: linear-gradient(135deg, #14c4b0 0%, #7bdc4e 100%);
  --grad-blue: linear-gradient(135deg, #4f8cff 0%, #7c5cff 100%);
  --grad-sidebar: linear-gradient(185deg, #7d5cff 0%, #6a44ec 60%, #5b37d6 100%);

  --shadow: 0 12px 30px rgba(60, 50, 120, 0.10);
  --shadow-sm: 0 4px 14px rgba(60, 50, 120, 0.08);
  --r: 18px;
  --r-sm: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(900px 500px at 110% -5%, rgba(255, 93, 162, 0.10), transparent 60%),
    radial-gradient(800px 500px at -10% 0%, rgba(124, 92, 255, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Nunito", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 .8em; }
small { color: var(--muted); }
code { background: #eef0fa; padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--grad-sidebar);
  padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  box-shadow: 6px 0 30px rgba(95, 60, 220, 0.18);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: #fff; display: grid; place-items: center; font-weight: 900; color: #7c5cff; font-size: 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}
.brand .name { font-weight: 800; color: #fff; letter-spacing: .2px; }
.brand .sub { font-size: .74rem; color: rgba(255,255,255,.7); margin-top: -2px; }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 13px;
  color: rgba(255,255,255,.82); cursor: pointer; font-weight: 700; font-size: .94rem; user-select: none;
  transition: background .15s, transform .05s;
}
.nav-item:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; transform: translateX(2px); }
.nav-item.active { background: #fff; color: #6a44ec; box-shadow: 0 6px 16px rgba(0,0,0,0.14); }
.nav-item .ico { width: 20px; text-align: center; font-size: 1.05rem; }
.nav-foot { margin-top: 20px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.18); font-size: .76rem; color: rgba(255,255,255,.7); }
.nav-foot a { color: #fff; text-decoration: underline; }

.main { padding: 30px 38px 70px; max-width: 1160px; margin: 0 auto; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .subtitle { color: var(--muted); font-size: .95rem; font-weight: 600; }

/* cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* stat tiles — colorful, with accent top stripe */
.stat { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 20px 20px; box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat::before { content: ""; position: absolute; left: 0; top: 0; height: 5px; width: 100%; background: var(--accent); }
.grid.cols-4 .stat:nth-child(1)::before { background: var(--grad-streak); }
.grid.cols-4 .stat:nth-child(2)::before { background: var(--grad-blue); }
.grid.cols-4 .stat:nth-child(3)::before { background: var(--grad-success); }
.grid.cols-4 .stat:nth-child(4)::before { background: var(--grad-primary); }
.stat .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .6px; font-weight: 800; }
.stat .value { font-size: 2.1rem; font-weight: 900; margin-top: 6px; letter-spacing: -0.02em; }
.stat .value.sm { font-size: 1.5rem; }
.stat .hint { color: var(--faint); font-size: .8rem; margin-top: 2px; font-weight: 600; }
.streak-tile { background: var(--grad-streak); border: none; color: #fff; }
.streak-tile::before { display: none; }
.streak-tile .label, .streak-tile .hint { color: rgba(255,255,255,.85); }
.streak-tile .value { color: #fff; animation: pulse 2.2s ease-in-out infinite; transform-origin: left center; }

/* buttons — chunky, with 3D press */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--card2); color: var(--text); border: 1px solid var(--border2);
  padding: 11px 18px; border-radius: 13px; font-weight: 800; font-size: .92rem; cursor: pointer;
  transition: transform .05s ease, filter .15s ease, background .15s ease; font-family: inherit;
}
.btn:hover { background: #eef0fa; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad-primary); color: #fff; border: none; box-shadow: 0 8px 18px rgba(124, 92, 255, 0.32); }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-good { background: var(--grad-success); color: #06281e; border: none; box-shadow: 0 8px 18px rgba(20, 196, 176, 0.30); }
.btn-bad { background: #fff; color: var(--bad); border-color: rgba(255,84,104,.4); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* progress bar — gradient fill */
.bar { height: 12px; background: #e7e9f6; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--grad-primary); border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar.good > span { background: var(--grad-success); }

/* badges & chips */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .2px; }
.badge.q { background: var(--accent-soft); color: var(--accent); }
.badge.v { background: rgba(255, 93, 162, 0.14); color: var(--pink); }
.badge.easy { background: var(--good-soft); color: var(--good); }
.badge.medium { background: rgba(255,159,51,.16); color: var(--warn); }
.badge.hard { background: var(--bad-soft); color: var(--bad); }
.chip { display: inline-flex; gap: 6px; align-items: center; background: var(--bg2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px; font-size: .82rem; color: var(--muted); font-weight: 700; }

/* today checklist */
.task { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 15px; background: var(--card); margin-bottom: 10px; transition: transform .1s, box-shadow .12s; }
.task:hover { transform: translateX(3px); box-shadow: var(--shadow-sm); }
.task .check { width: 26px; height: 26px; border-radius: 9px; border: 2.5px solid var(--border2); flex: none; cursor: pointer; display: grid; place-items: center; color: transparent; font-size: 14px; font-weight: 900; transition: transform .12s; }
.task .check:hover { transform: scale(1.1); }
.task.done { opacity: .58; }
.task.done .check { background: var(--grad-success); border-color: transparent; color: #fff; }
.task .t-main { flex: 1; }
.task .t-label { font-weight: 800; }
.task .t-meta { color: var(--faint); font-size: .8rem; font-weight: 600; }
.task .t-min { color: var(--muted); font-size: .82rem; white-space: nowrap; font-weight: 700; }

/* lessons / learn */
.topic-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 15px; background: var(--card); margin-bottom: 11px; transition: transform .1s, box-shadow .12s, border-color .12s; }
.topic-row:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.topic-row .t-title { font-weight: 800; }
.topic-row .t-acc { font-size: .82rem; color: var(--muted); font-weight: 600; }
.lesson-body { font-size: .97rem; }
.lesson-body h4 { margin-top: 1.2em; color: var(--accent); }
.lesson-body ul { padding-left: 20px; }
.lesson-body li { margin-bottom: 4px; }
.formula { background: var(--bg2); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 9px 14px; margin: 7px 0; font-family: "Cascadia Code", Consolas, monospace; font-size: .88rem; }
.trap { background: var(--bad-soft); border-left: 4px solid var(--bad); padding: 8px 14px; border-radius: 8px; margin: 7px 0; font-size: .9rem; font-weight: 600; }

/* quiz */
.quiz-wrap { max-width: 860px; }
.passage { background: var(--bg2); border: 1px solid var(--border); border-radius: 15px; padding: 18px 20px; margin-bottom: 18px; max-height: 340px; overflow-y: auto; font-size: .95rem; }
.q-prompt { font-size: 1.1rem; margin-bottom: 18px; font-weight: 600; }
.q-prompt .quantity { display: block; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 13px; margin: 7px 0; }
.choice {
  display: flex; gap: 13px; align-items: flex-start; padding: 14px 17px; border: 2px solid var(--border); border-radius: 14px;
  margin-bottom: 11px; cursor: pointer; background: var(--card); transition: border-color .12s, transform .08s, background .12s;
}
.choice:hover { border-color: var(--accent); transform: translateY(-1px); }
.choice .mark { width: 27px; height: 27px; border-radius: 50%; border: 2.5px solid var(--border2); flex: none; display: grid; place-items: center; font-weight: 900; font-size: .82rem; color: var(--muted); }
.choice.multi .mark { border-radius: 9px; }
.choice.selected { border-color: var(--accent); background: var(--accent-soft); }
.choice.selected .mark { border-color: var(--accent); color: var(--accent); }
.choice.correct { border-color: var(--good); background: var(--good-soft); }
.choice.correct .mark { background: var(--grad-success); border-color: transparent; color: #fff; }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice.wrong .mark { background: var(--bad); border-color: transparent; color: #fff; }
.numeric-input { width: 200px; font-size: 1.15rem; padding: 12px 16px; background: var(--bg2); border: 2px solid var(--border2); border-radius: 13px; color: var(--text); font-weight: 700; }
.numeric-input:focus { outline: none; border-color: var(--accent); }
.explain { margin-top: 18px; padding: 17px 20px; border-radius: 15px; background: var(--bg2); border: 1px solid var(--border); }
.explain.correct { border-left: 5px solid var(--good); }
.explain.wrong { border-left: 5px solid var(--bad); }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 12px; }
.timer { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 800; }
.timer.warn { color: var(--warn); }
.qcount { color: var(--muted); font-size: .9rem; font-weight: 700; }

/* flashcard */
.flash { max-width: 560px; margin: 0 auto; }
.flash-card {
  background: var(--grad-primary); color: #fff; border: none;
  border-radius: 24px; min-height: 250px; padding: 34px; display: grid; place-items: center; text-align: center;
  cursor: pointer; box-shadow: 0 18px 40px rgba(124, 92, 255, 0.30); transition: transform .14s ease;
}
.flash-card:hover { transform: translateY(-3px); }
.flash-card:active { transform: scale(.99); }
.flash-word { font-size: 2.3rem; font-weight: 900; letter-spacing: .2px; }
.flash-pos { color: rgba(255,255,255,.8); font-style: italic; margin-top: 4px; }
.flash-def { font-size: 1.2rem; font-weight: 700; }
.flash-ex { color: rgba(255,255,255,.9); font-style: italic; margin-top: 14px; font-size: .96rem; }
.flash-syn { margin-top: 14px; color: #fff; font-weight: 800; font-size: .92rem; }
.flash-hint { color: rgba(255,255,255,.72); font-size: .82rem; margin-top: 18px; }
.flash-actions { display: flex; gap: 13px; justify-content: center; margin-top: 20px; }

/* charts */
.spark { width: 100%; height: 130px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* misc */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 26px; }
.empty { text-align: center; color: var(--muted); padding: 44px 20px; font-weight: 600; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.link-list a { display: block; padding: 9px 0; border-bottom: 1px solid var(--border); font-weight: 700; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: #1c2233; color: #fff; border: none; padding: 13px 22px; border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.28); z-index: 50; opacity: 0; transition: opacity .25s, transform .25s; font-weight: 700;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes popIn { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#view > * { animation: popIn .22s ease; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .main { padding: 20px; }
  h1 { font-size: 1.4rem; }
}
