@import url("https://fonts.googleapis.com/icon?family=Material+Icons");

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0; /* Removes default margins from common elements */
}

ul,
ol {
  list-style: none; /* Removes default bullet points/numbers */
  padding: 0;
}

i.mi {
  font-family: "Material Icons";
  font-style: normal;
}
:root {
  --color-red: #bf092f;
  --color-red-fade: #bf093083;
  --color-blue-1: #132440;
  --color-blue-2: #16476a;
  --color-blue-3: #3b9797;
  --color-blue-1-fade: #13244083;
  --color-blue-2-fade: #16476a83;
  --color-blue-3-fade: #3b979783;
  --border-1: rgba(128, 128, 128, 0.2);
  --border-2: rgba(128, 128, 128, 0.5);
  --box-shadow-1: 0px 5px 15px 5px var(--border-1);
  --box-shadow-2: 0px 1px 5px 1px var(--color-blue-3-fade);
  --backdrop-1: rgba(180, 180, 180, 0.1);
  --backdrop-2: rgba(180, 180, 180, 0.2);
  --color-yellow-1: rgb(255, 217, 0);
  --color-yellow-2: rgb(255, 187, 0);
  --animate-pulse: 1s animate-pulse ease infinite;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  height: 100vh;
  background: whitesmoke;
  text-align: center;
}

.container {
  display: grid;
  height: 100vh;
  grid-template-columns: 300px 1fr;
}
.container-login {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}
.sidebar {
  width: 300px;
  height: 100vh;
  background-color: var(--color-blue-1);
  color: white;
  position: fixed;
  top: 0;
  z-index: 10;
}

.sidebar.hide {
  transform: translateX(-100%);
}
.sidebar.hide + main {
  transform: translateX(-300px);
  width: 100vw;
  .title {
    margin-left: 2em;
  }
}
.navbar {
  background: var(--color-blue-1-fade);
  backdrop-filter: blur(10px);
  height: 100%;
}
.burger-menu {
  position: fixed;
  font-size: 1.5rem;
  top: 0.5em;
  left: 0.25em;
  z-index: -1;
  cursor: pointer;
  color: var(--color-blue-1);
  &:hover {
    color: var(--color-blue-2);
  }
}
.menu-close {
  position: absolute;
  font-size: 1.5rem;
  top: 0.75em;
  left: 260px;
  cursor: pointer;
  &:hover {
    color: var(--color-red);
  }
}
.sidebar.hide .burger-menu {
  z-index: 20;
  margin-left: 300px;
}

.nav-container {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.5rem;
  padding: 0.5em 1em;
  font-weight: bold;
  width: 100%;
  color: white;
  background-color: var(--color-blue-2);
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-direction: column;
  width: 100%;
  list-style: none;
  font-size: 1.5rem;
}

.nav-links li {
  width: 100%;
  display: flex;
  align-items: center;
  height: 2.5em;
  font-size: 1.25rem;
}
.nav-links li.user {
  background-color: var(--color-blue-2);
  border-radius: 3em;
  height: 3em;
  width: fit-content;
  align-self: center;
  a {
    width: fit-content;
    height: 2.5em;
    display: flex;
    margin-bottom: 1em;
    color: var(--color-blue-3);
    font-weight: bold;
  }
  i {
    color: white;
    background-color: var(--color-blue-1);
    height: 2em;
    aspect-ratio: 1/1;
    border-radius: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
.nav-links a {
  width: 100%;
  display: flex;
  padding: 1em;
  justify-content: flex-start;
  align-items: center;
  gap: 1em;
  color: #fff;
  text-decoration: none;
  padding-bottom: 0.25rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover {
  color: var(--color-blue-3);
}

.nav-links li:has(a.active) a.active {
  color: var(--color-blue-3);
  font-weight: bold;
  border-bottom: 1px solid var(--color-blue-2);
  position: relative;
}

.content {
  grid-column: 2;
  display: flex;
  flex-direction: column;
}

i#theme-toggle{
  cursor: pointer;
  
}
.add-games{
  animation: 0.3s popup ease-in forwards;
}
@keyframes popup{
  from{
    opacity: 0;
    scale: 0.95;
  }
  to{
    opacity: 100;
    scale: 1;
  }
}

.content > .total-counts {
  display: flex;
  flex-wrap: wrap;
  height: fit-content;
  justify-content: space-around;
  width: 100%;
  padding: 3em;
  gap: 1em;
  background-color: var(--backdrop-1);
}

.total-counts > .items {
  flex: 1;
  padding: 2em;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 0.5em;
  gap: 0.5em;
  border: 1px solid var(--border-1);
  background-color: white;
  box-shadow: var(--box-shadow-1);
  cursor: pointer;
  transition: 0.3s scale ease-in-out, 0.5s color ease-in-out;
  position: relative;
  z-index: 5;
  &::before {
    content: "";
    background-color: var(--backdrop-1);
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 1em;
    border-radius: 0.5em 0 0 0.5em;
    transition: 0.3s background-color ease-in-out;
  }
  &::after {
    font-family: "Material Icons";
    position: absolute;
    font-size: 5rem;
    bottom: 0.2em;
    right: 0.2em;
    z-index: 1;
  }
  .title {
    flex: 1;
    font-size: 1.5rem;
    text-wrap: nowrap;
    font-weight: bold;
  }
  .count {
    aspect-ratio: 1/1;
    padding: 1em;
    border-radius: 2em;
    font-weight: bold;
    font-size: 1.2rem;
    color: white;
  }
  &:hover {
    scale: 1.02;
  }

  &:first-child .count {
    color: var(--color-red);
    background-color: var(--color-red-fade);
  }
  &:nth-child(2) .count {
    color: var(--color-blue-2);
    background-color: var(--color-blue-2-fade);
  }
  &:last-child .count {
    color: var(--color-blue-3);
    background-color: var(--color-blue-3-fade);
  }
  &:first-child:hover {
    color: var(--color-red);
  }
  &:nth-child(2):hover {
    color: var(--color-blue-2);
  }
  &:last-child:hover {
    color: var(--color-blue-3);
  }
  &:first-child:hover::before {
    color: var(--color-red);
    background-color: var(--color-red-fade);
  }
  &:nth-child(2):hover::before {
    color: var(--color-blue-2);
    background-color: var(--color-blue-2-fade);
  }
  &:last-child:hover::before {
    color: var(--color-blue-3);
    background-color: var(--color-blue-3-fade);
  }
  &:first-child::after {
    content: "sports_esports";
    color: var(--color-red-fade);
  }
  &:nth-child(2)::after {
    content: "terminal";
    color: var(--color-blue-2-fade);
  }
  &:last-child::after {
    content: "category";
    color: var(--color-blue-3-fade);
  }
}

button.primary {
  background-color: var(--color-blue-3);
  color: white;
  border: none;
  border-radius: 0.25em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.5em;
  border: 2px solid var(--color-blue-3);
  transition: 0.3s all ease-in-out;
  i {
    font-weight: bold;
    font-size: 1.2rem;
  }
  &:hover {
    color: var(--color-blue-3);
    background-color: white;
  }
}
.content.games {
  align-items: center;
}
.content.games .header {
  background-color: var(--backdrop-1);
  width: 100%;
  padding: 1em 2em;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5em;
  align-items: center;
  h1 {
    font-size: 1.5rem;
    white-space: nowrap;
  }
}
.content.games form.search-form {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  input {
    width: 500px;
    height: 3em;
    border-radius: 1.5em 0 0 1.5em;
    border: 1px solid var(--border-2);
    padding: 1em;
  }
  input:focus {
    border: 1px solid var(--color-blue-3);
    outline: none;
  }
  button {
    height: 3em;
    border-radius: 0 1.5em 1.5em 0;
  }
}
.content.games > .subcontainer {
  margin-top: 0.5em;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 1em;
  width: 80%;
  a {
    text-decoration: none;
  }
}

.games-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: var(--box-shadow-1);
  border-radius: 0.5em;
  overflow: hidden;
}

.games-table thead {
  background: var(--color-blue-2);
}

.games-table th,
.games-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-1);
}

td.icon {
  i {
    color: var(--color-red);
    padding: 0.25em;
    border-radius: 1em;
    background-color: var(--backdrop-2);
    position: relative;
    &::before {
      content: "";
      position: absolute;
      border-radius: 1em;
      background-color: green;
      inset: inherit;
      padding: 0.1em;
      left: 0.1em;
      border-radius: 1em;
      animation: var(--animate-pulse);
    }
  }
}

.games-table th {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.games-table tbody tr:hover {
  background: var(--backdrop-1);
}

.games-table td {
  font-size: 0.95rem;
  color: #333;
}

.games-table tbody tr:last-child td {
  border-bottom: none;
}

th:last-child,
td:last-child {
  text-align: center;
}
td:nth-child(2) {
  color: var(--color-red);
  font-weight: bold;
}
td:nth-last-child(3) {
  line-height: 2em;
}
button.delete {
  background-color: transparent;
  border: none;
  color: var(--color-red-fade);
  font-size: 1.2rem;
  transition: 0.3s all ease-in-out;
  &:hover {
    color: var(--color-red);
  }
}
button.edit {
  background-color: transparent;
  border: none;
  color: var(--color-blue-1-fade);
  font-size: 1.2rem;
  transition: 0.3s all ease-in-out;
  &:hover {
    color: var(--color-blue-1);
  }
}

.content.add-games {
  width: 100%;
  max-width: 600px;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  padding: 4em;
  border: 1px solid var(--border-1);
  height: fit-content;
  margin-top: 3em;
  border-radius: 1em;
  background-color: white;
  box-shadow: var(--box-shadow-1);
  position: relative;
  a {
    align-self: flex-end;
    position: absolute;
    top: 1em;
    right: 1em;
  }
  form {
    width: 100%;
    max-width: 500px;
  }
}
.form-group {
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.form-group label {
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-group input,
textarea,
select {
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 100%;
  resize: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  outline: none;
  &:focus {
    border-color: var(--color-blue-3);
  }
}

.form-group button {
  width: fit-content;
  align-self: flex-end;
}

.hint {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #666;
}

button.secondary {
  color: white;
  border: 2px solid var(--border-1);
  border-radius: 0.25em;
  padding: 0.5em;
}
a {
  text-decoration: none;
}
button.close {
  background-color: white;
  border: 1px solid var(--border-1);
  padding: 0.25em;
  aspect-ratio: 1/1;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 1em;
  color: var(--color-red);
  font-size: 1rem;
  font-weight: bold;
  justify-self: flex-end;
  transition: 0.3s all ease-in-out;
  &:hover {
    color: white;
    background-color: var(--color-red);
  }
}
h1.title {
  color: var(--color-blue-2);
}

.multi-select {
  position: relative;
  width: 100%;
}

.multi-select-trigger {
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
}

.multi-select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  display: none;
  max-height: 220px;
  overflow-y: auto;
  z-index: 10;
}

.multi-select.open .multi-select-options {
  display: block;
}

.option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  span {
    width: 100%;
  }
}

.option:hover {
  background-color: var(--color-blue-3);
}

.option input {
  accent-color: var(--primary);
}

span.tag {
  background-color: var(--color-blue-3-fade);
  color: var(--color-blue-3);
  padding: 0.25em 0.5em;
  border-radius: 0.25em;
}

.update {
  color: var(--color-yellow-2);
}

button.primary.update {
  background-color: var(--color-yellow-2);
  color: white;
  text-shadow: 1px 1px var(--border-1);
  border-color: var(--color-yellow-2);
  &:hover {
    background-color: white;
    color: var(--color-yellow-2);
  }
}

.hero-icon {
  font-size: 1.5rem;
  border: 1px solid;
  padding: 0.5em;
  aspect-ratio: 1/1;
  border-radius: 1.5em;
  color: white;
}

.hero-icon.update {
  background-color: var(--color-yellow-2);
  text-shadow: 2px 1px var(--border-1);
}

.hero-icon.new {
  background-color: var(--color-blue-3);
  text-shadow: 2px 1px var(--border-1);
}

/* Forms error message */
.error-message {
  color: rgb(255, 49, 49);
  background-color: rgba(255, 0, 0, 0.267);
  width: 100%;
  padding: 0.5em;
  border-radius: 0.25em;
  margin-bottom: 2em;
}

.random-games-container {
  display: flex;
  flex-direction: column;
}
.random-games-container > .game-card-container {
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 0.5em;
  padding: 1em 3em;
}
.game-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1em;
  border: 1px solid var(--border-1);
  border-radius: 0.5em;
  padding-bottom: 2em;
  background-color: white;
  box-shadow: var(--box-shadow-1);
  transition: 0.3s all ease-in-out;
  &:hover {
    background-color: var(--color-blue-3-fade);
  }
}
.game-card > .game-thumbnail {
  height: 200px;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: inherit;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.game-card > .game-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-blue-2);
}

@media (max-width: 460px) {
  .content.games .header .search-form {
    max-width: 360px;
  }
  .subcontainer {
    width: 80vw !important;
    align-items: center !important;
    flex-direction: column-reverse !important;
  }
  .random-games-container h1.title {
    text-align: left;
    margin-left: 1em;
  }
  table {
    width: 380px !important;
  }
  th,
  tr,
  td {
    font-size: 0.5rem !important;
  }
  .content.content.add-games {
    border-radius: 0;
    box-shadow: none;
    h1.title {
      text-align: center;
      width: 100%;
      align-self: flex-end !important;
    }
  }
}

/* Delete Dialog styles */

dialog[open].delete-dialog {
  border: 1px solid var(--border-1);
  width: fit-content;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  padding: 1em 2em;
  .dialog.message {
    color: var(--color-red);
  }
  &::backdrop {
    backdrop-filter: blur(5px);
    background-color: rgba(0, 0, 0, 0.7);
  }
  button {
    padding: 1em 2em;
    font-size: 1rem;
    border: none;
  }
  button.dialog.delete {
    background-color: var(--color-red);
    color: white;
  }
}
.dialog-btn-containers {
  display: flex;
  gap: 1em;
}
dialog[open].confirm-dialog {
  border: 1px solid var(--border-1);
  width: fit-content;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  padding: 1em 2em;
  &::backdrop {
    backdrop-filter: blur(5px);
    background-color: rgba(0, 0, 0, 0.7);
  }
  button {
    padding: 1em 2em;
    font-size: 1rem;
    border: none;
    border-radius: 0.25em;
    border: 1px solid canvas;
  }
  button.dialog.action {
    color: white;
    &:hover {
      color: var(--color-blue-3);
      border: 1px solid var(--color-blue-3);
    }
  }
}
@keyframes animate-pulse {
  from {
    scale: 1;
    opacity: 1;
  }
  to {
    scale: 1.5;
    opacity: 0;
  }
}

/* Toggle support */
html[data-theme="dark"]{
  color-scheme: dark;
}
html[data-theme="light"]{
  color-scheme: light;
}

/* Light mode */
html[data-theme="light"]{
  :root {
    --color-red: #bf092f;
    --color-red-fade: #bf093083;
    --color-blue-1: #132440;
    --color-blue-2: #16476a;
    --color-blue-3: #3b9797;
    --color-blue-1-fade: #13244083;
    --color-blue-2-fade: #16476a83;
    --color-blue-3-fade: #3b979783;
    --border-1: rgba(128, 128, 128, 0.2);
    --border-2: rgba(128, 128, 128, 0.5);
    --box-shadow-1: 0px 5px 15px 5px var(--border-1);
    --box-shadow-2: 0px 1px 5px 1px var(--color-blue-3-fade);
    --backdrop-1: rgba(180, 180, 180, 0.1);
    --backdrop-2: rgba(180, 180, 180, 0.2);
    --color-yellow-1: rgb(255, 217, 0);
    --color-yellow-2: rgb(255, 187, 0);
    --animate-pulse: 1s animate-pulse ease infinite;
  }
  input, textarea{
    background-color: white;
  }
  body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
      Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
      sans-serif;
    height: 100vh;
    background: whitesmoke;
    text-align: center;
  }

  .container {
    display: grid;
    height: 100vh;
    grid-template-columns: 300px 1fr;
  }
  .container-login {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
  }
  .sidebar {
    width: 300px;
    height: 100vh;
    background-color: var(--color-blue-1);
    color: white;
    position: fixed;
    top: 0;
    z-index: 10;
  }

  .sidebar.hide {
    transform: translateX(-100%);
  }
  .sidebar.hide + main {
    transform: translateX(-300px);
    width: 100vw;
    .title {
      margin-left: 2em;
    }
  }
  .navbar {
    background: var(--color-blue-1-fade);
    backdrop-filter: blur(10px);
    height: 100%;
  }
  .burger-menu {
    position: fixed;
    font-size: 1.5rem;
    top: 0.5em;
    left: 0.25em;
    z-index: -1;
    cursor: pointer;
    color: var(--color-blue-1);
    &:hover {
      color: var(--color-blue-2);
    }
  }
  .menu-close {
    position: absolute;
    font-size: 1.5rem;
    top: 0.75em;
    left: 260px;
    cursor: pointer;
    &:hover {
      color: var(--color-red);
    }
  }
  .sidebar.hide .burger-menu {
    z-index: 20;
    margin-left: 300px;
  }

  .nav-container {
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
  }
  .logo {
    font-size: 1.5rem;
    padding: 0.5em 1em;
    font-weight: bold;
    width: 100%;
    color: white;
    background-color: var(--color-blue-2);
    text-decoration: none;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    list-style: none;
    font-size: 1.5rem;
  }

  .nav-links li {
    width: 100%;
    display: flex;
    align-items: center;
    height: 2.5em;
    font-size: 1.25rem;
  }
  .nav-links li.user {
    background-color: var(--color-blue-2);
    border-radius: 3em;
    height: 3em;
    width: fit-content;
    align-self: center;
    a {
      width: fit-content;
      height: 2.5em;
      display: flex;
      margin-bottom: 1em;
      color: var(--color-blue-3);
      font-weight: bold;
    }
    i {
      color: white;
      background-color: var(--color-blue-1);
      height: 2em;
      aspect-ratio: 1/1;
      border-radius: 3em;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
  .nav-links a {
    width: 100%;
    display: flex;
    padding: 1em;
    justify-content: flex-start;
    align-items: center;
    gap: 1em;
    color: #fff;
    text-decoration: none;
    padding-bottom: 0.25rem;
    transition: color 0.2s ease, border-color 0.2s ease;
  }

  .nav-links a:hover {
    color: var(--color-blue-3);
  }

  .nav-links li:has(a.active) a.active {
    color: var(--color-blue-3);
    font-weight: bold;
    border-bottom: 1px solid var(--color-blue-2);
    position: relative;
  }

  .content {
    grid-column: 2;
    display: flex;
    flex-direction: column;
  }

  .content > .total-counts {
    display: flex;
    flex-wrap: wrap;
    height: fit-content;
    justify-content: space-around;
    width: 100%;
    padding: 3em;
    gap: 1em;
    background-color: var(--backdrop-1);
  }

  .total-counts > .items {
    flex: 1;
    padding: 2em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 0.5em;
    gap: 0.5em;
    border: 1px solid var(--border-1);
    background-color: white;
    box-shadow: var(--box-shadow-1);
    cursor: pointer;
    transition: 0.3s scale ease-in-out, 0.5s color ease-in-out;
    position: relative;
    z-index: 5;
    &::before {
      content: "";
      background-color: var(--backdrop-1);
      position: absolute;
      top: 0;
      left: 0;
      height: 100%;
      width: 1em;
      border-radius: 0.5em 0 0 0.5em;
      transition: 0.3s background-color ease-in-out;
    }
    &::after {
      font-family: "Material Icons";
      position: absolute;
      font-size: 5rem;
      bottom: 0.2em;
      right: 0.2em;
      z-index: 1;
    }
    .title {
      flex: 1;
      font-size: 1.5rem;
      text-wrap: nowrap;
      font-weight: bold;
    }
    .count {
      aspect-ratio: 1/1;
      padding: 1em;
      border-radius: 2em;
      font-weight: bold;
      font-size: 1.2rem;
      color: white;
    }
    &:hover {
      scale: 1.02;
    }

    &:first-child .count {
      color: var(--color-red);
      background-color: var(--color-red-fade);
    }
    &:nth-child(2) .count {
      color: var(--color-blue-2);
      background-color: var(--color-blue-2-fade);
    }
    &:last-child .count {
      color: var(--color-blue-3);
      background-color: var(--color-blue-3-fade);
    }
    &:first-child:hover {
      color: var(--color-red);
    }
    &:nth-child(2):hover {
      color: var(--color-blue-2);
    }
    &:last-child:hover {
      color: var(--color-blue-3);
    }
    &:first-child:hover::before {
      color: var(--color-red);
      background-color: var(--color-red-fade);
    }
    &:nth-child(2):hover::before {
      color: var(--color-blue-2);
      background-color: var(--color-blue-2-fade);
    }
    &:last-child:hover::before {
      color: var(--color-blue-3);
      background-color: var(--color-blue-3-fade);
    }
    &:first-child::after {
      content: "sports_esports";
      color: var(--color-red-fade);
    }
    &:nth-child(2)::after {
      content: "terminal";
      color: var(--color-blue-2-fade);
    }
    &:last-child::after {
      content: "category";
      color: var(--color-blue-3-fade);
    }
  }

  button.primary {
    background-color: var(--color-blue-3);
    color: white;
    border: none;
    border-radius: 0.25em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.5em;
    border: 2px solid var(--color-blue-3);
    transition: 0.3s all ease-in-out;
    i {
      font-weight: bold;
      font-size: 1.2rem;
    }
    &:hover {
      color: var(--color-blue-3);
      background-color: white;
    }
  }
  .content.games {
    align-items: center;
  }
  .content.games .header {
    background-color: var(--backdrop-1);
    width: 100%;
    padding: 1em 2em;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5em;
    align-items: center;
    h1 {
      font-size: 1.5rem;
      white-space: nowrap;
    }
  }
  .content.games form.search-form {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    input {
      width: 500px;
      height: 3em;
      border-radius: 1.5em 0 0 1.5em;
      border: 1px solid var(--border-2);
      padding: 1em;
    }
    input:focus {
      border: 1px solid var(--color-blue-3);
      outline: none;
    }
    button {
      height: 3em;
      border-radius: 0 1.5em 1.5em 0;
    }
  }
  .content.games > .subcontainer {
    margin-top: 0.5em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 1em;
    width: 80%;
    a {
      text-decoration: none;
    }
  }

  .games-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: var(--box-shadow-1);
    border-radius: 0.5em;
    overflow: hidden;
  }

  .games-table thead {
    background: var(--color-blue-2);
  }

  .games-table th,
  .games-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-1);
  }

  td.icon {
    i {
      color: var(--color-red);
      padding: 0.25em;
      border-radius: 1em;
      background-color: var(--backdrop-2);
      position: relative;
      &::before {
        content: "";
        position: absolute;
        border-radius: 1em;
        background-color: green;
        inset: inherit;
        padding: 0.1em;
        left: 0.1em;
        border-radius: 1em;
        animation: var(--animate-pulse);
      }
    }
  }

  .games-table th {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .games-table tbody tr:hover {
    background: var(--backdrop-1);
  }

  .games-table td {
    font-size: 0.95rem;
    color: #333;
  }

  .games-table tbody tr:last-child td {
    border-bottom: none;
  }

  th:last-child,
  td:last-child {
    text-align: center;
  }
  td:nth-child(2) {
    color: var(--color-red);
    font-weight: bold;
  }
  td:nth-last-child(3) {
    line-height: 2em;
  }
  button.delete {
    background-color: transparent;
    border: none;
    color: var(--color-red-fade);
    font-size: 1.2rem;
    transition: 0.3s all ease-in-out;
    &:hover {
      color: var(--color-red);
    }
  }
  button.edit {
    background-color: transparent;
    border: none;
    color: var(--color-blue-1-fade);
    font-size: 1.2rem;
    transition: 0.3s all ease-in-out;
    &:hover {
      color: var(--color-blue-1);
    }
  }

  .content.add-games {
    width: 100%;
    max-width: 600px;
    justify-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
    padding: 4em;
    border: 1px solid var(--border-1);
    height: fit-content;
    margin-top: 3em;
    border-radius: 1em;
    background-color: white;
    box-shadow: var(--box-shadow-1);
    position: relative;
    a {
      align-self: flex-end;
      position: absolute;
      top: 1em;
      right: 1em;
    }
    form {
      width: 100%;
      max-width: 500px;
    }
  }
  .form-group {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    text-align: left;
  }

  .form-group label {
    margin-bottom: 0.4rem;
    font-weight: 500;
  }

  .form-group input,
  textarea,
  select {
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    width: 100%;
    resize: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
      Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
      sans-serif;
    outline: none;
    &:focus {
      border-color: var(--color-blue-3);
    }
  }

  .form-group button {
    width: fit-content;
    align-self: flex-end;
  }

  .hint {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #666;
  }

  button.secondary {
    color: white;
    border: 2px solid var(--border-1);
    border-radius: 0.25em;
    padding: 0.5em;
  }
  a {
    text-decoration: none;
  }
  button.close {
    background-color: white;
    border: 1px solid var(--border-1);
    padding: 0.25em;
    aspect-ratio: 1/1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 1em;
    color: var(--color-red);
    font-size: 1rem;
    font-weight: bold;
    justify-self: flex-end;
    transition: 0.3s all ease-in-out;
    &:hover {
      color: white;
      background-color: var(--color-red);
    }
  }
  h1.title {
    color: var(--color-blue-2);
  }

  .multi-select {
    position: relative;
    width: 100%;
  }

  .multi-select-trigger {
    padding: 0.6rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
  }

  .multi-select-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    display: none;
    max-height: 220px;
    overflow-y: auto;
    z-index: 10;
  }

  .multi-select.open .multi-select-options {
    display: block;
  }

  .option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    span {
      width: 100%;
    }
  }

  .option:hover {
    background-color: var(--color-blue-3);
  }

  .option input {
    accent-color: var(--primary);
  }

  span.tag {
    background-color: var(--color-blue-3-fade);
    color: var(--color-blue-3);
    padding: 0.25em 0.5em;
    border-radius: 0.25em;
  }

  .update {
    color: var(--color-yellow-2);
  }

  button.primary.update {
    background-color: var(--color-yellow-2);
    color: white;
    text-shadow: 1px 1px var(--border-1);
    border-color: var(--color-yellow-2);
    &:hover {
      background-color: white;
      color: var(--color-yellow-2);
    }
  }

  .hero-icon {
    font-size: 1.5rem;
    border: 1px solid;
    padding: 0.5em;
    aspect-ratio: 1/1;
    border-radius: 1.5em;
    color: white;
  }

  .hero-icon.update {
    background-color: var(--color-yellow-2);
    text-shadow: 2px 1px var(--border-1);
  }

  .hero-icon.new {
    background-color: var(--color-blue-3);
    text-shadow: 2px 1px var(--border-1);
  }

  /* Forms error message */
  .error-message {
    color: rgb(255, 49, 49);
    background-color: rgba(255, 0, 0, 0.267);
    width: 100%;
    padding: 0.5em;
    border-radius: 0.25em;
    margin-bottom: 2em;
  }

  .random-games-container {
    display: flex;
    flex-direction: column;
  }
  .random-games-container > .game-card-container {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
    gap: 0.5em;
    padding: 1em 3em;
  }
  .game-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1em;
    border: 1px solid var(--border-1);
    border-radius: 0.5em;
    padding-bottom: 2em;
    background-color: white;
    box-shadow: var(--box-shadow-1);
    transition: 0.3s all ease-in-out;
    &:hover {
      background-color: var(--color-blue-3-fade);
    }
  }
  .game-card > .game-thumbnail {
    height: 200px;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: inherit;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
  }

  .game-card > .game-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-blue-2);
  }

  @media (max-width: 460px) {
    .content.games .header .search-form {
      max-width: 360px;
    }
    .subcontainer {
      width: 80vw !important;
      align-items: center !important;
      flex-direction: column-reverse !important;
    }
    .random-games-container h1.title {
      text-align: left;
      margin-left: 1em;
    }
    table {
      width: 380px !important;
    }
    th,
    tr,
    td {
      font-size: 0.5rem !important;
    }
    .content.content.add-games {
      border-radius: 0;
      box-shadow: none;
      h1.title {
        text-align: center;
        width: 100%;
        align-self: flex-end !important;
      }
    }
  }

  /* Delete Dialog styles */

  dialog[open].delete-dialog {
    border: 1px solid var(--border-1);
    width: fit-content;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
    padding: 1em 2em;
    .dialog.message {
      color: var(--color-red);
    }
    &::backdrop {
      backdrop-filter: blur(5px);
      background-color: rgba(0, 0, 0, 0.7);
    }
    button {
      padding: 1em 2em;
      font-size: 1rem;
      border: none;
    }
    button.dialog.delete {
      background-color: var(--color-red);
      color: white;
    }
  }
  .dialog-btn-containers {
    display: flex;
    gap: 1em;
  }
  dialog[open].confirm-dialog {
    border: 1px solid var(--border-1);
    width: fit-content;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
    padding: 1em 2em;
    &::backdrop {
      backdrop-filter: blur(5px);
      background-color: rgba(0, 0, 0, 0.7);
    }
    button {
      padding: 1em 2em;
      font-size: 1rem;
      border: none;
      border-radius: 0.25em;
      border: 1px solid canvas;
    }
    button.dialog.action {
      color: white;
      &:hover {
        color: var(--color-blue-3);
        border: 1px solid var(--color-blue-3);
      }
    }
  }
}

/* Dark Mode */
html[data-theme="dark"]{

  :root {
    /* Core backgrounds */
    --bg-main: #0f1419;
    --bg-surface: #151b23;
    --bg-elevated: #1d2430;

    /* Text */
    --text-primary: #e6edf3;
    --text-secondary: #9da7b3;
    --text-muted: #6e7681;

    /* Borders & shadows */
    --border-1: rgba(255, 255, 255, 0.08);
    --border-2: rgba(255, 255, 255, 0.15);
    --box-shadow-1: 0 8px 24px rgba(0, 0, 0, 0.6);
    --box-shadow-2: 0 2px 10px rgba(0, 0, 0, 0.5);

    /* Backdrops */
    --backdrop-1: rgba(255, 255, 255, 0.04);
    --backdrop-2: rgba(255, 255, 255, 0.08);

    /* Accent colors (kept brand-consistent) */
    --color-blue-1: #0b1c2d;
    --color-blue-2: #12344d;
    --color-blue-3: #4fc3c7;

    --color-blue-1-fade: rgba(18, 52, 77, 0.6);
    --color-blue-2-fade: rgba(79, 195, 199, 0.2);
    --color-blue-3-fade: rgba(79, 195, 199, 0.3);

    --color-red: #ff5a5a;
    --color-red-fade: rgba(255, 90, 90, 0.25);

    --color-yellow-2: #facc15;
  }

  /* ============================
     BASE
     ============================ */

  body {
    background-color: var(--bg-main);
    color: var(--text-primary);
  }

  h1.title {
    color: var(--color-blue-3);
  }

  /* ============================
     SIDEBAR & NAV
     ============================ */

  .sidebar {
    background-color: var(--color-blue-1);
  }

  button.edit, .burger-menu{
    color: white;
    &:hover{
      color: var(--color-blue-3);
    }
  }

  .navbar {
    background: var(--color-blue-1-fade);
  }

  .logo {
    background-color: var(--color-blue-2);
  }

  .nav-links a {
    color: var(--text-primary);
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--color-blue-3);
  }

  /* ============================
     CONTENT SURFACES
     ============================ */

  .content.add-games,
  .game-card,
  .games-table,
  .multi-select-trigger {
    background-color: var(--bg-surface);
    border-color: var(--border-1);
  }
  .multi-select-options{
    background-color: var(--color-blue-3);
  }

  .content > .total-counts {
    background-color: transparent;
  }

  .total-counts > .items {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
  }

  /* ============================
     FORMS
     ============================ */

  .form-group label {
    color: var(--text-secondary);
  }

  .form-group input,
  textarea,
  select {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-1);
  }

  .form-group input::placeholder {
    color: var(--text-muted);
  }

  .form-group input:focus,
  textarea:focus,
  select:focus {
    border-color: var(--color-blue-3);
  }

  .hint {
    color: var(--text-muted);
  }

  /* ============================
     BUTTONS
     ============================ */

  button.primary {
    background-color: var(--color-blue-3);
    border-color: var(--color-blue-3);
    color: #022;
  }

  button.primary:hover {
    background-color: transparent;
    color: var(--color-blue-3);
  }

  button.close {
    background-color: var(--bg-elevated);
    color: var(--color-red);
  }

  button.close:hover {
    background-color: var(--color-red);
    color: white;
  }

  /* ============================
     TABLES
     ============================ */

  .games-table thead {
    background-color: var(--color-blue-2);
  }

  .games-table td {
    color: var(--text-primary);
  }

  .games-table tbody tr:hover {
    background-color: var(--backdrop-1);
  }

  /* ============================
     DIALOGS
     ============================ */

  dialog[open] {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-1);
  }

  dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.75);
  }

  /* ============================
     HERO ICONS
     ============================ */

  .hero-icon {
    color: #001;
  }

  .hero-icon.new {
    background-color: var(--color-blue-3);
  }

  .hero-icon.update {
    background-color: var(--color-yellow-2);
  }
}