/*
 * Kursinformasjon → Evaluering, the notes from the last run, and the
 * reflection after a session (js/components/CourseEvaluation.js,
 * Øktdetaljer in index.html). Since 1.35.0.
 */

/* --- The Evaluering tab ------------------------------------------------------- */

/* How many of last run's notes are left, on the tab itself (since 1.38.2) */
.ce-tab-count {
  margin-left: 0.25rem;
  background: #111;
  color: #fff;
  font-size: 0.7rem;
  vertical-align: 0.1em;
}

.ce-tab-count[hidden] {
  display: none;
}

.ce-section + .ce-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
}

.ce-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 0.25rem;
}

.ce-empty {
  color: #444;
}

.ce-rows {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

/* Each evaluation is a small card: when and how, then who and the follow-up */
.ce-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.35rem 0.5rem;
  align-items: end;
  border: 1px solid #ccc;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.5rem;
}

.ce-field {
  display: block;
  margin: 0;
  min-width: 0;
}

.ce-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 0.1rem;
}

.ce-field-who {
  grid-column: 1;
}

.ce-field-followUp {
  grid-column: 2 / span 2;
}

.ce-cards {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ce-cards .ce-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.ce-cards .ce-open {
  font-weight: 600;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
}

/* On a phone the fields are under each other */
@media (max-width: 575.98px) {
  .ce-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ce-field {
    grid-column: 1;
  }

  .ce-row .ce-remove {
    grid-column: 2;
    grid-row: 1;
  }
}

/* --- The notes from the last run ---------------------------------------------- */

.last-run-notes {
  border: 2px solid #111;
  background: #fffbe6;
  padding: 0.6rem 0.75rem;
}

.last-run-notes[hidden] {
  display: none;
}

.last-run-notes .lr-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.last-run-notes .lr-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 0.25rem;
}

.last-run-notes .lr-progress {
  font-weight: 600;
}

.last-run-notes .lr-notes {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.last-run-notes .lr-note {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.last-run-notes .lr-note label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.5rem;
  align-items: start;
}

.last-run-notes .lr-note .form-check-input {
  grid-row: 1 / span 2;
  margin: 0.2rem 0 0;
}

/* The note keeps the line breaks it was written with */
.last-run-notes .lr-text {
  grid-column: 2;
  white-space: pre-line;
}

.last-run-notes .lr-label {
  grid-column: 2;
  font-size: 0.8rem;
  color: #444;
}

.last-run-notes .lr-note.is-done .lr-text {
  text-decoration: line-through;
  color: #555;
}

/* --- The reflection after a session (Øktdetaljer) ---------------------------- */

.session-reflection {
  border-top: 1px solid #ccc;
  padding-top: 0.75rem;
}

.session-reflection legend {
  font-size: 1rem;
  float: none;
  width: auto;
}

/* --- The session's rating on the course board and in the analytics ------------ */

.cb-session-rating,
.reflection-summary .rating-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border: 1px solid #111;
  border-radius: 50%;
  vertical-align: middle;
  flex: 0 0 auto;
}

.cb-session-rating.rating-great,
.reflection-summary .rating-great {
  background: #198754;
}

.cb-session-rating.rating-okay,
.reflection-summary .rating-okay {
  background: #ffc107;
}

.cb-session-rating.rating-needs-work,
.reflection-summary .rating-needs-work {
  background: #dc3545;
}

.reflection-summary {
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.reflection-summary .rating-dot {
  margin-right: 0.25rem;
}

@media print {
  .last-run-notes {
    display: none !important;
  }
}
