/*****************
 * General styles
 *****************/

body {
  overflow-y: scroll;
}

canvas {
  border: 1px solid #aaa;
}

#qbody form {
  margin-top: 20px;
}

line.axis {
  fill: none;
  stroke: #000;
  shape-rendering: crispEdges;
}

.axis path,
.axis line {
  fill: none;
  stroke: #000;
  shape-rendering: crispEdges;
}

.grid path,
.grid line {
  fill: none;
  stroke: #ddd;
  shape-rendering: crispEdges;
}

.bar {
  stroke: #46b8da;
  fill: #5bc0de;
}

.outlineBar {
  stroke: #fff;
  fill: #5bc0de;
}

.outlineBarRed {
  stroke: #fff;
  fill: #ff0000;
}

.parallelHistMean {
  stroke: #000;
  stroke-width: 3px;
}

.statsPlot .label {
  font-size: 14px;
  font-weight: normal;
  fill: black;
}

.statsPlot .fitLine {
  stroke: #00b;
}

body table.no-border td {
  border: 0px;
}

body table.no-border th {
  border: 0px;
}

.statsPlot .point {
  stroke: #d43f3a;
  fill: #d9534f;
}

table.two-column-description tr th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 5%;
}

table.two-column-description-no-header tr td:first-of-type {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 5%;
}

table.two-column-description-no-header-with-help tr td:first-of-type {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 5%;
}

table.two-column-description-no-header-with-help tr td:last-of-type {
  width: 1%;
}

.table-no-wrap th {
  white-space: nowrap;
}

.table-no-wrap td {
  white-space: nowrap;
}

pre {
  overflow-wrap: normal;
}

/* MathJax SVG shape rendering: Prefer accurate antialiased font shapes
   over "crisp" pixel-aligned ones. This may be less sharp in some cases,
   but it can prevent thin lines from disappearing. */
mjx-container {
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
}

.popover-wide {
  max-width: min(800px, 90vw);
}

.popover-narrow-fixed {
  width: 400px;
  max-width: 90vw;
}

/**
 * Identical to the variables for `btn-light`, except with a transparent
 * background and border in the default state. This style is useful for
 * buttons that should carry little visual weight, while still ensuring
 * that they have hover/focus/active styles.
 */
.btn.btn-ghost {
  --bs-btn-color: #000;
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: #000;
  --bs-btn-hover-bg: #d3d4d5;
  --bs-btn-hover-border-color: #c6c7c8;
  --bs-btn-focus-shadow-rgb: 211, 212, 213;
  --bs-btn-active-color: #000;
  --bs-btn-active-bg: #c6c7c8;
  --bs-btn-active-border-color: #babbbc;
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --bs-btn-disabled-color: #000;
  --bs-btn-disabled-bg: #f8f9fa;
  --bs-btn-disabled-border-color: #f8f9fa;
}

/**
 * A darker variant of `btn-light`.
 *
 * These colors were determined by rebuilding the Bootstrap CSS with the `light`
 * base color redefined from gray-100 to gray-300 here:
 *
 * https://github.com/twbs/bootstrap/blob/bafa9d25ed38b8742a3f52bc1401d46b71960153/scss/_variables.scss#L307
 */
.btn.btn-med-light {
  --bs-btn-color: #000;
  --bs-btn-bg: #dee2e6;
  --bs-btn-border-color: #dee2e6;
  --bs-btn-hover-color: #000;
  --bs-btn-hover-bg: #bdc0c4;
  --bs-btn-hover-border-color: #b2b5b8;
  --bs-btn-focus-shadow-rgb: 189, 192, 196;
  --bs-btn-active-color: #000;
  --bs-btn-active-bg: #b2b5b8;
  --bs-btn-active-border-color: #a7aaad;
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --bs-btn-disabled-color: #000;
  --bs-btn-disabled-bg: #dee2e6;
  --bs-btn-disabled-border-color: #dee2e6;
}

/**
 * Remove the bottom border from the final row of the last table in a card.
 */
.card > table.table:last-of-type tbody tr:last-child th,
.card > table.table:last-of-type tbody tr:last-child td,
.card > .table-responsive > table.table:last-of-type tbody tr:last-child th,
.card > .table-responsive > table.table:last-of-type tbody tr:last-child td {
  border-bottom: 0;
}

/**
 * Subtle pulsing animation for warning pop-ups
 */
@keyframes pulse {
  0%,
  40%,
  60%,
  100% {
    transform: scale(100%);
  }

  45%,
  55% {
    transform: scale(103%);
  }

  50% {
    transform: scale(100%);
  }
}

.pulse {
  animation: pulse 3s infinite;
}

/**************
 * Submissions
 **************/

/* General-purpose show/hide button with animation */
.show-hide-btn {
  cursor: pointer;
}

.show-hide-btn .expand-icon {
  transition: transform 400ms;
}

.show-hide-btn.collapsed .expand-icon {
  transform: rotateX(180deg);
}

/* Button in submission header context prepends "hide" or "show" automatically */
.collapsible-card-header .expand-icon {
  transition: transform 400ms;
}

.collapsible-card-header .expand-icon-container::before {
  content: 'Hide';
}

.collapsible-card-header .expand-icon-container.collapsed .expand-icon {
  transform: rotateX(180deg);
}

.collapsible-card-header .expand-icon-container.collapsed::before {
  content: 'Show';
}

/***************************************
 * Additions for Bootstrap 4 conversion
 ***************************************/

.card > table,
.card > .table-responsive > table {
  margin-bottom: 0;
}

.btn.btn-xs {
  padding: 1px 5px;
  font-size: 0.7rem;
}

a.badge {
  text-decoration: none;
}

.no-select {
  user-select: none;
}

/*****************
 * Brand label ("PrairieLearn" text)
 *****************/
.navbar-brand {
  position: relative;
}

.navbar-brand-label,
.navbar-brand-hover-label {
  display: inline-block;
  transition: all 0.3s ease-out;
}

.navbar-brand-hover-label {
  opacity: 0;
  position: absolute;
  left: 0;
  bottom: 0;
  font-size: 0.8rem;
  transform: translate(0px, -3px);
}

.navbar-brand:is(:hover, :focus) .navbar-brand-label {
  transform: translate(0px, -7px);
}

.navbar-brand:is(:hover, :focus) .navbar-brand-hover-label {
  opacity: 1;
  transform: translate(0px, 0px);
}

/* Supports a color accent at the tops of nav tabs, github-style */
.nav-tabs.pl-nav-tabs-bar .nav-link.active {
  border-top-color: var(--bs-primary);
  border-top-width: 0.2rem;
  padding-top: 0.4rem;
}

/* Used to give table rows the same padding as Bootstrap card headers */
.card > table tr td:first-child,
.card > table tr th:first-child,
.card > .table-responsive > table tr td:first-child,
.card > .table-responsive > table tr th:first-child {
  padding-left: 1.25rem;
}
.card > table tr td:last-child,
.card > table tr th:last-child,
.card > .table-responsive > table tr td:last-child,
.card > .table-responsive > table tr th:last-child {
  padding-right: 1.25rem;
}

/** Ensure that headings in card headers are styled the same as standard card headers. */
.card-header > :is(h1, h2, h3, h4, h5, h6) {
  line-height: 1.5rem;
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 400;
}

.user-output,
.user-output-invalid {
  display: inline;
  font-size: 14px;
  white-space: pre;
  color: #444;
  background: #f0f0f0;

  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 2px;
  padding-right: 2px;

  border-radius: 2px;
  border-color: #ccc;
  border-width: 1px;
  border-style: solid;

  line-height: 28px;
}

.user-output-invalid {
  color: #dc3545;
}

.user-output.small,
.user-output-invalid.small,
small .user-output,
small .user-output-invalid {
  font-size: 11px;
  line-height: 25px;
}

.badge-invalid {
  border-style: solid;
  border-width: 1.5px;
  border-color: #dc3545;
  margin-left: 5px;
  background: #fff;
}

.badge-missing-input {
  border-style: solid;
  border-width: 2px;
  border-color: #6c757d;
  margin-left: 5px;
  background: #fff;
}

/**
 * We use red text in light buttons to indicate errors on many elements.
 * By default, this has insufficient contrast. We override the color in
 * this specific case to improve the contrast.
 */
.btn.btn-light.text-danger {
  color: hsl(from rgb(var(--bs-danger-rgb)) h s calc(l - 5)) !important;
}

/***********************************
 * Button focus accessibility styles
 ***********************************/
.btn:focus:focus-visible {
  outline-style: solid !important;
  outline-color: var(--bs-btn-hover-color) !important;
  outline-width: 2px !important;
  outline-offset: -2px !important;
}

/* The sticky-column class is used to make the first column of a bootstrap-table sticky. */
.table > :not(caption) > * > .sticky-column {
  position: sticky;
  left: 0;
  background-color: var(--bs-body-bg);
  background-clip: padding-box;
  box-shadow: inset -1px 0 #dee2e6;
}

.table.table-hover > tbody > tr:hover > td.sticky-column {
  color: var(--bs-table-hover-color);
  /* This must be opaque, to ensure the cell shows on top of others.
     TODO: compute this value by combining --bs-body-bg (opaque) with --bs-table-hover-bg (semi-transparent). */
  background-color: #efefef;
}

/* This class is used in pages with bootstrap-table. Since these pages include the navigation in the toolbar, some padding is necessary. */
.fixed-table-toolbar {
  padding: 0 1em 0 1em;
}

.fixed-table-toolbar div.pagination,
.fixed-table-toolbar div.pagination-detail {
  margin: 0 1em 0 0 !important;
}

/** Provide a higher-contrast focus indicator for tom-select dropdowns */
.ts-dropdown .active {
  outline: 2px solid var(--bs-primary);
  outline-offset: -2px;
}

/**
 * Fixes an accessibility issue with Bootstrap's navbar focus styles.
 * https://github.com/twbs/bootstrap/issues/41395
 */
.nav-link:focus-visible {
  box-shadow: none !important;
  outline-style: revert;
  outline-color: revert;
  outline-width: revert;
}
