.app-ui {
  --app-bg: #1a1a1a;
  --app-text: #ffffff;
  --app-card-bg: #1a1a1a;
  --app-border: #333333;
  --app-muted: #888888;
  --app-primary: #ffffff;
  --app-accent: #ffb800;
  --app-correct: #dcfce7;
  --app-correct-text: #166534;
  --app-wrong: #1a1a1a;
  --app-wrong-text: #ef4444;

  width: 100%;
  height: 100%;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: 'Inter', -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.5s ease;
  overflow: hidden;
  box-sizing: border-box;
}

body.light-mode .app-ui {
  --app-bg: #f8f9fa;
  --app-text: #111827;
  --app-card-bg: #ffffff;
  --app-border: #e5e7eb;
  --app-muted: #6b7280;
  --app-primary: #111827;
  --app-accent: #000000;
  --app-correct: #dcfce7;
  --app-wrong: #fee2e2;
}

.app-ui * {
  box-sizing: border-box;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--app-border);
}
.app-logo {
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 12px;
}
.app-icon {
  font-size: 14px;
  color: var(--app-muted);
}

/* Nav Bottom */
.app-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  border-top: 1px solid var(--app-border);
  background: var(--app-bg);
  padding: 10px 0;
  z-index: 10;
}
.nav-item {
  flex: 1;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--app-muted);
  letter-spacing: 1px;
}
.nav-item.active {
  color: var(--app-primary);
}

/* Scroll Area */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  padding-bottom: 60px; /* space for nav */
}

/* Progress */
.app-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  color: var(--app-muted);
  letter-spacing: 1px;
  margin-bottom: 5px;
}
.app-progress-track {
  height: 2px;
  background: var(--app-border);
  width: 100%;
  margin-bottom: 15px;
}
.app-progress-fill {
  height: 100%;
  width: 7%;
  background: var(--app-primary);
}

/* Card */
.app-card {
  border: 1px solid var(--app-border);
  background: var(--app-card-bg);
  padding: 15px;
}
.app-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--app-muted);
  border-bottom: 1px solid var(--app-border);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.app-card-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 15px;
  letter-spacing: -0.5px;
}
.app-card-img {
  width: 100%;
  height: 140px;
  background-color: #000;
  margin-bottom: 15px;
  /* Use filter for light mode image tinting if needed */
}
.app-card-body {
  font-size: 11px;
  line-height: 1.6;
  color: var(--app-muted);
  margin-bottom: 15px;
}
.dropcap {
  float: left;
  font-size: 32px;
  font-weight: 800;
  line-height: 26px;
  margin-right: 5px;
  color: var(--app-primary);
}
.app-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  color: var(--app-primary);
  border-top: 1px solid var(--app-border);
  padding-top: 10px;
}

/* Detail specific */
.app-detail-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 15px;
}
.app-detail-meta {
  text-align: center;
  font-size: 9px;
  font-style: italic;
  color: var(--app-muted);
  margin: 15px 0;
  border-bottom: 1px solid var(--app-border);
  padding-bottom: 15px;
}

/* Quiz specific */
.app-quiz-badge {
  display: inline-block;
  border: 1px solid var(--app-border);
  padding: 4px 8px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 15px;
}
.app-quiz-question {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
}
.app-quiz-option {
  border: 1px solid var(--app-border);
  padding: 12px;
  margin-bottom: 10px;
  font-size: 11px;
  display: flex;
  align-items: center;
  font-weight: 500;
}
.app-quiz-option span.letter {
  font-weight: 800;
  margin-right: 15px;
  font-size: 10px;
}
.app-quiz-option.correct {
  background: var(--app-correct);
  color: var(--app-correct-text);
  border-color: var(--app-correct);
}
.app-quiz-option.wrong {
  border-color: var(--app-wrong-text);
}
.app-quiz-option .chk {
  margin-left: auto;
  font-weight: 800;
}
.app-quiz-option.wrong .chk {
  color: var(--app-wrong-text);
}
.app-quiz-next {
  background: var(--app-primary);
  color: var(--app-bg);
  padding: 12px;
  text-align: center;
  font-weight: 800;
  font-size: 10px;
  margin-top: 10px;
  margin-bottom: 20px;
}
.app-quiz-note {
  border: 1px solid var(--app-accent);
  padding: 15px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--app-muted);
}
.app-quiz-note strong {
  color: var(--app-accent);
  font-size: 9px;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 5px;
}
