:root {
  --light-text: #e0e0e0;
  --dark-text: #333;

  --accent-color: #7dba84;
  --accent-shadow: #5d7460;
  --accent-highlight: #b6e7bc;

  --dark-bg: #303030;
  --dark-bg-translucent: #30303030;
  --dark-shadow: #212121;
  --dark-highlight: #484848;

  --medium-shadow: #626262;

  --light-bg: #f5f5f5;
  --light-shadow: #d9d9d9;
  --light-highlight: #ffffff;

  --link-color: lightskyblue;
  --link-visited: var(--accent-color);
  --link-hover: #4d9455;
  --link-active: #ff4040;
}

body {
  font-family: "Roboto", sans-serif;
  margin: 0;
  padding: 1rem;
  background-color: var(--dark-bg);
  color: var(--light-text);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  /* overflow: hidden; */
}

body.light-mode {
  background-color: var(--light-bg);
  color: var(--dark-text);
}

h1,
h2 {
  color: var(--accent-color);
  text-align: center;
  margin: 0 auto 0.5rem auto;
}

body.light-mode h1,
body.light-mode h2 {
  color: var(--dark-text);
}

.fas {
  color: var(--light-text);
}

body.light-mode .fas {
  color: var(--dark-text);
}

.wrapper {
  background-color: var(--dark-bg-translucent);
  height: -webkit-fill-available;
  width: -webkit-fill-available;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  padding: 1rem;
  display: flex;
  flex-wrap: nowrap;
}

.hidden {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
}

.player {
  height: 80%;
  width: -webkit-fill-available;
  margin: auto;
  border: none;
}

.play-button {
  position: absolute;
  width: fit-content;
  height: fit-content;
  cursor: pointer;
  border-radius: 50px;
  padding: 0;
}

.play-button i {
  font-size: 5rem;
}

:not(.book-cover-wrapper:has(.book-cover)) > .play-button {
  display: none;
}

.close-button {
  position: fixed;
  border-radius: 50px;
  height: fit-content;
  width: fit-content;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  margin-left: auto;
  right: 1rem;
}

.close-button i {
  font-size: 1.5rem;
}

.container {
  padding-inline: 0px;
  display: flex;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-padding: 1.5rem;
  width: fit-content;
  max-height: 88vh;
  margin: auto;
  gap: 20px;
  list-style: none;
  padding: 0 2rem;
  --scrollbar-width: 25px;
  --mask-height: 1em;
  --mask-image-content: linear-gradient(
    to bottom,
    transparent,
    black var(--mask-height),
    black calc(100% - var(--mask-height)),
    transparent
  );
  --mask-size-content: calc(100% - var(--scrollbar-width)) 100%;
  --mask-image-scrollbar: linear-gradient(black, black);
  --mask-size-scrollbar: var(--scrollbar-width) 100%;
  mask-image: var(--mask-image-content), var(--mask-image-scrollbar);
  mask-size: var(--mask-size-content), var(--mask-size-scrollbar);
  mask-position: 0 0, 100% 0;
  mask-repeat: no-repeat, no-repeat;
  flex-direction: column;
  align-items: center;
}

.raised {
  background: var(--dark-bg);
  border-radius: 12px;
  box-shadow: 5px 5px 15px var(--dark-shadow),
    -5px -5px 15px var(--dark-highlight);
  margin: 0.5rem auto;
  padding: 1rem;
  max-width: 800px;
  width: -webkit-fill-available;
  display: grid;
  align-content: center;
  scroll-margin-top: 1rem;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.raised:has(.past) {
  display: none;
}

.raised:has(.current) {
  background: var(--dark-highlight);
}

body:not(.light-mode) .raised:has(.current) .menu-item {
  background: var(--dark-bg);
}

body.light-mode .raised:has(.current) {
  background: var(--accent-color);
}

body.light-mode .raised:has(.current) {
  box-shadow: 5px 5px 15px var(--accent-shadow),
    -5px -5px 15px var(--accent-highlight);
}

button {
  background: var(--dark-bg);
  border: none;
  border-radius: 12px;
  box-shadow: 5px 5px 15px var(--dark-shadow),
    -5px -5px 15px var(--dark-highlight);
  font-size: 1rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
}

button:hover {
  box-shadow: inset 5px 5px 15px var(--dark-shadow),
    inset -5px -5px 15px var(--dark-highlight);
}

iframe {
  display: block;
  width: 100%;
  height: 600px;
  border-radius: 30px !important;
  transition: all 0.3s;
}

.raised strong {
  font-weight: 900;
  font-size: large;
}

.dark-mode-toggle {
  display: flex;
  justify-content: flex-end;
  max-width: calc(800px);
  margin: auto auto 20px auto;
}

.dark-mode-toggle button i {
  font-size: 1.5rem;
  width: 25px;
  height: 25px;
}

body.light-mode .container {
  background: var(--light-bg);
  /* box-shadow: 10px 10px 30px var(--light-shadow),
    -10px -10px 30px var(--light-highlight); */
}

body.light-mode .raised {
  background: var(--light-bg);
  box-shadow: 5px 5px 15px var(--light-shadow),
    -5px -5px 15px var(--light-highlight);
}

body.light-mode button {
  background: var(--light-bg);
  box-shadow: 5px 5px 15px var(--light-shadow),
    -5px -5px 15px var(--light-highlight);
}

body.light-mode button:hover {
  box-shadow: inset 5px 5px 15px var(--light-shadow),
    inset -5px -5px 15px var(--light-highlight);
}

/* Link styles */
a {
  text-decoration: none;
}

body:not(.light-mode) a:link {
  color: var(--link-color);
}

body:not(.light-mode) a:visited {
  color: var(--link-visited);
  filter: invert(100%);
}

body:not(.light-mode) a:hover {
  color: var(--link-hover);
}

a:hover {
  color: var(--link-hover);
}

a:active {
  color: var(--link-active);
}

.link.discord:link,
.link.discord:visited {
  color: #5865f2;
}

.link.discord:hover {
  color: #eb459e;
}

.storygraph-logo,
.audiobookshelf-logo {
  width: 19px;
  display: flex;
}

.storygraph-logo {
  filter: brightness(0.8);
}

.link.storygraph:hover .storygraph-logo {
  filter: saturate(2);
}

body.light-mode .current .storygraph-logo {
  filter: brightness(1);
}

body.light-mode .storygraph-logo {
  filter: brightness(0.3);
}

body.light-mode .link.storygraph:hover .storygraph-logo {
  filter: brightness(0.5);
}

.link.audiobookshelf:hover .audiobookshelf-logo {
  filter: saturate(2);
}

/* Event Card Styles */
.event-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.event-card__title,
.event-card__host {
  margin: 0;
  font-size: 1.5rem;
  text-align: left;
}

.event-card__host {
  font-size: 1rem;
}

.event-card__date,
.event-card__date div {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.event-card__date div {
  flex-direction: column;
  gap: 0;
}

.event-card__links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: bold;
}

.event-card__book-description {
  margin: 1rem 0;
  line-height: 1.6;
  white-space: pre-wrap;
  padding: 1rem;
}

.event-card__book {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--dark-highlight);
}

.event-card__book {
  padding-top: 1.5rem;
  border-top: 1px solid var(--dark-highlight);
}

body:not(.light-mode) .raised:has(.current) .event-card__book {
  padding-top: 1.5rem;
  border-top: 1px solid var(--dark-bg);
}

body:not(.light-mode) .event-card__accent {
  color: var(--accent-color);
}

.event-card__accent {
  font-weight: bold;
}

.event-card__book-items {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.5rem;
}

.book-item {
  background: var(--dark-highlight);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  width: fit-content;
  height: min-content;
  margin-bottom: 0.5rem;
}

.current .book-item {
  background-color: var(--dark-bg);
}

.book-cover {
  border-radius: 1rem;
  height: fit-content;
  width: -webkit-fill-available;
}

.book-cover-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.book-details {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
}

.book-item strong {
  font-size: initial;
}

.book-tags {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.4em;
  text-align: center;
}

.book-tags .book-item {
  background-color: var(--accent-color);
  color: var(--dark-text);
  font-weight: bold;
}

body.light-mode .book-tags .book-item {
  background-color: var(--dark-text);
  color: var(--light-text);
}

/* Light mode styles */

body.light-mode .book-item {
  background: var(--light-highlight);
}

body.light-mode .current .book-item {
  background: var(--accent-highlight);
}

body.light-mode .current .book-tags .book-item {
  color: var(--dark-text);
}

.event-card__book-items > .book-item {
  font-weight: bold;
  font-size: large;
  text-align: center;
}

.spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 10px solid rgba(0, 0, 0, 0.5);
    border-top: 10px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 2s ease infinite;
    z-index: 10;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .event-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .event-card__title {
    font-size: 1.25rem;
  }

  .event-card__book-items {
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
  }

  .book-details {
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
    align-content: center;
  }

  .book-details a.book-item {
    text-align: center;
  }

  .book-cover,
  .book-item,
  .book-tags {
    width: -webkit-fill-available;
  }

  .container {
    width: 100%;
    --scrollbar-width: 0px;
    left: -2rem;
    position: relative;
  }

  .book-tags {
    justify-content: center;
  }

  iframe {
    height: 400px;
  }

  ::-webkit-scrollbar {
    display: none;
  }

  ::-webkit-scrollbar-track {
    display: none;
  }

  ::-webkit-scrollbar-thumb {
    display: none;
  }
}

/* width */
::-webkit-scrollbar {
  width: 25px;
}

/* Track */
::-webkit-scrollbar-track {
  visibility: hidden;
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 50px;
  background-clip: content-box;
  border: solid transparent 7px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--link-hover);
  border-radius: 50px;
  background-clip: content-box;
  border: solid transparent 7px;
}

body.light-mode::-webkit-scrollbar-thumb,
body.light-mode ::-webkit-scrollbar-thumb {
  background: var(--dark-text);
  border-radius: 50px;
  background-clip: content-box;
  border: solid transparent 7px;
}

body.light-mode::-webkit-scrollbar-thumb:hover,
body.light-mode ::-webkit-scrollbar-thumb:hover {
  background: var(--mid-shadow);
  border-radius: 50px;
  background-clip: content-box;
  border: solid transparent 7px;
}
