:root {
  --primary-color: #007bff;

  /* White mode */
  --secondary-color: #000000;
  --tertiary-color: #ffffff;
  --quaternary-color: #f8f9fa;
  --quinary-color: #212529;
  --senary-color: #6c757d;
  --septenary-color: #343a40;
  --octonary-color: #4f5458;
  --nonary-color: #e5e7e9;

  --info-color: #17a2b8;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --error-color: #dc3545;
}

body.dark-mode {
  /* Dark mode */
  --secondary-color: #6c757d;
  --tertiary-color: #343a40;
  --quaternary-color: #212529;
  --quinary-color: #f8f9fa;
  --senary-color: #ffffff;
  --septenary-color: #000000;
  --octonary-color: #4f5458;
  --nonary-color: #e5e7e9;
}

/* For Webkit-based browsers (Chrome, Safari): */
::-webkit-scrollbar {
  /* Set the width of the scrollbar */
  width: 10px;
}
::-webkit-scrollbar-thumb {
  /* Set the color of the thumb (drag handle) */
  background-color: var(--primary-color);
  /* Add rounded corners to the thumb */
  border-radius: 5px;
}
::-webkit-scrollbar-track {
  /* Set the color of the track (the bar) */
  /* background-color: var(--tertiary-color); */
  background-color: var(--octonary-color);
}

/* 
  For Mozilla-based browsers (Firefox):
  NOTE: These styles may not work in all Firefox versions.
  You may need to use scrollbar-width and scrollbar-color properties in newer 
  versions.
*/
* {
  /* Set the width of the scrollbar */
  scrollbar-width: thin;
  /* Set the thumb and track colors */
  /* scrollbar-color: var(--primary-color) var(--tertiary-color); */
  scrollbar-color: var(--primary-color) var(--octonary-color);
}

body {
  background-color: var(--quaternary-color);
  color: var(--secondary-color);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;

  transition: all 0.2s; /* Global transition */

  /* Make sure the footer is always at the bottom of the page */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#alert {
  background-color: var(--warning-color);
  color: var(--tertiary-color);
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 20px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;

  transition: all 0.2s;
}

#alert p {
  margin: 0;
}

#alert button {
  background-color: var(--secondary-color);
  color: var(--quaternary-color);
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

#alert button:hover {
  background-color: var(--primary-color);
}

#error {
  background-color: var(--error-color);
  color: var(--quaternary-color);
  padding: 10px;
  border-radius: 5px;

  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;

  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1;

  max-width: 400px;

  transition: transform 0.4s ease-in-out;
  transform: translateX(600px); /* Start off screen */
}

#error.show-error {
  transform: translateX(0px); /* Slide in */
}

#error div {
  display: block;
}

#error div p {
  margin: 0;
}

#error div p a {
  color: var(--tertiary-color);
  text-decoration: none;
}

#error div p a:hover {
  color: var(--septenary-color);
}

#error button {
  background-color: var(--secondary-color);
  color: var(--quaternary-color);
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;

  margin-left: 20px;
}

#error button:hover {
  background-color: var(--primary-color);
}

main {
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
}

section {
  color: var(--quinary-color);
  padding: 20px;
  margin-bottom: 20px;
  background-color: var(--tertiary-color);
  border-radius: 5px;
  max-width: 49%;
  min-width: 200px;
  box-sizing: border-box;
}

section a {
  color: var(--info-color);
  text-decoration: none;
}

section a:hover {
  color: var(--primary-color);
}

/* .card {
  background-color: var(--secondary-color);
  color: var(--tertiary-color);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 5px;
  box-sizing: border-box;
}
.card:hover {
  transform: scale(1.1);
} */
/* Card style made by: gh/ImPlotzes */
.card {
  margin: 20px;
  color: var(--quinary-color);
  background-color: var(--tertiary-color);
  padding: 20px 30px;
  border-radius: 10px;
  max-width: 500px;
  transition: all 0.2s;
  width: fit-content;
}

.card:hover {
  transform: scale(1.1);
  background-color: var(--octonary-color);
}

#coding {
  text-align: center;
}

#coding #programming-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  align-items: center;
  text-align: left;
}

#coding #programming-examples .coding-example {
  /* max-width: 100%;
  width: max-content;
  margin: 0 auto; */
  padding: 20px;
}

.coding-example h3 {
  margin-top: 0;
  transition: none;
}

.coding-example:hover h3 {
  color: var(--nonary-color);
}

.coding-example .example-code {
  font-family: monospace;
  white-space: pre-wrap;
  background-color: var(--secondary-color);
  color: var(--tertiary-color);
  padding: 20px;
  border-radius: 5px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.coding-example .coding-buttons {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-wrap: wrap;
}

.coding-example .copy-button,
.coding-example .download-button,
.coding-example .usage-button,
.coding-example .readme-button {
  background-color: var(--secondary-color);
  color: var(--tertiary-color);
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0px 5px 5px 0px;
}

.coding-example .copy-button:hover,
.coding-example .download-button:hover,
.coding-example .usage-button:hover,
.coding-example .readme-button:hover {
  background-color: var(--primary-color);
  color: var(--tertiary-color);
}

footer {
  background-color: var(--tertiary-color);
  color: var(--secondary-color);
  padding: 20px;
  text-align: center;

  /* Make sure the footer is always at the bottom of the page, see body */
  margin-top: auto;
}

footer a {
  color: var(--secondary-color);
}

footer p {
  color: var(--secondary-color);
  font-size: 12px;
  margin: 0;
}

footer p a {
  color: var(--secondary-color);
  text-decoration: none;
}

footer p a:hover {
  color: var(--primary-color);
}

@media only screen and (max-width: 600px) {
  #alert {
    flex-direction: column;
    align-items: center;
    padding: 20px;

    box-sizing: border-box;
    max-width: 100%;

    z-index: 2;
  }

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

  #alert p {
    margin-bottom: 20px;
    padding: 0 20px;
    text-align: center;
    box-sizing: border-box;
  }

  #error {
    flex-direction: column;
    align-items: center;

    box-sizing: border-box;
    max-width: 100%;

    bottom: 0;
    right: 0;
  }

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

  #error div {
    margin-bottom: 20px;
    padding: 0 10px;
    text-align: center;
    box-sizing: border-box;
  }

  #error button {
    margin: 0;
  }

  main {
    flex-direction: column;
  }

  section {
    max-width: 100%;
  }
}

@media only screen and (max-width: 400px) {
  #alert p {
    font-size: 15px;
  }

  #alert button {
    font-size: 15px;
  }

  #error div p {
    font-size: 15px;
  }

  #error button {
    font-size: 15px;
  }

  section {
    max-width: 100%;
  }
}

@media only screen and (max-width: 300px) {
  #alert p {
    font-size: 12px;
  }

  #alert button {
    font-size: 12px;
  }

  #error div p {
    font-size: 12px;
  }

  #error button {
    font-size: 12px;
  }

  section {
    max-width: 100%;
  }

  .coding-example .example-code {
    font-size: 10px;
  }
}
