* {
  box-sizing: content-box;
}

:root {
  /* New gray scheme */
  --bp-gray1: #111113;
  --bp-gray2: #242424;
  --bp-gray3: #353535;
  --bp-gray4: #404044;
  --bp-gray5: #555557;
  --bp-gray6: #68686a;
  --bp-gray7: #777779;
  --bp-gray8: #88888a;
  --bp-gray9: #99999a;
  --bp-grayA: #aaaaac;
  --bp-grayB: #b2b2bc;
  --bp-grayC: #ccccce;
  --bp-grayD: #dddddd;
  --bp-grayE: #eeeeee;
  --bp-grayF: #f9f8f9;

  --bp-red: #f1004c;
  --bp-orange: #ff7f00;
  --bp-green: #4fdb4f;
  --bp-navy: #01023a;
  --bp-gray: #e0d0e1;
  --bp-purple: #5737f2;
  --bp-turquoise: #01023d;
  --bp-dark-gray: #202020;
  --bp-light-gray: #383838;
  
  --bp-gray1-50: #11111380;
  --bp-gray8-50: #88888a80;
  --bp-gray8-25: #88888a40;
  --bp-orange-25: #ff7f0040;

  --bp-bg-gray: var(--bp-gray2);
  --bp-title-gray: var(--bp-gray3);
  --bp-input: var(--bp-gray5);
  --bp-input-hover: #bababa;
  --bp-link: #babaf0;
  --bp-link-hover: #afafdf;

  --bp-alljobs: #ff00ff;
  --bp-pending: #00ff00;
  --bp-scheduled: #6495ed;
  --bp-inprogress: #0000cc;
  --bp-completed: #006400;
  --bp-canceled: #ffe4b5;
  --bp-error: #ff0000;
  --bp-flagged: #ffff00;
  --bp-delivered: var(--bp-grayB);

  --bp-status-passed: #92d050;
  --bp-status-new-source: #df6363;
  --bp-status-new-output: #f6b26b;
  --bp-status-warnings: #92d050;
  --bp-status-manual: #ffff00;
  --bp-status-validation: #94dcf8;
  --bp-status-error: #da2a1a;
  --bp-status-completed: #92d050;

  --bp-row-odd: var(--bp-gray2);
  --bp-row-even: var(--bp-gray3);

  --bp-icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', tahoma, arial, sans-serif;
  width: 100vw;
  height: 100vh;
  background-color: var(--bp-bg-gray);
  color: var(--bp-grayE);
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#header {
  align-self: stretch;
  background-color: var(--bp-navy);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  padding: 0.5em 1em;
  position: sticky; /* keep site header visible while scrolling */
  top: 0;
  z-index: 1000;
}

#container {
  align-self: stretch;
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
}

#nav-wrapper {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  background-color: var(--bp-navy);
  position: sticky; /* keep the global sidenav fixed */
  top: 62px;
  height: calc(100vh - 62px);
  overflow: hidden; /* do not scroll this nav */
}
.nav-menu {
  list-style: none;
  padding: 1em 0;
}
.nav-menu.bordered {
  border-bottom: 2px solid var(--bp-grayE);
  padding-bottom: 1em;
}
.nav-menu > li {
  padding: 0.25em 0.5em;
  border-radius: 0.25em;
}
.nav-menu > li:hover {
  cursor: pointer;
  background-color: var(--bp-light-gray);
}
.no-hover {
  min-height: 1em;
}
.nav-menu > li.no-hover:hover {
  cursor: default;
  background-color: var(--bp-gray1);
}

#main {
  flex: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Common: Button Styles */
button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  background-color: var(--bp-gray4);
  border: none;
  border-radius: 0.5em;
  padding: 0.625em 0.875em;
  color: var(--bp-grayC);
  line-height: 1em;
  font-size: 0.875em;
  letter-spacing: 0.25px;
  cursor: pointer;
  transition: all 0.3s ease;

  &:hover:not(:disabled) {
    background-color: var(--bp-gray5);
  }
  &:disabled {
    opacity: 0.7;
    cursor: not-allowed;
  }

  .icon {
    font-size: x-large;
    padding-bottom: 2px;
  }
  /* icon-only style */
  &.button-icon {
    padding: 0.25em;
    line-height: 0em;

    img {
      width: 2em;
      max-height: 2em;
    }
  }

  /* outline style */
  &.button-outline {
    background-color: transparent;
    border: 1px solid var(--bp-gray7);
  }
  &.button-outline:hover:not(:disabled) {
    background-color: var(--bp-gray8-50);
  }
  &.button-outline:disabled {
    color: var(--bp-gray7);
  }

  &.button-small {
    line-height: .925em;
    font-size: 0.8em;
    padding: 0.375em 0.5em;
  }
}

a,
a:visited {
  text-decoration: none;
  color: var(--bp-grayE);
}

.warning {
  color: var(--bp-orange);
}
.success {
  color: var(--bp-green);
}

/* JQuery UI overrides */
.ui-widget-overlay {
  opacity: 0.8;
  background: var(--bp-gray2);
}
.ui-dialog {
  background: var(--bp-gray2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.ui-widget-content a {
  color: var(--bp-grayE);
}

/* Common: Utility Styles */
.clickable {
  cursor: pointer;
}
.hidden {
  display: none !important;
}

/* Common: Form Styles */
input {
  padding: 0.25em 0.5em;
  border: 1px solid var(--bp-gray5);
  border-radius: 0.25em;
  text-align: left;
  background-color: var(--bp-gray4);
  color: var(--bp-grayE);
  transition: all 0.3s ease;

  &:hover {
    border-color: var(--bp-gray6);
    filter: brightness(1.1);
  }
}
.input-error {
  color: var(--bp-red);
  font-size: small;
  font-style: italic;
  padding: 0.5em;
}

select {
  padding: 0.25em;
  border: 1px solid var(--bp-gray5);
  border-radius: 0.25em;
  text-align: left;
  background-color: var(--bp-gray4);
  color: var(--bp-grayE);
  cursor: pointer;
  transition: all 0.3s ease;

  &:hover {
    border-color: var(--bp-gray6);
    filter: brightness(1.1);
  }
  &.select-light {
    background-color: var(--bp-grayC);
    color: var(--bp-gray2);
  }
}

/* Dropdown adapted from https://picocss.com/docs/dropdown */
details.dropdown {
  position: relative;
  border-bottom: none;
  display: block;
}
details summary {
  line-height: 1rem;
  list-style-type: none;
  cursor: pointer;
  transition: color 0.3s ease;
}
details summary:not([role]) {
  color: var(--bp-grayA);
}
details summary::marker {
  display: none;
}
details summary::-moz-list-bullet {
  list-style-type: none;
}
details summary:after {
  display: block;
  width: 1rem;
  height: 1rem;
  margin-inline-start: calc(1rem * 0.5);
  float: right;
  transform: rotate(-90deg);
  background-image: var(--bp-icon-chevron);
  background-position: right center;
  background-size: 1rem auto;
  background-repeat: no-repeat;
  content: '';
  transition: transform 0.3s ease;
}
details summary:focus-visible:not([role]) {
  outline: 2px solid var(--bp-grayB);
  outline-offset: calc(1rem * 0.5);
  color: var(--bp-grayB);
}
details summary[role='button'] {
  width: 100%;
  text-align: left;
}
details summary[role='button']:after {
  height: calc(1rem * 1.5);
}
details.dropdown > summary:not([role]) {
  height: 1.25em;
  padding: 0.25em 0.5em;
  border: 1px solid var(--bp-gray5);
  border-radius: 0.25em;
  background-color: var(--bp-gray4);
  color: var(--bp-grayE);
  cursor: pointer;
  user-select: none;
  transition: filter 0.3s ease, border-color 0.3s ease;
  font-size: .825em;
  line-height: 1.25em;

  &:hover {
    border-color: var(--bp-gray6);
    filter: brightness(1.1);
  }
}
details.dropdown > summary:not([role]):active,
details.dropdown > summary:not([role]):focus {
  border-color: var(--bp-gray6);
  background-color: var(--bp-gray5);
}
details[open] > summary:after {
  transform: rotate(0);
}
details.dropdown[open]>summary:before {
  display: block;
  z-index: 1;
  position: fixed;
  width: 100vw;
  height: 100vh;
  inset: 0;
  background: 0 0;
  content: "";
  cursor: default
}
details.dropdown > summary + ul {
  display: flex;
  z-index: 99;
  position: absolute;
  left: 0;
  flex-direction: column;
  width: 100%;
  min-width: -moz-fit-content;
  min-width: fit-content;
  margin: 0;
  margin-top: .5em;
  padding: 0;
  border: 1px solid var(--bp-gray5);
  border-radius: 0.25em;
  background-color: var(--bp-gray4);
  font-size: .825em;
  line-height: 1.25em;
  box-shadow: 0 0 0 2px var(--bp-gray8-25);
  color: var(--bp-grayE);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .3s ease, transform 0s ease-in-out 1s;
}
details.dropdown[open]>summary+ul {
  transform: scaleY(1);
  opacity: 1;
  transition: opacity .3s ease, transform 0s ease-in-out 0s;
}
details.dropdown>summary+ul li {
  margin-bottom: 0;
  padding: .25em .5em;
  list-style: none;
  cursor: pointer;
  transition: filter .3s ease;
}
details.dropdown>summary+ul li:hover {
  filter: brightness(0.9);
}
details.dropdown>summary+ul li:first-of-type {
  margin-top: .25em;
}
details.dropdown>summary+ul li:last-of-type {
  margin-bottom: .25em;
}

/* Common: Table Styles */
table.bordered-rows {
  border-collapse: collapse;

  thead tr {
    background-color: var(--bp-gray4);
  }
  tbody tr {
    border-top: 1px solid var(--bp-gray5);
  }
  tbody tr:hover {
    background-color: var(--bp-gray3);
  }
} 

table tbody tr.even {
  background-color: var(--bp-row-even);
}
table tbody tr.odd {
  background-color: var(--bp-row-odd);
}

table thead th.clickable {
  &:hover {
    background-color: var(--bp-gray4);
    text-decoration: underline;
  }
}
table tbody td.link > * {
  cursor: pointer;
  display: block;
  padding: 0.5em 1em;

  &:hover {
    background-color: var(--bp-gray4);
    text-decoration: underline;
  }
}

/* Common: Status colors */
.status-pending,
.pending {
  background-color: var(--bp-pending);
}
.status-scheduled,
.scheduled {
  background-color: var(--bp-scheduled);
}
.status-inprogress,
.inprogress {
  background-color: var(--bp-inprogress);
}
.status-completed,
.completed {
  background-color: var(--bp-completed);
}
.status-flagged,
.flagged {
  background-color: var(--bp-flagged);
}
.status-error,
.error {
  background-color: var(--bp-error);
}
.status-canceled,
.canceled {
  background-color: var(--bp-canceled);
}
.status-pending,
.pending,
.status-flagged,
.flagged,
.status-canceled,
.canceled {
  color: var(--bp-gray1);
  a {
    color: var(--bp-gray1);
  }
}
.status-scheduled,
.scheduled,
.status-inprogress,
.inprogress,
.status-completed,
.completed,
.status-error,
.error {
  color: var(--bp-grayE);
  a {
    color: var(--bp-grayE);
  }
}

.status-no-progress,
.no-progress {
}
.status-source-passed,
.source-passed {
  background-color: var(--bp-status-passed);
  /* text-shadow: 0px 0px 16px var(--bp-gray1-50); */
}
.status-new-source-recommended,
.new-source-recommended {
  background-color: var(--bp-status-new-source);
}
.status-new-output-recommended,
.new-output-recommended {
  background-color: var(--bp-status-new-output);
}
.status-source-passed-with-warnings,
.source-passed-with-warnings {
  background-color: var(--bp-status-warnings);
}
.status-manual-qa-needed,
.manual-qa-needed {
  background-color: var(--bp-status-manual);
}
.status-data-validation-error,
.data-validation-error {
  background-color: var(--bp-status-error);
}
.status-new-output-completed,
.new-output-completed {
  background-color: var(--bp-status-completed);
}

.status-source-passed,
.source-passed,
.status-new-source-recommended,
.new-source-recommended,
.status-new-output-recommended,
.new-output-recommended,
.status-source-passed-with-warnings,
.source-passed-with-warnings,
.status-manual-qa-needed,
.manual-qa-needed,
.status-data-validation-error,
.data-validation-error,
.status-new-output-completed,
.new-output-completed {
  color: var(--bp-gray1);
}
