/* Tutor quiz result - overrides on top of ../student/student.css.
   Measured on demo-staging /onlinequizv2/tutor/quiz-result at 1440px: 72px band, 70px rail, 12px split padding,
   white bordered (#D9E1EA, 12px radius) document and details cards, purple (#302574) details title. */

:root {
  --tq-card-border: #d9e1ea;
  --tq-purple: #302574;
  --tq-field-radius: 12px;
}

/* ---------- band: student + attempts on the left, status pills on the right ---------- */
.tq-band {
  justify-content: space-between;
  gap: 16px;
  height: 72px;
  padding: 8px clamp(16px, 5vw, 70px) 8px clamp(16px, 10.42vw, 150px);
}

.tq-person {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.tq-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.tq-field--attempts {
  padding-left: 16px;
}

.tq-field-label {
  color: var(--sq-muted);
  font-size: 12px;
  font-weight: 700;
}

/* "Student NAME" wraps onto two lines on staging; "ATTEMPTS" stays on one */
.tq-field:not(.tq-field--attempts) .tq-field-label {
  width: 66px;
}

.tq-field--attempts .tq-field-label {
  white-space: nowrap;
}

.tq-student-select {
  width: 200px;
  height: 49px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--sq-field-border);
  border-radius: var(--tq-field-radius);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2312263f' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
}

.tq-attempts {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tq-attempts strong {
  min-width: 34px;
  text-align: center;
  font-size: 16px;
}

.tq-attempt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--sq-text);
  cursor: pointer;
}

.tq-attempt-btn:hover:not(:disabled) {
  background: rgba(18, 38, 63, 0.06);
}

.tq-attempt-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.tq-status {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
}

.tq-reviewed {
  min-height: 41px;
  padding: 8px 12px;
  border: 1px solid var(--sq-green);
  border-radius: var(--tq-field-radius);
  background: var(--sq-green);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

/* ---------- split view: white bordered cards instead of the student gray well ---------- */
.tq .sq-split {
  gap: 16px;
  padding: 12px;
}

.tq .sq-doc {
  padding: 0;
  border: 1px solid var(--tq-card-border);
  border-radius: 12px;
  background: #fff;
}

.tq .qr-pages {
  gap: 0;
}

/* page edges stay visible on the white card */
.tq .qr-page {
  border-bottom: 1px solid var(--tq-card-border);
}

.tq .qr-doc-state {
  background: rgba(255, 255, 255, 0.92);
}

.tq .sq-detail {
  border-color: var(--tq-card-border);
  border-radius: 12px;
}

.tq .sq-detail-head {
  padding: 12px;
  border-bottom-color: var(--tq-card-border);
  background: transparent;
}

.tq .sq-detail-title h2 {
  color: var(--tq-purple);
  font-size: 15px;
  font-weight: 700;
}

/* ---------- details content ---------- */
.tq .sq-stats {
  margin-bottom: 16px;
}

.tq-marks-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  line-height: 30px;
}

.tq-dropdown {
  position: relative;
}

.tq-marks-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 72px;
  height: 41px;
  padding: 8px;
  border: 1px solid var(--sq-field-border);
  border-radius: 8px;
  background: #fff;
  color: #283e59;
  font-size: 15px;
  cursor: pointer;
}

.tq-marks-btn::after,
.tq-add-remarks::after {
  content: "";
  margin-left: auto;
  border: solid transparent;
  border-width: 5px 4px 0;
  border-top-color: currentColor;
}

.tq-ai-icon {
  width: 14px;
  height: auto;
}

.tq-menu {
  position: absolute;
  z-index: 4;
  top: calc(100% + 2px);
  left: 0;
  min-width: 100%;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  border: 1px solid rgba(18, 38, 63, 0.1);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.09);
}

.tq-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 16px;
  border: 0;
  background: none;
  font-size: 15px;
  line-height: 24px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.tq-menu button:hover {
  background: #f1f4f8;
}

.tq-menu button[aria-selected="true"] {
  background: var(--sq-blue);
  color: #fff;
}

.tq-menu-note {
  margin: 0;
  padding: 4px 16px;
  color: var(--sq-muted);
  font-size: 14px;
}

.tq .sq-correct {
  margin-top: 0;
}

.tq-add-remarks {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 7px 16px;
  border: 2px solid var(--sq-blue);
  border-radius: 16px;
  background: #fff;
  color: var(--sq-blue);
  font-family: var(--sq-pill-font);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  cursor: pointer;
}

.tq-remarks-block {
  margin-top: 12px;
}

.tq-add-wrap {
  margin-bottom: 24px;
}

.tq .sq-remarks {
  margin-top: 0;
}

.tq .sq-remarks-head {
  margin-bottom: 16px;
}

.tq-remark-input {
  display: block;
  width: 100%;
  min-height: 122px;
  padding: 12px;
  border: 1px solid var(--sq-field-border);
  border-radius: 8px;
  background: #fff;
  color: var(--sq-text);
  font: 400 16px/24px var(--sq-font);
  resize: vertical;
}

.tq-remark-input:focus {
  outline: 0;
  border-color: var(--sq-blue);
}

/* =========================================================
   Narrow desktop / tablet landscape
   ========================================================= */
@media (max-width: 1100px) and (min-width: 821px) {
  .tq-field-label {
    display: none;
  }
}

/* =========================================================
   Portrait phones
   ========================================================= */
@media (max-width: 820px) and (orientation: portrait) {
  .tq-band {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    height: auto;
    padding: 10px 16px;
  }

  .tq-person {
    justify-content: space-between;
    gap: 8px;
  }

  .tq-field-label {
    display: none;
  }

  .tq-field--attempts {
    padding-left: 0;
  }

  .tq-student-select {
    flex: 1;
    width: auto;
    height: 38px;
    font-size: 14px;
  }

  .tq-person .tq-field:first-child {
    flex: 1;
    min-width: 0;
  }

  /* three status items share one row on a 390px phone; they still wrap on narrower screens */
  .tq-status {
    flex-wrap: wrap;
    gap: 6px;
  }

  .tq-status .sq-pill,
  .tq-status .sq-pill--score {
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .tq-reviewed {
    min-height: 0;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.5;
  }

  .tq .sq-split {
    padding: 0;
  }

  .tq .sq-doc {
    padding: 0;
    border-width: 1px 0;
    border-radius: 0;
  }

  .tq .sq-detail {
    border: 0;
    border-radius: 20px 20px 0 0;
  }

  .tq .sq-detail-head {
    padding: 0 16px 12px;
    border-bottom: 0;
  }
}

/* =========================================================
   Landscape phones
   ========================================================= */
@media (max-height: 500px) and (orientation: landscape) {
  .tq-band {
    height: auto;
    padding: 4px calc(12px + env(safe-area-inset-right)) 4px 12px;
  }

  .tq-field-label {
    display: none;
  }

  .tq-field--attempts {
    padding-left: 8px;
  }

  .tq-student-select {
    width: 150px;
    height: 30px;
    font-size: 12px;
  }

  .tq-reviewed {
    min-height: 0;
    padding: 2px 12px;
    font-size: 11.5px;
  }

  .tq .sq-split {
    padding: 8px calc(10px + env(safe-area-inset-right)) 8px 10px;
  }

  .tq-remark-input {
    min-height: 90px;
  }
}
