/* Teacher app entrypoint. Shared design system styles are loaded from Classroom.Web.DesignSystem. */

/* Report analytics SVG charts */
.dist-chart-svg { max-height: 200px; }
.dist-bar-excellent { fill: var(--bs-success); }
.dist-bar-good { fill: var(--bs-primary); }
.dist-bar-satisfactory { fill: var(--bs-warning); }
.dist-bar-needs-improvement { fill: var(--bs-danger); }

.chart-scroll { overflow-x: auto; }
.chart-gridline { stroke: var(--ds-color-border-subtle); }
.chart-bar-assignment { fill: var(--bs-primary); opacity: 0.8; }
.chart-bar-exam { fill: var(--bs-purple); opacity: 0.8; }
.chart-trend-line { fill: none; stroke: var(--bs-orange); stroke-width: 2px; stroke-dasharray: 6 3; }
.chart-trend-dot { fill: var(--bs-orange); }

.chart-count-text { fill: var(--ds-color-text-primary); font-size: var(--ds-font-size-caption); }
.chart-axis-text { fill: var(--ds-color-text-muted); font-size: var(--ds-font-size-caption); }
.chart-label-text { fill: var(--ds-color-text-secondary); font-size: var(--ds-font-size-caption); }

.chart-legend-dot { display: inline-block; width: 12px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.chart-legend-bar { height: 12px; }
.chart-legend-line { height: 3px; background: var(--bs-orange); border-top: 2px dashed var(--bs-orange); border-radius: 1px; }
.chart-legend-assignment { background: var(--bs-primary); }
.chart-legend-exam { background: var(--bs-purple); }

.badge-assignment { background-color: var(--bs-primary); }
.badge-exam { background-color: var(--bs-purple); }

.q-progress-svg { display: block; width: 100%; height: 20px; }
.q-progress-svg--sm { height: 8px; max-width: 80px; }
.q-bar-track { fill: var(--ds-color-surface-sunken); }
.q-bar-success { fill: var(--bs-success); }
.q-bar-warning { fill: var(--bs-warning); }
.q-bar-danger { fill: var(--bs-danger); }
.q-bar-primary { fill: var(--bs-primary); }

.col-score-min { min-width: 120px; }
.score-label-min { min-width: 45px; }

:root {
  --app-sidebar-gradient-start: var(--ds-color-brand-secondary);
  --app-sidebar-gradient-end: var(--ds-color-brand-primary);
}

#blazor-error-ui:not([style*="display:block"]):not([style*="display: block"]) {
  display: none;
}

.notes-editor {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.assignment-linked-class-list {
  max-height: 12.5rem;
  overflow-y: auto;
}

.notes-preview-shell {
  border: 1px solid var(--ds-color-border-muted);
  border-radius: 0.75rem;
  background: var(--ds-color-surface);
  min-height: 23.25rem;
  max-height: 28rem;
  overflow: auto;
}

.notes-preview-content {
  padding: 1rem;
  line-height: 1.6;
}

.notes-preview-content > :first-child {
  margin-top: 0;
}

.notes-preview-content > :last-child {
  margin-bottom: 0;
}

.notes-rendered-content {
  line-height: 1.7;
}

.class-detail-notes-card {
  overflow: hidden;
}

.notes-rendered-shell {
  max-height: 32rem;
  overflow: auto;
  padding-right: 0.25rem;
}

.notes-rendered-content > :first-child {
  margin-top: 0;
}

.notes-rendered-content > :last-child {
  margin-bottom: 0;
}

.app-rich-math-preview-shell {
  border: 1px solid var(--ds-color-border-muted);
  border-radius: 0.75rem;
  background: var(--ds-color-surface);
  min-height: 16rem;
}

.app-rich-math-content {
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.app-rich-math-content--compact {
  font-size: var(--ds-font-size-body);
  line-height: 1.6;
}

.app-rich-math-content--button {
  display: inline-block;
  flex: 1 1 auto;
  min-width: 0;
}

.app-rich-math-content--button .katex-display,
.app-rich-math-content--button p {
  margin: 0;
}

.app-rich-math-content > :first-child {
  margin-top: 0;
}

.app-rich-math-content > :last-child {
  margin-bottom: 0;
}

.app-rich-math-content pre,
.app-rich-math-content code {
  white-space: pre-wrap;
  word-break: break-word;
}

.app-rich-math-content .katex-display {
  margin: 1rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.app-solution-section {
  border: 1px solid var(--ds-color-border-subtle);
  border-radius: var(--ds-radius-md);
  padding: var(--ds-space-4);
}

.app-solution-section--question {
  background: var(--ds-color-surface-sunken);
}

.app-solution-section--answer {
  background: var(--ds-color-surface-raised);
}

.app-solution-section__label {
  color: var(--ds-color-text-muted);
  font-size: var(--ds-font-size-label);
  font-weight: var(--ds-font-weight-semibold);
  letter-spacing: 0;
  margin-bottom: var(--ds-space-2);
  text-transform: uppercase;
}

@media (min-width: 992px) {
  .app-shell {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .app-shell__main {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
}

#classroom-notes-print-root {
  display: none;
}

@media print {
  @page {
    margin: 12mm 14mm;
  }

  body.notes-print-active {
    background: var(--ds-color-surface-raised) !important;
  }

  body.notes-print-active .app-shell,
  body.notes-print-active #blazor-error-ui,
  body.notes-print-active #components-reconnect-modal {
    display: none !important;
  }

  body.notes-print-active #classroom-notes-print-root {
    display: block !important;
    margin: 0;
    padding: 0;
    color: var(--ds-color-text-primary);
    background: var(--ds-color-surface-raised);
    font-family: "Times New Roman", Times, serif;
    line-height: var(--ds-line-height-body);
  }

  body.notes-print-active .classroom-notes-print-header {
    border-bottom: 1px solid var(--ds-color-border-subtle);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
  }

  body.notes-print-active .classroom-notes-print-header h1 {
    font-size: var(--ds-font-size-h2);
    margin: 0;
  }

  body.notes-print-active .classroom-notes-print-meta {
    color: var(--ds-color-text-secondary);
    font-size: var(--ds-font-size-label);
    margin-top: 0.25rem;
  }

  body.notes-print-active .classroom-notes-print-content > :first-child {
    margin-top: 0;
  }

  body.notes-print-active .classroom-notes-print-content > :last-child {
    margin-bottom: 0;
  }

  body.notes-print-active .review-overall-feedback,
  body.notes-print-active .review-question {
    margin-bottom: 1rem;
  }

  body.notes-print-active .review-question-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
  }

  body.notes-print-active .review-question-grade {
    flex: 0 0 auto;
    font-weight: 600;
  }

  body.notes-print-active .review-question-feedback,
  body.notes-print-active .review-mistakes {
    margin-top: 0.5rem;
  }

  body.notes-print-active .review-mistakes {
    padding-left: 1.25rem;
  }

  body.notes-print-active .review-late-badge {
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  body.notes-print-active .assessment-print-header {
    border-bottom: 1px solid #111;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }

  body.notes-print-active .assessment-print-school-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #111;
    padding-bottom: 0.2rem;
    margin-bottom: 1.6rem;
    font-size: var(--ds-font-size-body);
  }

  body.notes-print-active .assessment-print-school-row::after {
    content: counter(page);
    font-weight: 400;
  }

  body.notes-print-active .assessment-print-header h1 {
    font-size: var(--ds-font-size-h1);
    line-height: 1.1;
    margin: 0 0 0.4rem;
  }

  body.notes-print-active .assessment-print-lines {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem 1rem;
    margin: 0.35rem 0;
  }

  body.notes-print-active .assessment-print-lines div {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
  }

  body.notes-print-active .assessment-print-lines span {
    flex: 1 1 auto;
    border-bottom: 1px solid #111;
    min-height: 1em;
  }

  body.notes-print-active .assessment-points-note,
  body.notes-print-active .assessment-show-work {
    margin-top: 0.65rem;
    font-style: italic;
  }

  body.notes-print-active .assessment-question {
    break-inside: avoid-page;
    page-break-inside: avoid;
    margin: 0 0 1.25rem;
  }

  body.notes-print-active .assessment-question-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.45rem;
  }

  body.notes-print-active .assessment-question-number,
  body.notes-print-active .assessment-question-points,
  body.notes-print-active .assessment-work-label {
    font-weight: 700;
  }

  body.notes-print-active .assessment-question-text > :first-child {
    margin-top: 0;
  }

  body.notes-print-active .assessment-question-text > :last-child {
    margin-bottom: 0;
  }

  body.notes-print-active .assessment-question-text .katex-display {
    overflow-y: visible;
    margin-top: 0.2rem;
    padding-top: 0.1rem;
  }

  body.notes-print-active .assessment-question-text .katex {
    line-height: 1.2;
  }

  body.notes-print-active .assessment-work-label {
    margin-top: 0.25rem;
    margin-left: 1.65rem;
  }

  body.notes-print-active .assessment-work-lines {
    margin-top: 0.1rem;
  }

  body.notes-print-active .assessment-work-line {
    border-bottom: 1px solid #111;
    height: 1.65rem;
  }

  body.notes-print-active .classroom-notes-page-break {
    break-before: page;
    page-break-before: always;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .app-rich-math-content .katex-display,
  .app-rich-math-content ul,
  .app-rich-math-content ol,
  .app-rich-math-content pre,
  .app-rich-math-content blockquote,
  .app-rich-math-content table {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .app-rich-math-content p,
  .app-rich-math-content li {
    orphans: 3;
    widows: 3;
  }
}
