/* roboto-300 - latin */
@font-face {
  font-display: swap;
  /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: "Roboto";
  font-style: normal;
  font-weight: 300;
  src: url("../fonts/roboto-v30-latin-300.woff2") format("woff2");
  /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* roboto-regular - latin */
@font-face {
  font-display: swap;
  /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/roboto-v30-latin-regular.woff2") format("woff2");
  /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* roboto-700 - latin */
@font-face {
  font-display: swap;
  /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  src: url("../fonts/roboto-v30-latin-700.woff2") format("woff2");
  /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* roboto-900 - latin */
@font-face {
  font-display: swap;
  /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: "Roboto";
  font-style: normal;
  font-weight: 900;
  src: url("../fonts/roboto-v30-latin-900.woff2") format("woff2");
  /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

:root {
  --bs-body-font-family: "Roboto", sans-serif;
  --bg-img-none: hsl(210, 10%, 23%);
}

p {
  text-wrap: pretty;
}

main {
  height: 100svh;
  overflow-y: auto;
  width: 100%;
}

.container {
  padding: 1rem;
}

/* hide lazyload img until loaded */
img.lazyload:not([src]) {
  visibility: hidden;
}

/* hides asterisk for required fields in form */
.asteriskField {
  display: none;
}

/* bootstrap alert CSS, translated to the django-standard levels of
debug, info, success, warning, error */

.alert-error {
  background-color: #2c0b0e;
  border-color: #842029;
  color: #ea868f;
}

#sidebar {
  width: 230px;

  /* override bootstrap offcanvas width */
  &.offcanvas-lg {
    --bs-offcanvas-width: 75% !important;
  }
}

.nav-pills {
  .nav-link.active {
    background-color: transparent;
  }

  .nav-link:not(.active) {
    color: hsl(0, 0%, 75%);

    &:hover {
      color: white;
    }
  }
}

.logout-btn {
  background: none;
  border: none;
  padding: 0;
  color: hsl(0, 0%, 75%);

  &:hover {
    color: white;
  }
}

.search-bar {
  @media screen and (width >= 992px) {
    width: 50%;
  }

  .form-select {
    /* adjust width of select in search-bar */
    flex-grow: 0;
    width: auto;
  }
}

.sources button:not(.active):hover {
  background-color: transparent;
  border-color: var(--bs-btn-hover-color);
}

.grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
}

.card {
  width: 100%;

  .poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    cursor: pointer;
  }

  .image-not-found {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: contain;
    object-position: center top;
    background-color: var(--bg-img-none);
    cursor: pointer;
  }
}

.card-img-overlay {
  /* position bottom of card */
  top: auto;
  padding: 0.5em;
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
  background-color: rgba(0, 0, 0, 0.692);
}

.card-title {
  text-align: center;
  margin-bottom: 0;
  /* show only 2 lines of text */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  text-wrap: balance;
}

.card-text {
  .open-track-btn {
    padding: 0;
    background-color: transparent;
    border-color: transparent;
  }

  .progress_count {
    text-align: center;
  }

  .progress-btn {
    padding: 0.1rem 0.3rem;

    &:disabled {
      color: transparent;
    }

    &:hover {
      color: white;
    }
  }
}

.table-responsive {
  background-color: hsl(210, 10.8%, 16%);
  -webkit-overflow-scrolling: auto; /* fixes modal fade on iOS */
}

.table {
  --bs-table-bg: hsl(210, 10.8%, 16%);

  /* mainly to fill td for image not found */
  td img {
    background-color: var(--bg-img-none);
  }

  th {
    vertical-align: middle;
  }

  .nostretch {
    /* set width of image td to the minimum */
    width: 1%;
  }

  .media-title {
    text-align: left;
    /* auto adjust width of title */
    max-width: 30svw;
    margin-left: 0;
  }

  a {
    color: var(--bs-body-color);
    text-decoration: none;
  }
}

/* login/register page */
.entry-wrapper {
  height: 100svh;
}

.form-signin {
  max-width: 500px;

  @media screen and (width <= 575px) {
    max-width: 330px;
  }

  h1 {
    margin-top: -6rem !important;
  }

  /* messages list */
  ul {
    margin-bottom: 0;
  }
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1em;

  .import-name {
    font-size: 1.15rem;
    margin-bottom: 0.5em;
    text-align: center;
  }
}

.task-item {
  --bs-accordion-active-color: white;
  --bs-accordion-active-bg: rgb(43, 48, 53);

  .accordion-button:focus {
    box-shadow: none;
  }

  .accordion-button::after {
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23dee2e6'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23dee2e6'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  }
}

.details-top {
  .poster {
    border-radius: 5px;
    width: 14rem;
    aspect-ratio: 2/3;
    object-fit: cover;
  }

  .image-not-found {
    border-radius: 5px;
    width: 14rem;
    object-fit: contain;
    aspect-ratio: 2/3;
    background-color: var(--bg-img-none);
  }

  /* xs */
  @media screen and (width <= 575px) {
    flex-direction: column;

    .image {
      text-align: center;
      margin-bottom: 1.5rem;
    }
  }
}

.details-data {
  margin-left: 1rem;

  .title {
    font-size: 2.25rem;
    font-weight: 700;
  }

  /* link to main details from season details */
  a {
    color: var(--bs-body-color);
  }

  p {
    font-size: 1.25rem;
    /* show only 3 lines of text */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  /* xs */
  @media screen and (width <= 575px) {
    margin-left: 0;

    /* only present in season_details */
    .tv-title {
      width: 100%;
      text-align: center;
    }

    .title {
      width: 100%;
      text-align: center;
      margin-bottom: 1rem;
    }
  }
}

.additional-data {
  margin-block: auto;
  column-gap: 2rem;
}

.episode-img-none {
  background-image: url(https://www.themoviedb.org/assets/2/v4/glyphicons/basic/glyphicons-basic-38-picture-grey-c2ebdbb057f2a7614185931650f8cee23fa137b93812ccb132b9df511df1cfac.svg);
  background-color: var(--bg-img-none);
  background-position: center;
  background-repeat: no-repeat;
  /* aprox height of episode-img */
  height: 170px;
}

.description {
  /* show only 2 lines of text */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.date-btn-group {
  .btn {
    border-color: #495057;

    &:hover {
      color: white;
    }
  }
}

.list-title {
  text-decoration: none;
  color: var(--bs-heading-color);

  &:hover {
    text-decoration: underline;
  }
}

.no-content {
  display: flex;
  flex-direction: column;
  height: 75%;
  justify-content: center;
  align-items: center;
}

/* override select2 with bootstrap dark theme */
.select2-selection {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  border: var(--bs-border-width) solid var(--bs-border-color) !important;

  .select2-selection__choice {
    color: var(--bs-body-color) !important;
    border: var(--bs-border-width) solid var(--bs-border-color) !important;
  }

  .select2-selection__choice__remove:hover {
    background: transparent
      url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e")
      50%/0.75rem auto no-repeat !important;
  }
}

.select2-dropdown {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  border: var(--bs-border-width) solid var(--bs-border-color) !important;

  .select2-results__options {
    .select2-results__option {
      background-color: none !important;
    }

    .select2-results__option--highlighted {
      background-color: hsl(240, 7%, 35%) !important;
      color: white !important;
    }
  }
}

/* center title in calendar, for small screens */
.fc .fc-toolbar-title {
  text-align: center;
}

/* disable text wrapping in calendar events */
.fc-event-main-frame {
  white-space: normal;
}

/* override bootstrap calendar buttons to btn-secondary theme */
.fc-prev-button,
.fc-next-button {
  --bs-btn-color: #fff;
  --bs-btn-bg: #6c757d;
  --bs-btn-border-color: #6c757d;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #5c636a;
  --bs-btn-hover-border-color: #565e64;
  --bs-btn-focus-shadow-rgb: 130, 138, 145;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #565e64;
  --bs-btn-active-border-color: #51585e;
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
