/* LearnX AI Quiz Hub — extracted from supplied page */
* { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --accent: #6366f1;
    --accent-dark: #4f46e5;
    --bg: #f6f7fb;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --muted: #6b7280;
  }
  body { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; background: var(--bg); color: var(--text); height: 100vh; display: flex; overflow: hidden; }
  a { text-decoration: none; color: inherit; }
  button { font-family: inherit; }

  /* ================= SIDEBAR (shared shell) ================= */
  #sidebar { width: 220px; background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 14px; flex-shrink: 0; overflow-y: auto; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 20px; }
  .brand .logo { width: 36px; height: 36px; background: var(--accent); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-size: 18px; }
  .brand h1 { font-size: 15px; }
  .brand .sub { font-size: 10.5px; color: var(--muted); }
  .nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; color: #374151; cursor: pointer; margin-bottom: 2px; }
  .nav-item:hover { background: #f3f4f6; }
  .nav-item.active { background: var(--accent); color: white; font-weight: 600; }
  .nav-item .ic { font-size: 15px; width: 18px; text-align: center; }
  .nav-section-title { font-size: 11px; color: var(--muted); text-transform: uppercase; margin: 16px 6px 6px; letter-spacing: 0.4px; }
  .sidebar-user { display: flex; align-items: center; gap: 8px; padding: 10px 6px 0; margin-top: auto; border-top: 1px solid var(--border); padding-top: 14px; font-size: 12.5px; }
  .sidebar-user .av { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
  .sidebar-user .name { font-weight: 600; }
  .sidebar-user .plan { color: var(--muted); font-size: 11px; }

  /* ================= MAIN ================= */
  #main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
  #topbar { display: flex; align-items: center; gap: 16px; padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  #topbar h1 { font-size: 18px; font-weight: 800; white-space: nowrap; }
  .search-wrap { flex: 1; display: flex; align-items: center; gap: 8px; background: #f9fafb; border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; max-width: 480px; margin-left: auto; }
  .search-wrap input { flex: 1; border: none; background: transparent; outline: none; font-size: 13.5px; color: var(--text); }

  #contentArea { flex: 1; padding: 22px 26px 40px; overflow-y: auto; }
  .section { margin-bottom: 30px; }
  .section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .section-head h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
  .section-head .count-pill { font-size: 11px; background: #f3f4f6; color: var(--muted); padding: 3px 9px; border-radius: 20px; font-weight: 600; }
  .see-all { font-size: 12.5px; color: var(--accent); font-weight: 600; cursor: pointer; }

  /* ============ Featured Quiz ============ */
  .featured-card {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    background: linear-gradient(120deg, #6366f1, #8b5cf6 65%, #a855f7);
    border-radius: 20px; padding: 30px 34px; color: #fff; position: relative; overflow: hidden;
  }
  .featured-card::before { content: ''; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,0.08); }
  .featured-card::after { content: ''; position: absolute; right: 60px; bottom: -70px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,0.06); }
  .featured-left { position: relative; z-index: 1; }
  .featured-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.18); padding: 5px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 700; margin-bottom: 12px; }
  .featured-card h3 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
  .featured-meta { display: flex; gap: 14px; font-size: 12.5px; opacity: 0.92; margin-bottom: 20px; }
  .featured-meta span { display: flex; align-items: center; gap: 5px; }
  .featured-start-btn { background: #fff; color: var(--accent-dark); border: none; padding: 12px 26px; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; }
  .featured-start-btn:hover { background: #f3f4ff; }
  .featured-emoji { font-size: 92px; position: relative; z-index: 1; filter: drop-shadow(0 10px 18px rgba(0,0,0,0.15)); }

  /* ============ Quiz Grid ============ */
  .quiz-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .quiz-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
    display: flex; flex-direction: column; gap: 10px; position: relative; transition: box-shadow .15s, transform .15s;
  }
  .quiz-card:hover { box-shadow: 0 8px 22px rgba(0,0,0,0.07); transform: translateY(-2px); }
  .quiz-thumb { width: 100%; height: 84px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 34px; }
  .quiz-card-name { font-size: 14px; font-weight: 700; }
  .quiz-card-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
  .diff-pill { font-size: 10.5px; padding: 3px 9px; border-radius: 20px; font-weight: 700; }
  .diff-easy { background: #e6f9f2; color: #10b981; }
  .diff-medium { background: #fef3c7; color: #d97706; }
  .diff-hard { background: #fee2e2; color: #dc2626; }
  .quiz-start-btn { margin-top: 2px; background: #eef0fd; color: var(--accent-dark); border: none; padding: 8px; border-radius: 9px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
  .quiz-start-btn:hover { background: var(--accent); color: #fff; }
  .card-more-wrap { position: absolute; top: 10px; right: 10px; }
  .card-more-btn { width: 24px; height: 24px; border-radius: 6px; border: none; background: rgba(255,255,255,0.85); color: var(--muted); font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .card-more-btn:hover { background: #fff; color: var(--text); }
  .more-menu { display: none; position: absolute; top: 28px; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); min-width: 160px; padding: 6px; z-index: 40; }
  .more-menu.open { display: block; }
  .more-menu-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; color: var(--text); cursor: pointer; }
  .more-menu-item:hover { background: #f3f4f6; }
  .more-menu-item.danger { color: #dc2626; }

  /* ============ Recent Quizzes ============ */
  .recent-list { display: flex; flex-direction: column; gap: 8px; }
  .recent-row { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 13px; padding: 12px 16px; }
  .recent-thumb { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
  .recent-info { flex: 1; min-width: 0; }
  .recent-info .r-name { font-size: 13.5px; font-weight: 700; }
  .recent-info .r-meta { font-size: 11.5px; color: var(--muted); }
  .recent-score { font-size: 13px; font-weight: 800; padding: 5px 12px; border-radius: 20px; flex-shrink: 0; }
  .score-good { background: #e6f9f2; color: #10b981; }
  .score-mid { background: #fef3c7; color: #d97706; }
  .recent-retry { border: 1px solid var(--border); background: var(--card); padding: 7px 12px; border-radius: 9px; font-size: 12px; cursor: pointer; color: var(--text); }
  .recent-retry:hover { border-color: var(--accent); color: var(--accent-dark); }

  /* ============ Leaderboard ============ */
  .leaderboard-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 8px 6px; }
  .lb-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px; }
  .lb-row:hover { background: #f9fafb; }
  .lb-rank { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: #f3f4f6; color: var(--muted); flex-shrink: 0; }
  .lb-rank.gold { background: #fef3c7; color: #d97706; }
  .lb-rank.silver { background: #e5e7eb; color: #4b5563; }
  .lb-rank.bronze { background: #fde3cf; color: #c2610a; }
  .lb-av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
  .lb-name { flex: 1; font-size: 13px; font-weight: 600; }
  .lb-xp { font-size: 12.5px; font-weight: 700; color: var(--accent-dark); }

  /* ============ Quiz Experience Modal ============ */
  #quizOverlay { display: none; position: fixed; inset: 0; background: rgba(15,15,25,0.45); z-index: 90; align-items: center; justify-content: center; padding: 20px; }
  #quizOverlay.open { display: flex; }
  #quizModal { background: var(--card); border-radius: 20px; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; padding: 26px 28px; position: relative; }
  .quiz-modal-close { position: absolute; top: 16px; right: 18px; cursor: pointer; color: var(--muted); font-size: 16px; }

  .progress-bar-wrap { height: 7px; background: #f0f1f7; border-radius: 20px; overflow: hidden; margin-bottom: 18px; }
  .progress-bar-fill { height: 100%; background: linear-gradient(90deg,#6366f1,#8b5cf6); border-radius: 20px; transition: width .3s; }
  .q-progress-label { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }

  .question-title { font-size: 18px; font-weight: 700; line-height: 1.5; margin-bottom: 18px; }
  .q-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
  .q-opt { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--border); border-radius: 12px; padding: 13px 15px; font-size: 13.5px; cursor: pointer; transition: all .12s; }
  .q-opt:hover { border-color: var(--accent); }
  .q-opt .opt-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #d1d5db; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; }
  .q-opt.correct { background: #e6f9f2; border-color: #10b981; color: #059669; font-weight: 600; }
  .q-opt.correct .opt-dot { background: #10b981; border-color: #10b981; }
  .q-opt.wrong { background: #fee2e2; border-color: #ef4444; color: #b91c1c; font-weight: 600; }
  .q-opt.wrong .opt-dot { background: #ef4444; border-color: #ef4444; }
  .q-opt.locked { pointer-events: none; }

  .explanation-box { background: #f9fafb; border: 1px dashed var(--border); border-radius: 12px; padding: 12px 14px; font-size: 12.5px; color: #374151; line-height: 1.6; margin-bottom: 18px; display: none; }
  .explanation-box.show { display: block; }
  .explanation-box b { color: var(--accent-dark); }

  .next-btn { width: 100%; background: var(--accent); color: #fff; border: none; padding: 13px; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; }
  .next-btn:disabled { background: #d1d5db; cursor: not-allowed; }
  .next-btn:hover:not(:disabled) { background: var(--accent-dark); }

  /* Results screen */
  .result-wrap { text-align: center; padding: 10px 0; }
  .result-emoji { font-size: 52px; margin-bottom: 10px; }
  .result-score { font-size: 34px; font-weight: 800; color: var(--accent-dark); margin-bottom: 4px; }
  .result-sub { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
  .result-stats { display: flex; gap: 12px; margin-bottom: 22px; }
  .result-stat { flex: 1; background: #f9fafb; border-radius: 12px; padding: 14px; }
  .result-stat .rs-num { font-size: 20px; font-weight: 800; }
  .result-stat.correct .rs-num { color: #10b981; }
  .result-stat.wrong .rs-num { color: #ef4444; }
  .result-stat .rs-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .result-actions { display: flex; gap: 10px; }
  .result-actions button { flex: 1; padding: 12px; border-radius: 12px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
  .btn-retry { background: #eef0fd; color: var(--accent-dark); border: none; }
  .btn-retry:hover { background: #e0e2fb; }
  .btn-learn { background: var(--accent); color: #fff; border: none; }
  .btn-learn:hover { background: var(--accent-dark); }

  ::-webkit-scrollbar { width: 7px; height: 7px; }
  ::-webkit-scrollbar-thumb { background: #d8dae5; border-radius: 8px; }

  @media (max-width: 1100px) { .quiz-grid { grid-template-columns: repeat(2,1fr); } }
  @media (max-width: 700px) { #sidebar { display: none; } .featured-card { flex-direction: column; text-align: center; } }
