* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0c0f12;
  --bg-light: rgba(18, 23, 30, 0.95);
  --bg-lighter: rgba(28, 36, 46, 0.95);
  --text: #edf1f5;
  --text-dim: #9aa5b1;
  --accent: #e3b35a;
  --accent-strong: #f0c16e;
  --accent-dim: rgba(227, 179, 90, 0.18);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --font-ar: 'Noto Naskh Arabic', 'Amiri', 'Traditional Arabic', serif;
  --font-ui: 'Inter', system-ui, sans-serif;
}

body {
  font-family: var(--font-ui);
  background: radial-gradient(circle at 10% 20%, rgba(227, 179, 90, 0.16), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(79, 209, 197, 0.15), transparent 40%),
    linear-gradient(180deg, #0c0f12 0%, #0c1117 55%, #0b0f12 100%);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

.app {
  display: flex;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, rgba(19, 26, 33, 0.96), rgba(15, 20, 26, 0.92));
  border-right: 1px solid var(--border);
  padding: 16px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.logo {
  padding: 0 16px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.logo-ar {
  display: block;
  font-family: var(--font-ar);
  font-size: 28px;
  color: var(--accent-strong);
}

.logo-tr {
  font-size: 12px;
  color: var(--text-dim);
}

.nav-section {
  margin: 0 10px 10px;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--border);
}

.nav-section:last-child {
  border-bottom: none;
}

.nav-title {
  padding: 10px 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
}

.nav-title::after {
  content: "+";
  font-size: 14px;
  color: var(--text-dim);
  transition: transform 0.2s ease, color 0.2s ease;
}

.nav-section[open] > .nav-title::after {
  content: "-";
  color: var(--text);
}

.nav-title::-webkit-details-marker {
  display: none;
}

.nav-btn {
  display: block;
  width: 100%;
  padding: 9px 12px;
  margin: 6px 6px;
  background: rgba(255, 255, 255, 0.02);
  border: none;
  text-align: left;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 10px;
}

.nav-btn:hover {
  background: var(--bg-lighter);
  color: var(--accent);
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(227, 179, 90, 0.28), rgba(227, 179, 90, 0.1));
  color: var(--accent-strong);
  border: 1px solid rgba(227, 179, 90, 0.4);
}

/* Main */
.main {
  flex: 1;
  margin-left: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 23, 30, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 500;
}

.page-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.topbar-link {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 600;
}

.selector {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  min-width: 200px;
  cursor: pointer;
}

.selector:focus {
  outline: none;
  border-color: var(--accent);
}

.hidden {
  display: none !important;
}

/* Content */
.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.placeholder .ar {
  font-family: var(--font-ar);
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 500;
}

/* Arabic Text */
.ar {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
}

/* Cards Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.card:hover {
  border-color: var(--accent);
  background: var(--bg-lighter);
}

.card-title {
  font-family: var(--font-ar);
  font-size: 30px;
  color: var(--accent);
  margin-bottom: 6px;
  direction: rtl;
  text-align: right;
  font-weight: 600;
}

.card-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.card-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.card-row:first-of-type {
  border-top: none;
}

.card-label {
  color: var(--text-dim);
}

.card-value {
  font-family: var(--font-ar);
  font-size: 22px;
  direction: rtl;
  font-weight: 500;
}

.card-value.tr {
  font-family: var(--font-ui);
  direction: ltr;
}

/* Expanded Card */
.card.expanded {
  border-color: var(--accent);
}

.card-details {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card.expanded .card-details {
  display: block;
}

/* List */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.list-item:hover {
  border-color: var(--accent);
}

.list-ar {
  font-family: var(--font-ar);
  font-size: 26px;
  color: var(--accent);
  direction: rtl;
  font-weight: 500;
  line-height: 1.6;
}

.list-tr {
  font-size: 13px;
  color: var(--text-dim);
}

/* Detail Panel */
.detail {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.detail-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.detail-title {
  font-family: var(--font-ar);
  font-size: 40px;
  color: var(--accent);
  font-weight: 600;
}

.detail-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 4px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.detail-item {
  background: var(--bg);
  padding: 12px;
  border-radius: 6px;
  text-align: center;
}

.detail-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.detail-value {
  font-family: var(--font-ar);
  font-size: 26px;
  color: var(--text);
  direction: rtl;
  font-weight: 500;
}

/* Conjugation Table */
.conj-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.conj-table th,
.conj-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.conj-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}

.conj-table td.ar {
  font-family: var(--font-ar);
  font-size: 24px;
  color: var(--text);
  font-weight: 500;
}

/* Section */
.section {
  margin-bottom: 32px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Search */
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-btn {
  padding: 10px 20px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #000;
  font-weight: 500;
  cursor: pointer;
}

.search-btn:hover {
  opacity: 0.9;
}

/* Intro Sections */
.intro-section {
  margin-bottom: 32px;
}

.intro-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.intro-title .ar {
  font-family: var(--font-ar);
  font-size: 26px;
  color: var(--accent);
  font-weight: 500;
}

.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 8px;
}

.letter-box {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 8px;
  text-align: center;
}

.letter-ar {
  font-family: var(--font-ar);
  font-size: 36px;
  color: var(--accent);
  font-weight: 600;
}

.letter-name {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.tab {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
}

.tab:hover {
  color: var(--text);
  background: var(--bg-lighter);
}

.tab.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* Note */
.note {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  margin: 16px 0;
}

/* Quiz Styles */
.quiz-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.quiz-category {
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-category:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.quiz-category-ar {
  font-family: var(--font-ar);
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 600;
}

.quiz-category-title {
  font-size: 14px;
  color: var(--text);
}

.quiz-category-count {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.quiz-progress {
  font-size: 13px;
  color: var(--text-dim);
}

.quiz-score {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.quiz-question {
  background: var(--bg-lighter);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

.quiz-question-ar {
  font-family: var(--font-ar);
  font-size: 34px;
  color: var(--accent);
  text-align: center;
  margin-bottom: 14px;
  font-weight: 600;
}

.quiz-question-text {
  font-size: 15px;
  text-align: center;
  color: var(--text);
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.quiz-option.correct {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.quiz-option.wrong {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.quiz-option:disabled {
  cursor: default;
  opacity: 0.7;
}

.quiz-feedback {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  text-align: center;
}

.quiz-feedback.correct {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.quiz-feedback.wrong {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
}

.quiz-next-btn {
  margin-top: 20px;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-next-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.quiz-results {
  text-align: center;
  padding: 40px 20px;
}

.quiz-results h2 {
  font-size: 28px;
  margin-bottom: 10px;
}

.quiz-results .score-big {
  font-size: 48px;
  color: var(--accent);
  font-weight: 700;
  margin: 20px 0;
}

.quiz-results .score-text {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 30px;
}

.quiz-restart-btn {
  padding: 14px 32px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-restart-btn:hover {
  opacity: 0.9;
}

/* Roots 50 Styles */
.roots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.root-card {
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
}

.root-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.root-number {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.root-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.root-arabic {
  font-family: var(--font-ar);
  font-size: 34px;
  color: var(--accent);
  letter-spacing: 6px;
  font-weight: 600;
}

.root-trans {
  font-size: 13px;
  color: var(--text-dim);
}

.root-meaning {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 500;
}

.root-freq {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.root-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.root-ex {
  font-family: var(--font-ar);
  font-size: 18px;
  background: var(--bg-light);
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text);
  font-weight: 500;
}

.roots-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.roots-file-tag {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--accent);
}

/* Phrases Styles */
.phrases-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phrase-card {
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
}

.phrase-card.small {
  padding: 10px 14px;
}

.phrase-ar {
  font-family: var(--font-ar);
  font-size: 26px;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 500;
}

.phrase-card.small .phrase-ar {
  font-size: 22px;
}

.phrase-tr {
  font-size: 14px;
  color: var(--text);
}

.phrase-response {
  font-family: var(--font-ar);
  font-size: 20px;
  color: var(--text);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-weight: 500;
}

.phrase-context {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  padding: 4px 8px;
  background: var(--bg-light);
  border-radius: 4px;
  display: inline-block;
}

.situation-box {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.situation-title {
  font-family: var(--font-ar);
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

/* Stories Styles */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.story-card {
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.story-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.story-number {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.story-card .story-title-ar {
  font-family: var(--font-ar);
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 600;
}

.story-card .story-title-tr {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 10px;
}

.story-info {
  font-size: 12px;
  color: var(--text-dim);
}

/* Single Story View */
.story-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.story-main-title .story-title-ar {
  font-family: var(--font-ar);
  font-size: 36px;
  color: var(--accent);
  font-weight: 700;
}

.story-main-title .story-title-tr {
  font-size: 16px;
  color: var(--text-dim);
  margin-top: 4px;
}

.story-content {
  margin-bottom: 32px;
}

.story-paragraph {
  background: var(--bg-lighter);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
}

.paragraph-ar {
  font-family: var(--font-ar);
  font-size: 26px;
  line-height: 2.1;
  color: var(--text);
  margin-bottom: 14px;
  font-weight: 500;
}

.paragraph-tr {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.story-moral {
  background: linear-gradient(135deg, var(--accent-dim), transparent);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  text-align: center;
}

.moral-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.moral-ar {
  font-family: var(--font-ar);
  font-size: 30px;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 600;
}

.moral-tr {
  font-size: 14px;
  color: var(--text);
}

.moral-grammar {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

/* Story Tabs */
.story-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.story-tab {
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.story-tab:hover {
  border-color: var(--accent);
}

.story-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.story-tab-content {
  display: none;
}

.story-tab-content.active {
  display: block;
}

/* Paragraph Number */
.story-paragraph {
  position: relative;
  padding-left: 40px;
}

.paragraph-num {
  position: absolute;
  left: 0;
  top: 20px;
  width: 28px;
  height: 28px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

/* Grammar Section */
.grammar-section {
  background: var(--bg-lighter);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  border-left: 4px solid var(--accent);
}

.grammar-title {
  font-family: var(--font-ar);
  font-size: 24px;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}

.grammar-explanation {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.6;
}

.grammar-examples {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grammar-example {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 14px;
}

.example-ar {
  font-family: var(--font-ar);
  font-size: 26px;
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 500;
  line-height: 1.8;
}

.example-analysis {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 6px;
  line-height: 1.5;
  padding: 8px;
  background: var(--accent-dim);
  border-radius: 6px;
}

.example-tr {
  font-size: 13px;
  color: var(--text-dim);
}

/* Detailed Vocabulary */
.vocab-detailed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.vocab-detailed-item {
  background: var(--bg-lighter);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
}

.vocab-word-ar {
  font-family: var(--font-ar);
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.vocab-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vocab-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vocab-label {
  font-size: 12px;
  color: var(--text-dim);
  min-width: 60px;
}

.vocab-value {
  font-size: 13px;
  color: var(--text);
}

.vocab-value.ar-text {
  font-family: var(--font-ar);
  font-size: 20px;
  font-weight: 500;
}

.story-vocab {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 20px;
}

.story-vocab .section-title {
  margin-bottom: 16px;
}

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.vocab-item {
  background: var(--bg-lighter);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vocab-ar {
  font-family: var(--font-ar);
  font-size: 16px;
  color: var(--accent);
}

.vocab-tr {
  font-size: 13px;
  color: var(--text);
}

/* Quiz Container & Progress */
.quiz-container {
  max-width: 600px;
  margin: 0 auto;
}

.quiz-header {
  margin-bottom: 24px;
}

.quiz-progress-bar {
  height: 6px;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.quiz-info {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.quiz-question {
  background: var(--bg-lighter);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 24px;
  text-align: center;
}

.quiz-q-text {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 12px;
}

.quiz-q-ar {
  font-family: var(--font-ar);
  font-size: 28px;
  color: var(--accent);
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.quiz-option:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.quiz-option-letter {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.quiz-option-text {
  font-size: 15px;
  color: var(--text);
}

.quiz-option.correct {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
}

.quiz-option.correct .quiz-option-letter {
  background: #4ade80;
  color: #000;
}

.quiz-option.wrong {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

.quiz-option.wrong .quiz-option-letter {
  background: #f87171;
  color: #000;
}

/* Quiz Result */
.quiz-result {
  text-align: center;
  padding: 50px 30px;
  max-width: 400px;
  margin: 0 auto;
}

.quiz-result-emoji {
  font-size: 64px;
  margin-bottom: 16px;
}

.quiz-result-score {
  font-size: 42px;
  font-weight: 700;
  color: var(--accent);
}

.quiz-result-percent {
  font-size: 24px;
  color: var(--text-dim);
  margin: 8px 0;
}

.quiz-result-message {
  font-size: 18px;
  color: var(--text);
  margin: 16px 0;
}

.quiz-result-category {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.quiz-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.quiz-btn {
  padding: 12px 28px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-btn:hover {
  opacity: 0.9;
}

.quiz-btn.secondary {
  background: var(--bg-lighter);
  color: var(--text);
  border: 1px solid var(--border);
}

.quiz-btn.secondary:hover {
  border-color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .main {
    margin-left: 0;
  }
  
  .app {
    flex-direction: column;
  }
  
  .nav-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 12px;
    margin-bottom: 12px;
  }
  
  .nav-label {
    width: 100%;
    margin-bottom: 4px;
  }
  
  .nav-btn {
    width: auto;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
  }
  
  .nav-btn.active {
    border-left: none;
    border-radius: 4px;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
}
