:root {
  --header-color: rgba(37, 37, 37, 0.8);
  --background-color: #252525;
  --logo-sides-color: white;
  --header-icon-color: white;
  --header-button-text-color: #B0B0B0;
  --header-button-text-select-color: white;
  --sidenav-overlay-color: rgba(0, 0, 0, 0.5);
}

:root.light-theme {
  --header-color: rgba(255, 255, 255, 0.8);
  --logo-sides-color: black;
  --logo-center-color: #ff0060;
  --header-icon-color: black;
  --header-button-text-color: gray;
  --header-button-text-select-color: black;
  --sidenav-overlay-color: rgba(0, 0, 0, 0.5);
}

/* Header Styles */
#main-header {
  background-color: var(--header-color);
  backdrop-filter: blur(10px);
  display: flex;
  position: fixed;
  width: 100%;
  z-index: 1000;
  height: 50px;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 0 20px 0 20px;
  align-items: center; /* Vertically align items in the header */
}

#logo-container {
  display: flex;
  align-items: center;
  gap: 2em; /* Add spacing between the logo and the button */
  }

#logo {
  background-color: transparent;
  border: none;
  color: var(--title-color);
  font-size: 1.7em;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  padding: 0;
  text-decoration: none;
  display: inline-block; /* Ensure only the logo itself is clickable */
}

#logo .logo-sides {
  color: var(--logo-sides-color);
}

#header-button {
  background-color: transparent;
  color: var(--header-button-text-color);
  font-size: 1em;
  font-weight: medium;
  padding: 5px 10px;
  cursor: pointer;
  text-decoration: none;
}

#header-button:hover {
  color: var(--header-button-text-select-color);
}

/* Theme Toggle */
#theme-toggle-container {
  display: flex;
  align-items: center; /* Center the theme button vertically */
  margin-left: auto; /* Push the container to the right */
}

#theme-toggle-button {
  background-color: transparent;
  color: var(--header-icon-color);
  border: none;
  font-size: 32px;
  cursor: pointer;
  display: flex;
  padding: 0;
  user-select: none;
}

@media screen and (max-width: 600px) {
  #logo-container {
    display: flex;
    justify-content: center; /* Center the logo horizontally */
    width: 100%; /* Take full width for proper alignment */
  }

  /* Hide the header buttons on mobile view */
  #header-button {
    display: none
  }

  #menu-icon {
    position: left;
    font-size: 2em;
    cursor: pointer;
    user-select: none;
  }

  /* Sidenav styles */
  #sidenav {
    box-sizing: border-box; /* Include padding in height calculation */
    height: 100vh; /* Set height to match the viewport height */
    overflow-y: hidden; /* Remove scrolling */
    width: 0;
    position: fixed;
    z-index: 1005;
    background-color: var(--background-color);
    transition: 0.2s;
    padding-top: 4em;
    user-select: none;
    border-top-right-radius: 1em; /* Round the top right corner */
    border-bottom-right-radius: 1em; /* Round the bottom right corner */
    display: flex;
    flex-direction: column; /* Arrange buttons vertically */
    box-shadow: 5px 0 10px rgba(0, 0, 0, 0.25);
  }

  #sidenav-button {
    text-decoration: none;
    font-size: 1.5em;
    color: var(--header-button-text-color);
    margin-bottom: 1em;
    margin-inline: auto;
  }

  #sidenav-button:hover {
    color: var(--header-button-text-select-color);
  }

  #sidenav-close-button {
    position: absolute;
    cursor: pointer;
    top: 10px;
    left: 20px; /* Move the close button to the left side */
    font-size: 32px;
    color: var(--header-icon-color);
  }

  #sidenav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--sidenav-overlay-color);
    z-index: 1001;
  }
}

@media screen and (min-width: 601px) {
  #menu-icon {
    display: none; /* Hide the menu icon on desktop view */
  }

  #sidenav {
    display: none; /* Hide the sidenav on desktop view */
  }
}