/* apl-uni demo — Schüler:innen role-specific styles. Linked after shared/base.css. */

/* ---------- chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.active { border-color: var(--accent); color: var(--accent); background: var(--soft-accent); }
.chip.removable { cursor: default; padding-right: 8px; }
.chip.removable button {
  border: none;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 2px;
  margin-left: 2px;
  border-radius: 999px;
}
.chip.removable button:hover { background: rgba(0, 0, 0, 0.15); }

/* ---------- Lerncoach: start panel + reviews ---------- */
.lerncoach-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; margin-bottom: 18px; }
.tutor-start-actions { display: flex; justify-content: flex-end; margin-top: 6px; }

.review-item { display: flex; flex-direction: column; gap: 8px; }
.review-item:not(:last-child) { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.review-topic { font-weight: 700; color: var(--ink); }
.review-due { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.review-item .btn { align-self: flex-start; }

/* ---------- Lerncoach: sessions list ---------- */
.session-list { display: flex; flex-direction: column; gap: 4px; }
.session-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease;
}
.session-row:hover { background: var(--surface-hi); }
.session-row-icon { color: var(--accent); display: flex; flex-shrink: 0; }
.session-row-main { display: flex; flex-direction: column; flex: 1; gap: 2px; min-width: 0; }
.session-row-topic { font-weight: 700; }
.session-row-date { font-size: 12px; color: var(--muted); }

/* ---------- Lerncoach: session / chat ---------- */
.session-layout { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.session-chat-panel { display: flex; flex-direction: column; height: calc(100vh - 260px); min-height: 420px; padding: 0; overflow: hidden; }
.session-aside { display: flex; flex-direction: column; gap: 18px; }

.chat { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.chat-msg { display: flex; align-items: flex-start; gap: 10px; max-width: 100%; }
.chat-msg.student { flex-direction: row-reverse; }
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-avatar.tutor { background: var(--soft-accent); color: var(--accent); }

.chat-bubble {
  max-width: min(520px, 78%);
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.5;
}
.chat-msg.tutor .chat-bubble { background: var(--surface); border-color: var(--line); }
.chat-msg.student .chat-bubble { background: var(--soft-accent); border-color: var(--line); color: var(--ink); }

.chat-typing { display: flex; align-items: center; gap: 4px; padding: 14px; }
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--faint);
  animation: chat-typing-bounce 1.1s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-quiz { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.quiz-question { font-weight: 700; margin-bottom: 8px; }
.quiz-options { display: flex; flex-direction: column; gap: 6px; }
.quiz-option {
  text-align: left;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-low);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: var(--soft-accent); }
.quiz-option:disabled { cursor: default; }
.quiz-option.correct { border-color: var(--success-line); background: var(--success-bg); color: var(--success-fg); }
.quiz-option.wrong { border-color: var(--danger-line); background: var(--danger-bg); color: var(--danger-fg); }
.quiz-feedback { margin-top: 8px; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.quiz-feedback.correct { color: var(--success-fg); }
.quiz-feedback.wrong { color: var(--danger-fg); }

.composer {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-low);
  flex-shrink: 0;
}
.composer .input { flex: 1; }
.composer .btn { flex-shrink: 0; }

.session-finished-note {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-low);
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
}
.session-finished-note a { color: var(--accent); font-weight: 700; text-decoration: none; }
.session-finished-note a:hover { text-decoration: underline; }

.mastery-row { margin-bottom: 14px; }
.mastery-row:last-child { margin-bottom: 0; }
.mastery-label { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

/* ---------- Aufgaben ---------- */
.assignment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.assignment-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface-hi), var(--surface));
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.assignment-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.assignment-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.assignment-card-title { margin: 0; font-size: 16px; }
.assignment-card-meta { font-size: 12px; color: var(--muted); }
.assignment-card-due { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: auto; }
.assignment-card-due.overdue { color: var(--danger); font-weight: 700; }

.assignment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.assignment-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 6px 0 18px; flex-wrap: wrap; }

.item-result {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  font-weight: 700;
}
.item-result.correct .item-result-icon { color: var(--success-fg); }
.item-result.wrong .item-result-icon { color: var(--danger-fg); }
.item-result.pending { color: var(--muted); font-weight: 400; }
.item-result-icon { display: inline-flex; }
.item-feedback { font-size: 12px; font-weight: 400; color: var(--muted); flex-basis: 100%; }

.item-solution { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-soft); }
.item-solution-label { font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.item-solution .item { border: none; padding: 0; background: transparent; }

.teacher-comment {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-low);
  border: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--ink);
}

/* ---------- Stundenplan ---------- */
.timetable-day.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.timetable-day.today .timetable-day-head { color: var(--accent); }

/* ---------- Profil ---------- */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-low); }
.segmented-btn {
  padding: 7px 12px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.segmented-btn:hover { color: var(--ink); }
.segmented-btn.active { background: var(--soft-accent); color: var(--accent); }

.interest-add { display: flex; gap: 10px; margin-top: 12px; }
.interest-add .input { flex: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .session-layout { grid-template-columns: 1fr; }
  .session-chat-panel { height: 62vh; }
}

@media (max-width: 760px) {
  .lerncoach-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .chat-bubble { max-width: 86%; }
  .assignment-grid { grid-template-columns: 1fr; }
  .assignment-actions { justify-content: stretch; }
  .assignment-actions .btn { flex: 1; }
  .interest-add { flex-direction: column; }
  .composer { padding: 10px 12px; }
  .composer .btn span { display: none; }
}
