/* Define CSS variables for global use */
:root {
  --bg-dark: #333;
  --bg-light: #f4f4f4;
  --text-light: #fff;
  --text-light-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  --text-dark: #333;
}

/* Reset default styles for body, h1, ul, li, and a */
body, h1, ul, li, a {
  margin: 0;
  padding: 0;
}

/* General styling for the body */
body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: var(--bg-light);
  color: var(--text-dark);
  align-content: center;
  text-align: center;
}

/* Styling for the header section */
header {
  background-color: #50b3a2;
  color: var(--text-light);
  text-shadow: var(--text-light-shadow);
  padding: 1.5em;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: relative;
}

/* Styling for the logo in the header */
#header-logo {
  max-width: 200px;
  height: auto;
}

/* Styling for the main header text */
h1 {
  position: absolute;
  left: 50%;
  bottom: 20%;
  transform: translateX(-50%);
  margin: 0;
}

table {
  margin-left: auto;
  margin-right: auto;
}

/* Styling for the navigation bar */
nav {
  background-color: var(--bg-dark);
}

/* Remove list styles and overflow for ul in nav */
nav ul {
  list-style: none;
  overflow: hidden;
}

/* Float list items to the left */
nav ul li {
  float: left;
}

/* Styling for links in the nav bar */
nav ul li a {
  display: block;
  padding: 14px 20px;
  text-decoration: none;
  color: var(--text-light);
}

/* Hover effect for nav links */
nav ul li a:hover {
  background-color: #555;
}

/* General styling for images */
img {
  max-width: 100%;
  height: auto;
}


/* Styling for text in the hero section */
.hero-text {
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--text-light);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  max-width: 90%;
  margin: auto;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}

/* Styling for headers in the hero text */
.hero-text h2 {
  font-size: 2.5em;
  text-shadow: var(--text-light-shadow);
}

/* Styling for paragraphs in the hero text */
.hero-text p {
  font-size: 1.2em;
  text-shadow: var(--text-light-shadow);
}

/* Styling for the main content */
main {
  padding: 20px;
  margin: 20px;
  background-color: #fff;
  color: var(--text-dark);
}

/* Styling for the footer */
footer {
  background-color: var(--bg-dark);
  color: var(--text-light);
  text-align: center;
  padding: 1em 0;
}

/* Add focus outline for better accessibility */
a:focus {
  outline: 2px solid #50b3a2;
}

/* Styling for collapsible buttons in the main section */
main .collapsible {
  font-size: 1.5em;
  width: 100%;
  text-align: center;
  margin: auto;
  margin-bottom: 10px;
  margin-top: 10px;
}

/* Styling for the clock */
.clock {
  font-size: 4em;
  text-align: center;
}

/* Center align the group of buttons */
.button-group {
  text-align: center;
}

/* Flexbox styling to center the timer */
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Styling for the progress bar */
#js-progress {
  width: 100%;
  margin: auto;
  display: block;
  height: 80px;
}

/* Styling for the main button */
.main-button {
  font-size: 2em;
  padding: 20px 40px;
  margin-top: 20px;
  display: block;
  width: 80%;
  text-align: center;
}

/* Cursor style for collapsible sections */
.collapsible {
  cursor: pointer;
}

/* Style to hide elements */
.hidden {
  display: none;
}

/* #overlay sets its position to fixed, making it stay in the same place 
   even if the page is scrolled. The top and left positions are set 
   to 0 to ensure it covers the entire viewport.
   The z-index is set high to ensure it appears above other elements. */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  display: none;
  padding-bottom: 20px;
}

/* Responsive image in portfolio gallery */
#full-image {
  max-height: 80%;
  max-width: 80%;
  }


/* Uses flexbox to layout its children vertically and centers them.
   The width is set to 100% to occupy the full width of its parent. */
.tool-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
}

/* Style for overlay images */
.tool-container img {
  max-height: 90%;
  max-width: 90%;
}

/* Gallery style for images */
.gallery img {

  max-width: 200px;
  max-height: 200px;
  margin: 10px;
  cursor: pointer;
}

/* Gallery style */
.gallery {
  display: flex;
  justify-items: center;
  justify-content: center;
  align-items: center;
}


/* Sets the font size to 16px and adds a top margin of 10px for spacing. */
.description {
  font-size: 16px;
  margin-top: 10px;
  padding: 20px; 
  border: 3px solid #ffffff;
  background: #ffffff;
  box-sizing: border-box; /* This ensures that padding and border are included in the element's total width and height */
  border-radius: 10px;
}



/* Styling for menu buttons */
#menu-buttons {
  display: flex; /* Make it a flex container */
  padding: 0;
  margin: 0;
}

/* Each button takes up approximately one-third of the container */
#menu-buttons button {
  width: 33.33%;
  border-radius: 8px 8px 0 0; /* Rounded corners at the top */
  box-sizing: border-box;
  margin-bottom: 0;
  padding-bottom: 10px;
  margin: 0;
}

/* Styling for recipe popup */
#recipe-popup {
  height: 80%;
  width: 80%;
  max-width: 800px;
  min-width: 300px;
  margin: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fafafa;
  border-radius: 10px;
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
  padding: 20px;
  z-index: 1000;
  overflow: hidden;
}

/* Styling for recipe content */
#recipe-content {
  align-items: center; /* Center the buttons horizontally */
}

/* Styling for recipe list */
#recipe-list {
  display: flex;
  flex-direction: column; /* Stack items vertically */
  align-items: center; /* Center items horizontally */
  justify-content: center; /* Center items vertically */
  width: 100%; /* Full width */
  margin-top: 0; /* No margin at the top */
  padding-top: 0; /* No padding at the top */
  background-color: #50b3a2;
  margin: 0;
  margin-bottom: 10px;
  border-radius: 0 0 8px 8px; /* Rounded bottom corners */
  text-align: left;
}

/* Styling for buttons inside recipe list */
#recipe-list button {
  width: 100%;
}

/* Styling for recipe title */
#recipe-title {
  font-size: 1.5em;
  font-weight: bold;
  text-align: center;
}

/* Styling for recipe ingredients list */
#recipe-ingredients {
  text-align: left;
  padding-left: 0;
  list-style-position: inside;
}

/* Styling for content inside recipe popup */
.recipe-popup-content {
  display: flex;
  flex-direction: row;
  overflow-y: auto; /* Enable vertical scrolling */
  height: calc(100% - 50px); /* Remaining height after header */
}

/* Styling for columns inside recipe popup */
.recipe-popup-column {
  flex: 1;
  padding: 5px;
}

/* Styling for individual recipe items */
.recipe-item {
  background-color: #f9f9f9; /* Background color */
  padding: 10px; /* Padding */
  border-radius: 5px; /* Rounded corners */
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1); /* Shadow */
}

/* Styling for header inside popup */
.popup-header {
  height: 50px; /* Fixed height */
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* Styling for picture inside recipe popup */
#recipe-picture {
  border-radius: 10px;
  margin-bottom: 10px;
}

/* Styling for ingredients and steps inside recipe popup */
#recipe-ingredients, #recipe-steps {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 5px;
  text-align: left;
}

/* Styling for close button inside popup */
#close-popup {
  background: #ccc;
  border: none;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
}

/* Hover effect for close button */
#close-popup:hover {
  background: #bbb;
}

/* Styling for general buttons */
button {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  background-color: #50b3a2;
  color: #fff;
  cursor: pointer;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, .3);
  transition: all 0.3s ease;
  text-shadow: 4px 4px 4px rgba(0, 0, 0, .3);
  min-width: 180px;  
}

/* Hover effect for general buttons */
button:hover {
  background-color: #3a8279;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

/* Styling for non-selected menu buttons */
.not-selected {
  background-color: #3a8279;
}

/* Styling for form groups */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1em;
}

/* Styling for the skip button in trivia game */
.skip {
    margin-top: 15px; 
}


/* Media query for screen width up to 768px */
@media (max-width: 768px) {
  /* Center align list items in nav */
  nav ul li {
    float: none;
    text-align: center;
  }

  /* Adjust main and footer margins */
  main, footer {
    margin: 10px;
  }

  /* Update header and logo styles for small screens */
  header {
    flex-direction: column;
    text-align: center;
  }

  /* Reduce the maximum width of the header logo */
  #header-logo {
    max-width: 150px;
  }

  /* Re-position and re-size the main header text */
  h1 {
    position: static;
    transform: none;
    margin-top: 10px;
  }

  /* Reduce the size of hero text */
  .hero-text h2 {
    font-size: 2em;
  }

  .hero-text p {
    font-size: 1em;
  }

  /* Adjust padding and margin for main content and footer */
  main, footer {
    padding: 10px;
    margin: 10px;
  }

  /* Reduce the size of collapsible buttons */
  .collapsible {
    font-size: 1.2em;
  }

  /* Reduce the size of the clock */
  .clock {
    font-size: 3em;
  }

  /* Reduce the size of the main button */
  .main-button {
    font-size: 1.5em;
  }

  .gallery img {
  max-width: 50%;
  max-height: 180px;
  margin: 10px;
  cursor: pointer;
  }


  /* Adjust the size and layout of the recipe popup */
  #recipe-popup {
    height: 80%;
    width: 80%;
  }

  /* Change the flex direction for the recipe popup content */
  .recipe-popup-content {
    flex-direction: column;
  }

  /* Reduce the padding for the recipe popup columns */
  .recipe-popup-column {
    flex: 1 0 50%;
  }

    /* Set maximum image size within recipe popup column */
  .recipe-popup-column img {
    max-width: 300px; 
    max-height: 300px;  
  }

}