* {
  box-sizing: border-box;
  margin: 0;
}

:root {
  --primary-color: #0f045a;
  --theme-color1: #7582b2;
  --theme-color2: #036c96;
  --theme-color3: #ebf2ff;
  --shadow-color1: #352a7e;
  --shadow-color2: #101536;
  --border-color1: #080126;
  --background-col: #c6cede;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--shadow-color2);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-color);
}

.heading {
  text-align: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  margin-top: 0.5rem;
  font-family: "Roboto Mono", monospace;
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.game {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  max-width: 100vw;
  margin-left: 20vw;
  background-color: var(--background-col);
}

.grid-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  border: solid 0.2rem var(--border-color1);
  max-width: 62vw;
  max-height: 31vw;
}

.main-grid {
  display: grid;
  justify-content: center;
  margin: auto;
  background-color: inherit;
}

.cell {
  display: flex;
  justify-content: center;
  align-items: center;
  border: solid 0.001rem var(--border-color1);
}

.controls {
  display: flex;
  flex-direction: row;
  min-width: 40vw;
  height: 5rem;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.control-button {
  border: none;
  background: none;
  padding: 1rem;
  cursor: pointer;
  outline: none;
}

.icon {
  width: calc((30vw) / 8);
  height: calc((30vw) / 8);
}

.clear-button,
.random-button {
  border: solid 0.1rem var(--border-color1);
  border-radius: 0.6rem;
  height: calc((100%) / 1.8);
  width: auto;
  text-align: center;
  padding: 0.5rem;
  /* roboto mono*/
  font-family: "Roboto Mono", monospace;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--primary-color);
  background-color: var(--theme-color3);
}

.clear-button {
  margin-right: 1rem;
}

.random-button {
  margin-left: 1rem;
}

.clear-button:hover,
.random-button:hover {
  box-shadow: 0.1rem 0.1rem var(--shadow-color1);
}

.clear-button:active,
.random-button:active {
  box-shadow: 0.1rem 0.1rem var(--shadow-color2);
  transform: translateY(0.1rem);
}

.icon:active {
  transform: translateY(0.1rem);
}

/* Fixed sidenav, full height */
.sidenav {
  height: 100vh;
  width: 20vw;
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0px;
  background-color: var(--border-color1);
  overflow-x: hidden;
  padding-top: 2rem;
}

.sidenav .cross{
  cursor: pointer;
  position: absolute;
  top: 45px;
  right: 15px;
  display: none;
}

/* Style the sidenav links and the dropdown button */
.sidenav button,
.other-settings,
.other-settings-container div,
.presets-container div,
.color-themes,
.themes-container div,
.presets,
.history,
.about {
  padding: 0.8rem 0.5rem 0.8rem 1.6rem;
  text-decoration: none;
  font-size: 1rem;
  color: #818181;
  font-family: "Roboto Mono", monospace;
  font-weight: lighter;
  display: block;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.other-settings-container .randomness-container {
  padding: 0.8rem 0.5rem 0.8rem 1.6rem;
  text-decoration: none;
  font-size: 1rem;
  color: #818181;
  font-family: "Roboto Mono", monospace;
  font-weight: lighter;
  display: block;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.hamburger {
  position: absolute;
  left: 10px;
  top: 5px;
  display: none;
}

/* On mouse-over exclude .other-settings*/
.has-dropdown:hover {
  color: #fff;
}

/* Add an active class to the active dropdown button */
.active {
  background-color: var(--theme-color2);
  color: white;
}

.other-settings,
.color-themes,
.presets,
.history
.about {
  font-size: 1.2rem;
}

.other-settings {
  font-weight: bold;
  color: var(--theme-color1);
}

.other-settings-container {
  background-color: var(--shadow-color2);
}

/* Dropdown container (hidden by default) */
.themes-container,
.presets-container,
.history-container,
.about-container {
  display: none;
  background-color: var(--shadow-color2);
  padding-left: 0.2rem;
}

.presets-list:active,
.history-container,
.about-container button:active {
  color: #ffffff;
}

.randomness-value {
  max-width: 80%;
  padding-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider {
  width: 80%;
  border-radius: 0.2rem;
  background: var(--theme-color3);
  outline: none;
  opacity: 0.7;
  -webkit-transition: 0.2s;
  transition: opacity 0.2s;
}

@media screen and (max-width: 750px) {
  .sidenav {
    height: auto;
    position: absolute;
    padding-top: 0.5rem;
    left: -250px;
    height: 100vh;
    width: 35vw;
  }

  .hamburger {
    position: absolute;
    left: 10px;
    top: 5px;
    display: block;
  }

  .sidenav .cross{
    cursor: pointer;
    position: absolute;
    top: 13px;
    right: 10px;
    display: block;
  }

  .sidenav .randomness-container input {
    padding: 0.6rem 0.4rem 0.6rem 1rem;
    text-decoration: none;
    font-size: 0.8rem;
    display: block;
    border: none;
    background: none;
    width: 50%;
    margin: auto;
    text-align: center;
    cursor: pointer;
    outline: none;
    align-items: center;
  }

  .sidenav .randomness-container label {
    padding: 0.6rem 6.4rem 0.6rem 0.5rem;
    text-decoration: none;
    font-size: 0.8rem;
    display: block;
    border: none;
    background: none;
    width: 50%;
    margin: auto;
    text-align: center;
    cursor: pointer;
    outline: none;
    align-items: center;
  }

  .about a {
    text-decoration: none; 
    color: inherit; 
    cursor: pointer; 
}

  .sidenav button,
  .other-settings,
  .other-settings-container div,
  .presets-container div,
  .color-themes,
  .themes-container div,
  .presets,
  .history,
  .about {
    padding: 0.6rem 0.4rem 0.6rem 1rem;
    text-decoration: none;
    font-size: 0.8rem;
    display: block;
    border: none;
    background: none;
    width: 100%;
    text-align: center;
    cursor: pointer;
    outline: none;
    align-items: center;
  }

  .game {
    width: 100vw;
    margin: 0;
  }

  .clear-button,
  .random-button {
    height: calc((100%) / 2.5);
    width: auto;
    text-align: center;
    padding: 0.4rem;
    font-size: 0.7rem;
  }

  .heading {
    padding-top: 1rem;
    padding-bottom: 1.2rem;
    margin-top: 0.2rem;
    font-size: 2.0rem;
  }

  .active {
    background-color: var(--theme-color2);
    color: white;
  }

  .randomness-value {
    max-width: 100%;
    display: flex;
    align-items: center;
    padding: 0 10rem 0.6rem 10rem;
    justify-content: center;
    text-align: center;
  }

  .slider {
    width: 30%;
  }
}

#gradient-theme-btn {
  margin-top: 10px;
  padding: 10px 20px;
  background-color: var(--shadow-color2);
  color: #FFFFFF;
  border-radius: 5px;
  cursor: pointer;
}

/* Gradient theme */
.gradient-theme {
  background: linear-gradient(to right, var(--primary-color), var(--shadow-color1)); /* Example gradient colors */
  color: #FFFFFF; /* Example text color */
}

.gradient-button {
  background-color: #4CAF50; /* Green */
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  transition-duration: 0.4s;
  cursor: pointer;
  border-radius: 8px;
}

.gradient-button:hover {
  background-color: var(--theme-color2);
  color : white /* Darker green */
}


/* Style for the container of color inputs and gradient direction dropdown */
.gradient-settings-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start; /* Align items to the start of the container */
}

/* Style for color input */
input[type="color"] {
  width: 30px;
  height: 30px;
  padding: 2px;
  border: 1px solid #cccccc;
  border-radius: 5px;
  margin: 10px 10px; /* Add margin bottom to separate color inputs */
  cursor: pointer;
  outline: none;
}

/* Style for gradient direction dropdown */
.gradient-direction-select {
  width: 100%;
  padding: 3px;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  outline: none;
  background-color: var(--shadow-color2);
  color: #e4dddd;
}

/* Style for the button when active */
#gradient-theme-btn:hover {
  background-color: var(--theme-color2);
  color: var(--theme-color3);
}
