/* ===== Assignments feature — uses tokens from styles.css (:root) ===== */

/* ---------- Listing page ---------- */
.asg-hero {
  background: linear-gradient(135deg, #2b1b4d, #4c1d95);
  color: #fff;
  padding: 50px 0 34px;
}
.asg-hero h1 { font-size: 42px; font-weight: 900; letter-spacing: -1.5px; }
.asg-hero .sub { margin-top: 10px; color: #cbb8f0; font-size: 16px; max-width: 640px; line-height: 1.6; }
.asg-statbar { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.asg-pill {
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; color: #efe9fb;
  display: flex; align-items: center; gap: 8px;
}
.asg-pill b { color: #fff; }
.asg-pill.streak { background: rgba(245,158,11,.18); border-color: rgba(245,158,11,.42); }

.asg-wrap { max-width: 1080px; margin: 0 auto; padding: 28px 24px 70px; }
.asg-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.asg-tab {
  padding: 9px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--border-color);
  font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text-dark); transition: var(--transition);
}
.asg-tab:hover { border-color: var(--accent-purple); }
.asg-tab.active { background: var(--primary-purple); color: #fff; border-color: var(--primary-purple); }
.asg-tab.soon { opacity: .55; cursor: default; }
.asg-tab .mini { font-size: 11px; opacity: .8; margin-left: 4px; }

.asg-coursebar { display: flex; align-items: center; gap: 14px; margin: 26px 2px 4px; }
.asg-coursebar h2 { font-size: 14px; font-weight: 800; color: var(--text-gray); text-transform: uppercase; letter-spacing: .6px; }
.asg-prog { flex: 1; max-width: 240px; height: 8px; background: #ece9f5; border-radius: 99px; overflow: hidden; }
.asg-prog > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-purple), var(--accent-purple)); }
.asg-prog-txt { font-size: 13px; color: var(--text-gray); font-weight: 600; }

.asg-section-h { font-size: 18px; font-weight: 800; margin: 26px 0 14px; display: flex; align-items: center; gap: 10px; color: var(--text-dark); }
.asg-section-h .n { background: var(--light-purple); color: var(--primary-purple); font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 6px; }

/* toolbar: search + topic + difficulty */
.asg-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 2px 4px; }
.asg-search-wrap { position: relative; flex: 1; min-width: 220px; }
.asg-search-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .6; }
.asg-search { width: 100%; padding: 11px 14px 11px 36px; border: 1px solid var(--border-color); border-radius: 10px; font-family: inherit; font-size: 14px; color: var(--text-dark); background: #fff; }
.asg-search:focus { outline: none; border-color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(167,139,250,.16); }
.asg-select { padding: 11px 14px; border: 1px solid var(--border-color); border-radius: 10px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text-dark); background: #fff; cursor: pointer; }
.asg-select:focus { outline: none; border-color: var(--accent-purple); }
.asg-diffs { display: flex; gap: 6px; background: #f1eef8; padding: 4px; border-radius: 10px; }
.asg-diff { border: none; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--text-gray); cursor: pointer; }
.asg-diff.active { background: #fff; color: var(--primary-purple); box-shadow: var(--shadow-sm); }

.asg-result-meta { font-size: 13px; color: var(--text-gray); margin: 16px 2px 14px; }
.asg-result-meta b { color: var(--text-dark); }

.asg-topic-chip { display: inline-block; background: var(--light-purple); color: var(--primary-purple); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 6px; margin-bottom: 9px; }

.asg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* pagination */
.asg-pagination { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 30px 0 10px; }
.asg-pg { border: 1px solid var(--border-color); background: #fff; color: var(--text-dark); border-radius: 9px; padding: 9px 14px; font-weight: 600; font-size: 13px; cursor: pointer; transition: var(--transition); }
.asg-pg.num { min-width: 40px; }
.asg-pg:hover:not(:disabled):not(.active) { border-color: var(--accent-purple); }
.asg-pg.active { background: var(--primary-purple); color: #fff; border-color: var(--primary-purple); }
.asg-pg:disabled { opacity: .45; cursor: default; }
.asg-card {
  background: #fff; border: 1px solid var(--border-color); border-radius: 16px; padding: 18px;
  transition: var(--transition); text-decoration: none; color: inherit; display: block;
}
.asg-card:hover { box-shadow: 0 12px 30px rgba(80,40,160,.12); transform: translateY(-2px); border-color: #d8cffb; }
.asg-crow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.asg-badge { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 6px; }
.asg-badge.easy { background: #dcfce7; color: #15803d; }
.asg-badge.medium { background: #fef3c7; color: #b45309; }
.asg-badge.hard { background: #fee2e2; color: #b91c1c; }
.asg-time { font-size: 12px; color: var(--text-gray); font-weight: 600; }
.asg-status { margin-left: auto; font-size: 13px; font-weight: 700; color: #c3c3cf; }
.asg-status.solved { color: var(--success-green); }
.asg-status.inprogress { color: var(--warning-orange); }
.asg-solved-flag { background: #dcfce7; color: #15803d; font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 6px; }
.asg-save-note { margin-top: 12px; font-size: 13px; color: var(--text-gray); text-align: center; padding: 10px; border: 1px dashed var(--border-color); border-radius: 10px; }
.asg-save-note.ok { color: #15803d; border-color: #86efac; background: #f0fdf4; }
.asg-save-note a { color: var(--primary-purple); font-weight: 700; }
.asg-card h3 { font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--text-dark); }
.asg-card p { color: var(--text-gray); font-size: 13.5px; margin-top: 6px; line-height: 1.5; }
.asg-cfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.asg-engage { font-size: 12px; color: var(--text-gray); font-weight: 600; }
.asg-solve { background: var(--light-purple); color: var(--primary-purple); font-weight: 700; font-size: 13px; padding: 8px 16px; border-radius: 9px; }

/* ---------- Solve page ---------- */
.asg-subbar { background: #fff; border-bottom: 1px solid var(--border-color); }
.asg-subbar .inner { max-width: 1180px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 14px; font-size: 13px; flex-wrap: wrap; }
.asg-crumb { color: var(--text-gray); font-weight: 600; }
.asg-crumb b { color: var(--text-dark); }
.asg-subbar .meta { color: var(--text-gray); font-weight: 600; }

.asg-split { max-width: 1280px; margin: 0 auto; display: flex; gap: 0; min-height: calc(100vh - 260px); align-items: stretch; }
.asg-left { width: 52%; padding: 32px 38px; border-right: 1px solid var(--border-color); }
.asg-right { width: 48%; padding: 28px 30px; background: #faf9fd; display: flex; flex-direction: column; }

.asg-ptabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 18px; }
.asg-ptab { padding: 0 0 10px; font-weight: 700; font-size: 14px; color: var(--text-gray); cursor: pointer; background: none; border: none; }
.asg-ptab.active { color: var(--primary-purple); border-bottom: 2px solid var(--primary-purple); }
.asg-left h1 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; margin-bottom: 12px; color: var(--text-dark); line-height: 1.25; }
.asg-prose p { font-size: 14.5px; line-height: 1.65; color: #374151; margin-bottom: 14px; }
.asg-lead { font-size: 16px; line-height: 1.7; color: #374151; margin-bottom: 18px; }
.asg-tagrow { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.asg-chip { background: var(--light-purple); color: var(--primary-purple); font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.asg-goal { background: #f1eefb; border-left: 4px solid var(--primary-purple); border-radius: 8px; padding: 13px 16px; font-size: 14.5px; line-height: 1.6; color: #4c1d95; margin-bottom: 24px; }
.asg-goal b { color: var(--primary-purple); }

/* problem blocks — generous spacing, clear headers */
.asg-block { margin-bottom: 22px; }
.asg-block > h4 { font-size: 13px; font-weight: 800; color: var(--text-dark); margin-bottom: 11px; display: flex; align-items: center; gap: 7px; }
.asg-table { display: flex; flex-direction: column; gap: 2px; background: #f7f6fb; border: 1px solid #ece9f7; border-radius: 9px; padding: 11px 14px; margin-bottom: 9px; }
.asg-table .tn { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-weight: 700; font-size: 13.5px; color: var(--primary-purple); }
.asg-table .tnote { font-size: 12.5px; color: #6b7280; font-style: italic; margin: 1px 0 3px; }
.asg-table .tc { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; color: var(--text-gray); }
.asg-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: step; }
.asg-steps li { position: relative; padding: 4px 0 14px 40px; font-size: 14.5px; line-height: 1.55; color: #374151; counter-increment: step; }
.asg-steps li:before { content: counter(step); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-purple); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.asg-steps li:not(:last-child):after { content: ''; position: absolute; left: 12.5px; top: 30px; bottom: 4px; width: 2px; background: #e7e1f7; }
.asg-block.subtle { background: #f9f8fc; border: 1px solid var(--border-color); border-radius: 10px; padding: 13px 16px; font-size: 14px; color: #4b5563; line-height: 1.6; }
.asg-block.subtle > h4 { color: var(--text-gray); }

.asg-brain { background: linear-gradient(135deg, #fff7ed, #fef3c7); border: 1px solid #fcd9a0; border-radius: 12px; padding: 16px 18px; margin-top: 26px; }
.asg-brain h4 { color: #b45309; font-size: 13.5px; margin-bottom: 7px; }
.asg-brain p { font-size: 13.5px; color: #7c5410; margin: 0; line-height: 1.55; }

/* right-side workspace guide (first-time clarity) */
.asg-guide { display: flex; flex-wrap: wrap; gap: 8px 18px; background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.asg-gstep { font-size: 13px; font-weight: 600; color: #4b5563; display: flex; align-items: center; gap: 8px; }
.asg-gstep .num { width: 22px; height: 22px; border-radius: 50%; background: var(--light-purple); color: var(--primary-purple); font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
code { background: #efeaff; color: #5b21b6; padding: 1px 6px; border-radius: 5px; font-size: 0.9em; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

/* hints */
.asg-hint { border: 1px solid var(--border-color); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.asg-hint .lvl { font-weight: 700; font-size: 13px; color: var(--primary-purple); }
.asg-hint .body { font-size: 13.5px; color: #374151; line-height: 1.55; margin-top: 6px; display: none; }
.asg-hint.open .body { display: block; }
.asg-hint .reveal { font-size: 12.5px; color: var(--text-gray); cursor: pointer; font-weight: 600; }

/* workspace */
.asg-ws-label { font-size: 14px; font-weight: 700; color: var(--text-dark); margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.asg-lang { background: #f1eefb; color: var(--primary-purple); padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; margin-left: auto; }
.asg-editor {
  width: 100%; min-height: 280px; resize: vertical; background: #1e1b2e; color: #e6e1f5;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13.5px; line-height: 1.75;
  padding: 18px; border-radius: 12px; border: 2px solid #2d2747; tab-size: 2;
}
.asg-editor:hover { border-color: #4c3f7a; }
.asg-editor:focus { outline: none; border-color: var(--accent-purple); box-shadow: 0 0 0 4px rgba(167,139,250,.18); }
.asg-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.asg-btn { border: none; border-radius: 10px; padding: 13px 22px; font-weight: 700; font-size: 14px; cursor: pointer; transition: var(--transition); }
.asg-btn.primary { background: var(--primary-purple); color: #fff; padding: 13px 28px; font-size: 15px; box-shadow: 0 6px 18px rgba(124,58,237,.3); }
.asg-btn.primary:hover { background: var(--primary-purple-dark); transform: translateY(-1px); }
.asg-btn.primary:disabled { opacity: .6; cursor: default; }
.asg-btn.ghost { background: #f3f0fd; color: var(--primary-purple); }
.asg-btn.outline { background: #fff; border: 1px solid var(--border-color); color: var(--text-gray); }

/* reference answer (free reveal) */
.asg-solution { margin-top: 18px; background: #1e1b2e; border: 1px solid #2d2747; border-radius: 12px; padding: 16px 18px; }
.asg-sol-head { color: #e6e1f5; font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }
.asg-sol-code { color: #d7f5e3; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; line-height: 1.7; white-space: pre-wrap; margin: 0; }
.asg-sol-note { color: #9a93b5; font-size: 12px; margin-top: 12px; font-style: italic; }

/* review feedback */
.asg-feedback { margin-top: 20px; }
.asg-fb-empty { color: var(--text-light); font-size: 13.5px; text-align: center; padding: 22px; border: 1px dashed var(--border-color); border-radius: 12px; }
.asg-fb-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.asg-score { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.asg-score > div { width: 50px; height: 50px; border-radius: 50%; background: #faf9fd; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.asg-score .n { font-size: 18px; font-weight: 800; color: var(--text-dark); }
.asg-score .t { font-size: 9px; color: var(--text-gray); letter-spacing: .5px; }
.asg-fb-head h3 { font-size: 16px; font-weight: 800; color: var(--text-dark); }
.asg-fb-head .ai { font-size: 12px; color: var(--primary-purple); font-weight: 700; }
.asg-fb-block { background: #fff; border: 1px solid var(--border-color); border-radius: 11px; padding: 13px 15px; margin-bottom: 11px; }
.asg-fb-block .h { font-weight: 700; font-size: 13.5px; margin-bottom: 7px; }
.asg-fb-block ul { list-style: none; }
.asg-fb-block li { font-size: 13px; color: #374151; line-height: 1.55; margin: 4px 0; padding-left: 20px; position: relative; }
.asg-fb-block.good .h { color: #15803d; }
.asg-fb-block.good li:before { content: '✓'; color: #15803d; position: absolute; left: 0; }
.asg-fb-block.fix .h { color: #b45309; }
.asg-fb-block.fix li:before { content: '→'; color: #b45309; position: absolute; left: 0; }
.asg-coach { background: #f1eefb; border: 1px solid #ddd2fb; border-radius: 11px; padding: 13px 15px; font-size: 13.5px; color: #4c1d95; line-height: 1.6; }
.asg-coach b { color: var(--primary-purple); }
.asg-passed-banner { background: #dcfce7; border: 1px solid #86efac; color: #15803d; font-weight: 700; padding: 11px 15px; border-radius: 11px; margin-bottom: 12px; font-size: 14px; }

@media (max-width: 900px) {
  .asg-split { flex-direction: column; }
  .asg-left, .asg-right { width: 100%; border-right: none; }
  .asg-left { border-bottom: 1px solid var(--border-color); }
}
