/* 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%);
  --bg-foreground: hsl(210, 10.8%, 16%);
}

.bg-foreground {
  background-color: var(--bg-foreground);
}

p {
  text-wrap: pretty;
}

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

.container {
  padding: 1rem;
}

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

/* alpinejs hide blip */
[x-cloak] { display: none !important; }

/* 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;
}

.chart {
  height: 50svh;
}

#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(8.5rem, 1fr));
}

.media-card {
  /* needed for when image is not found */
  width: 100%;

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

  .image-not-found,
  .lazyload,
  .lazyloading {
    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: var(--bg-foreground);
  -webkit-overflow-scrolling: auto; /* fixes modal fade on iOS */
}

.table {
  --bs-table-bg: var(--bg-foreground);

  /* 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");
  }
}

.banner {
  background-position: center 25%;
  background-repeat: no-repeat;
  background-size: cover;
  height: 350px;
  margin-bottom: 6rem;
  box-shadow: inset 0px 0px 30px #212529;

  .banner-shadow {
    position: relative;
    height: 100%;
    width: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.801), 85%, transparent);
  }
}

.no-backdrop {
  background-color: #212529;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='52' viewBox='0 0 52 52'%3E%3Cpath fill='%239cc0dd' fill-opacity='0.4' d='M0 17.83V0h17.83a3 3 0 0 1-5.66 2H5.9A5 5 0 0 1 2 5.9v6.27a3 3 0 0 1-2 5.66zm0 18.34a3 3 0 0 1 2 5.66v6.27A5 5 0 0 1 5.9 52h6.27a3 3 0 0 1 5.66 0H0V36.17zM36.17 52a3 3 0 0 1 5.66 0h6.27a5 5 0 0 1 3.9-3.9v-6.27a3 3 0 0 1 0-5.66V52H36.17zM0 31.93v-9.78a5 5 0 0 1 3.8.72l4.43-4.43a3 3 0 1 1 1.42 1.41L5.2 24.28a5 5 0 0 1 0 5.52l4.44 4.43a3 3 0 1 1-1.42 1.42L3.8 31.2a5 5 0 0 1-3.8.72zm52-14.1a3 3 0 0 1 0-5.66V5.9A5 5 0 0 1 48.1 2h-6.27a3 3 0 0 1-5.66-2H52v17.83zm0 14.1a4.97 4.97 0 0 1-1.72-.72l-4.43 4.44a3 3 0 1 1-1.41-1.42l4.43-4.43a5 5 0 0 1 0-5.52l-4.43-4.43a3 3 0 1 1 1.41-1.41l4.43 4.43c.53-.35 1.12-.6 1.72-.72v9.78zM22.15 0h9.78a5 5 0 0 1-.72 3.8l4.44 4.43a3 3 0 1 1-1.42 1.42L29.8 5.2a5 5 0 0 1-5.52 0l-4.43 4.44a3 3 0 1 1-1.41-1.42l4.43-4.43a5 5 0 0 1-.72-3.8zm0 52c.13-.6.37-1.19.72-1.72l-4.43-4.43a3 3 0 1 1 1.41-1.41l4.43 4.43a5 5 0 0 1 5.52 0l4.43-4.43a3 3 0 1 1 1.42 1.41l-4.44 4.43c.36.53.6 1.12.72 1.72h-9.78zm9.75-24a5 5 0 0 1-3.9 3.9v6.27a3 3 0 1 1-2 0V31.9a5 5 0 0 1-3.9-3.9h-6.27a3 3 0 1 1 0-2h6.27a5 5 0 0 1 3.9-3.9v-6.27a3 3 0 1 1 2 0v6.27a5 5 0 0 1 3.9 3.9h6.27a3 3 0 1 1 0 2H31.9z'%3E%3C/path%3E%3C/svg%3E");
}

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

  .image-not-found {
    border-radius: 5px;
    width: 12rem;
    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;
    }
  }
}

.content {
  .content-main {
    height: 250px;
  }

  .title {
    font-size: 2.25rem;
    font-weight: 700;
    /* show only 2 line of text */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  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;

    .title {
      margin-bottom: 1rem;
    }

    .content-main {
      height: auto;
    }
  }
}

.details-column {
  width: 12rem; /* need for smaller screens */
  background-color: var(--bg-foreground);

  @media screen and (width <= 991px) {
    width: 100%;
    text-align: center;
  }

  @media screen and (width <= 575px) {
    margin-top: 20rem;
  }
}

.relation {
  background-color: var(--bg-foreground);
}

.episode-card {
  .episode-img {
    border-top-left-radius: var(--bs-border-radius);
    border-bottom-left-radius: var(--bs-border-radius);
    height: 100%;
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
  }

  .episode-img-none,
  .lazyload,
  .lazyloading {
    border-top-left-radius: var(--bs-border-radius);
    border-bottom-left-radius: var(--bs-border-radius);
    height: 100%;
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: contain;
    background-color: var(--bg-img-none);
  }

  .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);
}

.date-range-stats {
  width: 40%;

  @media screen and (width <= 1199px) {
    width: 50%;
  }

  @media screen and (width <= 767px) {
    width: 100%;
  }
}

.contribution-graph {
  --square-size: 15px;
  --gap-size: 0.25rem;
}

.weekday-label {
  height: var(--square-size);
  line-height: var(--square-size);
}

.day {
  width: var(--square-size);
  height: var(--square-size);
  border-radius: 2px;
  position: relative;
}

.day[data-level="0"] {
  background-color: #31363a;
}
.day[data-level="1"] {
  background-color: #216e39;
}
.day[data-level="2"] {
  background-color: #30a14e;
}
.day[data-level="3"] {
  background-color: #40c463;
}
.day[data-level="4"] {
  background-color: #47dd60;
}

.months {
  padding-left: 43px;
}
.month {
  text-align: left;
}

#timeline {
  border: 1px solid;
}

.sg-task {
  border-color: var(--bs-border-color);
  border-radius: 3px;
}

.sg-task-content {
  /* allow text truncation */
  position: relative !important;
  color: #fff;
  padding-left: 5px !important;
}

/* disable clicking on column header */
.column-header-cell {
  pointer-events: none;
}
