:root {
  --subject-color: #6c757d;
}

body {
  font-size: .925rem;
}

.app-content-header {
  padding: 1rem .5rem .75rem;
}

.app-content-header h1 {
  font-size: 1.7rem;
}

.app-content {
  padding: 0 .5rem 1rem;
}

.card-header.d-flex::after {
  display: none;
}

.sidebar-brand .brand-text {
  font-weight: 600 !important;
}

.sidebar-menu .nav-header {
  padding-top: 1.1rem;
}

.login-page {
  min-height: 100vh;
}

.login-box {
  width: min(390px, calc(100% - 2rem));
}

.login-logo a {
  font-size: 1.55rem;
  font-weight: 600;
  text-decoration: none;
}

.login-card {
  border-radius: var(--bs-border-radius);
}

.login-box-msg {
  font-size: 1.05rem;
  font-weight: 600;
}

.password-field .reveal-password {
  min-width: 78px;
}

/* Calendar */
.calendar-table {
  min-width: 940px;
  table-layout: fixed;
}

.calendar-table th {
  width: 14.285%;
}

.calendar-day {
  height: 148px;
  padding: .4rem !important;
  background: var(--bs-body-bg);
}

.calendar-day.outside-month {
  background: var(--bs-tertiary-bg);
  color: var(--bs-secondary-color);
}

.calendar-day.today {
  background: var(--bs-primary-bg-subtle);
}

.day-number {
  display: flex;
  min-height: 24px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: .25rem;
}

.day-number time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.day-number small {
  color: var(--bs-primary-text-emphasis);
  font-size: .66rem;
}

.day-meetings {
  display: grid;
  gap: .25rem;
}

.calendar-meeting {
  display: grid;
  padding: .3rem .4rem;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  border-left: 3px solid var(--subject-color);
  border-radius: 2px;
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  font-size: .72rem;
  line-height: 1.2;
  text-decoration: none;
}

.calendar-meeting:hover,
.calendar-meeting:focus-visible {
  border-color: var(--subject-color);
  color: var(--bs-body-color);
}

.calendar-meeting strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.calendar-meeting small {
  margin-top: .15rem;
  color: var(--bs-warning-text-emphasis);
}

.mobile-meeting-list .list-group-item {
  border-left: 4px solid var(--subject-color);
}

.meeting-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.meeting-subject {
  color: var(--bs-secondary-color);
  font-size: .64rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Subjects */
.subject--navy { --subject-color: #355d87; }
.subject--brick { --subject-color: #a44f3e; }
.subject--forest { --subject-color: #3d765b; }
.subject--gold { --subject-color: #947019; }
.subject--plum { --subject-color: #765276; }
.subject--cyan { --subject-color: #347786; }

a.card[class*="subject--"],
form.card[class*="subject--"] {
  border-left: 4px solid var(--subject-color);
}

a.card[class*="subject--"]:hover {
  border-color: var(--subject-color);
}

a.card[class*="subject--"] .card-title {
  float: none;
  display: block;
  font-size: 1.1rem;
}

a.card[class*="subject--"] .card-body {
  min-height: 118px;
}

.subject-code {
  color: var(--subject-color) !important;
}

/* Player and transcript */
.video-frame {
  overflow: hidden;
  background: #090c10;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-toolbar select {
  width: auto;
  min-width: 90px;
}

.shortcut-hint {
  color: var(--bs-secondary-color);
  font-size: .75rem;
}

.transcript-panel .card-body {
  min-height: 0;
}

.transcript-view {
  min-height: 320px;
  max-height: 470px;
  margin-top: .75rem;
  padding-right: .4rem;
  overflow-y: auto;
  white-space: normal;
}

.transcript-view p {
  line-height: 1.6;
}

.timestamp-link {
  margin-right: .35rem;
  padding: .08rem .28rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 2px;
  background: var(--bs-secondary-bg);
  color: var(--bs-link-color);
  font-size: .72rem;
  font-weight: 600;
}

mark {
  padding: 0 .1rem;
  background: #ffe79a;
}

/* Lecture materials */
.material-card {
  overflow: hidden;
  color: inherit;
}

.material-card:hover,
.material-card:focus-visible {
  border-color: var(--bs-primary);
}

.material-preview {
  display: grid;
  aspect-ratio: 16 / 10;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.material-preview img,
.material-admin-card > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.material-admin-card > img {
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

/* Upload and processing */
#drop-zone.dragging {
  border-color: var(--bs-primary) !important;
  background: var(--bs-primary-bg-subtle) !important;
}

.upload-progress progress {
  display: block;
  height: .7rem;
}

.status-pill {
  border: 1px solid transparent;
}

.status-ready {
  border-color: var(--bs-success-border-subtle);
  background: var(--bs-success-bg-subtle);
  color: var(--bs-success-text-emphasis);
}

.status-failed {
  border-color: var(--bs-danger-border-subtle);
  background: var(--bs-danger-bg-subtle);
  color: var(--bs-danger-text-emphasis);
}

.status-processing,
.status-queued,
.status-uploading {
  border-color: var(--bs-warning-border-subtle);
  background: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
}

.status-awaiting_upload {
  border-color: var(--bs-secondary-border-subtle);
  background: var(--bs-secondary-bg-subtle);
  color: var(--bs-secondary-text-emphasis);
}

.form-feedback {
  color: var(--bs-success-text-emphasis);
  font-size: .82rem;
}

@media (min-width: 1200px) {
  .transcript-panel,
  .player-panel {
    min-height: 570px;
  }

  .transcript-view {
    max-height: none;
    flex: 1 1 auto;
  }

  .transcript-panel.transcript-standalone {
    min-height: 0;
  }

  .transcript-standalone .transcript-view {
    min-height: 240px;
    max-height: 420px;
  }
}

@media (max-width: 767.98px) {
  .app-content-header h1 {
    font-size: 1.45rem;
  }

  .calendar-toolbar {
    display: flex;
    width: 100%;
    gap: .5rem;
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-toolbar .btn-group {
    display: flex;
  }

  .calendar-toolbar .btn-group .btn {
    flex: 1 1 0;
  }

  .calendar-toolbar .btn-primary {
    margin-left: 0 !important;
  }

  .calendar-table {
    width: 100%;
    min-width: 100%;
  }

  .calendar-day {
    height: 92px;
    padding: .2rem !important;
  }

  .calendar-table th {
    padding-inline: .15rem !important;
  }

  .day-number {
    min-height: 20px;
    margin-bottom: .1rem;
  }

  .day-number small,
  .meeting-subject,
  .calendar-meeting strong,
  .calendar-meeting small {
    display: none;
  }

  .calendar-meeting {
    padding: .14rem .12rem;
    border-right: 0;
    border-top: 0;
    border-bottom: 0;
    font-size: .62rem;
  }

  .meeting-time {
    overflow: hidden;
    text-overflow: clip;
  }

  .shortcut-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
