* {
  box-sizing: border-box;
}

/* define the light theme (default) */
:root {
  --bg-color: white; /* background color */
  --text-color: black; /* text color */
  --border-color: black;
  --btn-hvr-bg-color: black;
  --btn-hvr-color: white;
  --btn-hvr-brd-color: #4a4a4a;
  --jlf-grad-start: rgb(169, 19, 215);
  --jlf-grad-end: rgb(0,79,172);
  --jlf-bg-hvr: #480090;
  --jlf-brd-hvr: #a200f3;
  --jls-brd: #0126bd;
  --jls-title: #0126bd;
  --jls-bg-hvr: #020061;
  --jls-brd-hvr: #005ae0;
  --emb-brd: #16860e;
  --emb-tit: #1ea214;
  --emb-bg-hvr: #0c6d05;
  --emb-brd-hvr: #52b54b; /* actual emby logo color */
  --red-srv-invert: white;
  --jlf-btn: #7800ef;
  --emb-btn: #16860e;
  --jls-btn: #0126bd;
  --jlf-cli-cell: rgba(151,15,194,0.3);
  --emb-cli-cell: rgba(82,181,75,0.3);
  --ban-notice: rgba(255,0,0,0.36);
  /*--ban-info: #000080;*/
}

/* define the dark theme */
.dark-theme {
  --bg-color: black; /* background color */
  --text-color: white; /* text color */
  --border-color: white;
  --btn-hvr-bg-color: white;
  --btn-hvr-color: black;
  --btn-hvr-brd-color: #aeaeae;
  --logo-filter: invert(100%);
  --jlf-grad-start: rgb(211, 75, 253);
  --jlf-grad-end: rgb(83, 203, 255);
  --jlf-bg-hvr: #6000bf;
  --jlf-brd-hvr: #b300f3;
  --jls-brd: #3e62ff;
  --jls-title: #3e62ff;
  --jls-bg-hvr: #0401b0;
  --jls-brd-hvr: #4b72ff;
  --emb-brd: #7eff75;
  --emb-tit: #7eff75;
  --emb-bg-hvr: #008648;
  --emb-brd-hvr: #7eff75;
  --jlf-btn: #a54bff;
  --emb-btn: #7eff75;
  --jls-btn: #3e62ff;
  --jlf-cli-cell: #400080;
  --emb-cli-cell: #0d6b06;
  --ban-notice: rgba(255,0,0,0.6);
  /*--ban-info: #50cdfe;*/
}

::selection {
  background: var(--text-color); /* webkit & blink browsers */
  color: var(--bg-color);
}
::-moz-selection {
  background: var(--text-color); /* gecko browsers */
  color: var(--bg-color);
}

html {
  font-family: Roboto, sans-serif;
  font-size: 24px;
  font-weight: 500;
  background-color: var(--bg-color); /* apply variables for dark / light color scheme */
  color: var(--text-color);
  text-size-adjust: none;
  height: -webkit-fill-available;
  scroll-behavior: smooth;
}

body {
  line-height: 1.2;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 0.6rem 1.2rem;
  min-height: 100vh;
}

a {
  font-size: inherit;
  color: inherit;
  text-decoration: none;
}

button {
  outline: none;
  border: none;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.body-wrapper {
  display: flex;
  flex-direction: row;
  gap: 1.2rem;
}

/*
.header, .navigation-section, .content-wrapper, .footer {
  padding: 0.6rem 1.2rem;
}
*/

/* HEADER CSS */
.header {
  position: sticky;
  top: 0.6rem;
  z-index: 2;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: fit-content;
  padding: 0.2rem 0.4rem;
  margin: -0.2rem -0.4rem;
}

.logo-img {
  max-height: 1.5rem;
  width: auto;
  filter: var(--logo-filter);
}

.logo-text {
  padding: 0 0.6rem;
  font-weight: 700;
  font-size: 130%;
}

#home-redirect:hover {
  cursor: pointer;
}

.switch {
  align-self: flex-end;
  padding-left: 0.4rem;
  margin-left: -0.4rem;
}

.inner-switch {
  display: inline-block;
  cursor: pointer;
  border: 0.16rem solid var(--border-color);
  border-radius: 0.4rem;
  padding: 0.2rem 0.4rem;
  margin-left: 0.4rem;
  text-align: center;
}

.header-item.inner-switch {
  display: none;
}

/* Navigation */
.navigation-section {
  position: sticky;
  top: 3.6rem; /* set by navbar-scroll.js */
  z-index: 1;
  left: 0;
  width: 33vw;
  max-height: calc(100vh - 12rem);
  transition: top 0.6s ease-in-out;

}

.navbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

a.nav, button.nav {
  padding: 0.2rem 0.4rem; /* padding for nav-border */
  border: 0.16rem solid;
  border-radius: 0.4rem;
  border-color: var(--border-color);
  color: var(--text-color);
}

a.nav:hover, button.nav:hover {
  color: var(--btn-hvr-color);
  background: var(--btn-hvr-bg-color);
  border: 0.16rem solid var(--btn-hvr-brd-color);
}

.toggle-nav.active {
  color: var(--btn-hvr-color);
  background: var(--btn-hvr-brd-color);
  border: 0.16rem solid var(--btn-hvr-bg-color);
}

.inline-link {
  text-decoration: underline;
}

.inline-link:hover {
  text-decoration: none;
}

.link-directory {
  overflow: scroll;
}

/* Content */
.content-wrapper {
  right: 0;
  width: 67vw;
  display: flex;
  flex-direction: column;
}

.main-article {
  display: flex;
  flex-direction: column;
  scroll-margin-top: 24rem;
}

/* startpage */
.services-segment {
  display: grid;
  grid-auto-rows: 1fr;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.8rem;
}

.redirect-container {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 0.6rem 1.2rem;
  border: 0.18rem solid;
  border-radius: 0.4rem;
}

.redirect-title {
  display: flex;
  flex-direction: row;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.redirect-logo {
  max-width: 1.2rem;
  max-height: 1.2rem;
  margin-right: 0.6rem;
  align-self: center;
}

.redirect-header {
  align-self: center;
  font-size: 110%;
}

.service-description {
  font-size: 90%;
}

.redirect-container:hover {
  cursor: pointer;
}

.redirect-container:active:hover {
  transition: none;
}

/* animated border gradient w/o firefox support up to v124 */
.redirect-container#jellyfin-redirect {
  background: var(--jlf-btn);
  background: linear-gradient(var(--bg-color), var(--bg-color)) padding-box,
              linear-gradient(var(--gradient-angle), var(--jlf-grad-start) 0%, var(--jlf-grad-end) 100%) border-box;
  animation: 6s rotate linear infinite;
  border-color: transparent;
}

@keyframes rotate {
  to {
    --gradient-angle: 360deg;
  }
}

@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* fallback for firefox animated border gradient pre v124 */
@-moz-document url-prefix() {
  .redirect-container#jellyfin-redirect {
    border-color: var(--jlf-btn);
  }
}

.nav#jellyfin-btn {
  color: var(--jlf-btn);
  background: transparent;
  border-color: var(--jlf-btn);
}

#jellyfin-redirect:hover, .nav#jellyfin-btn:hover {
  background: var(--jlf-bg-hvr);
  border-color: var(--jlf-brd-hvr);
  color: #ffffff;
}

.redirect-header#jellyfin-title {
  /* gradient text for jellyfin-title */
  background-color: var(--jlf-btn);
  background-image: linear-gradient(var(--gradient-angle), var(--jlf-grad-start) 0%, var(--jlf-grad-end) 100%);
  animation: 6s rotate linear infinite;
  background-origin: padding-box;
  background-size: 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -moz-background-clip: text;
  -webkit-text-fill-color: transparent;
  -moz-text-fill-color: transparent;
}

#jellyfin-redirect:hover .redirect-header#jellyfin-title {
  background-color: #ffffff;
  -webkit-text-fill-color: white;
  -moz-text-fill-color: white;
}

.redirect-container#jellyseerr-redirect {
  border-color: var(--jls-brd);
}

#jellyseerr-title {
  color: var(--jls-title)
}

.nav#jellyseerr-btn {
  color: var(--jls-btn);
  border-color: var(--jls-btn);
}

#jellyseerr-redirect:hover #jellyseerr-title, .nav#jellyseerr-btn:hover {
  color: #ffffff;
}

.redirect-container#jellyseerr-redirect:hover, .nav#jellyseerr-btn:hover {
  background: var(--jls-bg-hvr);
  border-color: var(--jls-brd-hvr);
  color: #ffffff;
}

.redirect-container#emby-redirect {
  border-color: var(--emb-brd)
}

#emby-title {
  color: var(--emb-tit)
}

.nav#emby-btn {
  color: var(--emb-btn);
  border-color: var(--emb-btn);
}

#emby-redirect:hover #emby-title, .nav#emby-btn:hover {
  color: var(--red-srv-invert);
}

#emby-redirect:hover, .nav#emby-btn:hover {
  background: var(--emb-bg-hvr);
  border-color: var(--emb-brd-hvr);
  color: var(--red-srv-invert);
}

/* content */
.component.column {
  columns: 14rem auto;
}

.content-section {
  margin-bottom: 1.2rem;
  break-inside: avoid-column;
}

h1 {
  display: none;
  font-weight: 700;
  font-size: 130%;
  margin-bottom: 1.2rem;
}

h1.legal, h1.error {
  display: block;
}

h2 {
  font-size: 110%;
  margin-bottom: 0.9rem;
}

h3 {
  font-size: 90%;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.text {
  font-size: 90%;
  margin-bottom: 0.6rem;
}

.text.single:not(:last-child) {
  margin-bottom: 0.9rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.content-cell {
  display: flex;
  flex-direction: column;
  height: fit-content;
  padding: 0.6rem 1.2rem;
  border-radius: 0.4rem;
}

.content-cell#jellyfin-client {
  background-color: var(--jlf-cli-cell)
}

.content-cell#emby-client {
  background-color: var(--emb-cli-cell)
}

.cell-text {
  font-size: 90%;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
}

/* faq */
.faq-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.faq-heading, .faq-text {
  margin-bottom: 0;
}

.faq-text {
  font-size: 90%;
}

/* Legal */
.content-wrapper.legal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.2rem;
}

.component.legal-segment, .component.privacy-segment {
  columns: 1;
}

.content-section.legal {
  margin-bottom: 0.6rem;
}

/* Error pages */
.main-article.error {
  margin-top: 1.2rem;
}

/* FOOTER CSS */
.footer {
  position: sticky;
  bottom: 0.6rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 0.2rem;
  margin-top: auto;
}

.footer-item {
  width: fit-content;
  padding: 0.2rem 0.4rem;
  margin: 0 -0.4rem;
}

.header-item, .footer-item {
  -webkit-backdrop-filter: blur(1rem); /* blur webkit fix */
  backdrop-filter: blur(1rem);
  border-radius: 0.4rem;
}

.link:hover {
  text-decoration: wavy underline;
  -webkit-text-decoration: wavy underline;
}

.footer-nav {
  display: flex;
  flex-direction: row;
}

.footer-infill {
  padding: 0 0.3rem;
}

.footer-nav.narrow {
  display: none;
}

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

/* NOTICE SECTION / BANNER */
.notice-section {
  display: none;
  flex-direction: column;
  gap: 0.6rem 0;
  align-items: center;
  position: fixed;
  top: 0.6rem;
  left: 25%;
  right: 25%;
  z-index: 3;
}

.banner {
  margin-top: 0.6rem;
  border-radius: 0.4rem;
  padding: 0.6rem 1.2rem;
  font-size: 90%;
  -webkit-backdrop-filter: blur(1rem); /* blur webkit fix */
  backdrop-filter: blur(1rem);
}

.banner.container-notice {
  background-color: var(--ban-notice);
}

/*
.banner.container-info {
  background-color: var(--ban-info);
}
*/

.close-banner {
  float: right;
  margin: 0 0 0.2rem 0.4rem;
}

.close-symbol {
  height: 0.9rem;
  width: 0.9rem;
}

.close-path {
  fill: black;
}






/* Popup */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  height: 100vh; /* entire viewport */
  width: 100vw; /* entire viewport */
}

.popup-window {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  align-items: center;
  justify-content: center;
  border: 0.16rem solid;
  border-radius: 0.4rem;
  border-color: var(--border-color);
  padding: 1.2rem 1.8rem;
  -webkit-backdrop-filter: blur(1rem); /* blur webkit fix */
  backdrop-filter: blur(1rem);
  margin: 0.6rem 1.2rem;
}

.popup-content {
  margin-top: 30vh;
}

.popup-header {
  font-weight: 700;
  font-size: 130%;
  text-align: center;
  margin-bottom: 1.2rem;
}

.popup-text {
  text-align: center;
  max-width: 24rem;
}

.popup-buttons {
  display: flex;
  justify-content: end;
  width: 100%;
  gap: 0.6rem;
  margin-top: auto;
}

.continue-btn {
  width: fit-content;
}