:root {
  --primarycolour: #363237;
  --secondarycolour: #2D4262;
  --accentcolour: #73605B;
  --bgcolour: #D09683;
}

body {
  margin: 0; /* enables navbar to reach edges */
  padding-top: 40px; 
  padding-bottom: 80px;
  font-family: 'Ariel', Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: #f3f3f3;
  background-color: var(--bgcolour);
}

h1, h2, h3 {
  text-align: center;
  color: white;
  font-family: Arial, Helvetica, sans-serif;
}

h4 {
  text-align: left;
  color: var(--accentcolour);
  margin-left: 20px;
  margin-bottom: 0px;
}

p {
  padding: 0 20px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: white;
  margin-left: 100px;
}

dl, ul {
  padding: 0 20px;
  color: white;
}

label {
  display: inline-block;
  width: 175px;
  text-align: right;
}



input[type=text], input[type=password], textarea, input[type=search] {
  width: 400px;
  padding: 4px;
  margin: 8px;
  box-sizing: border-box;
  border: none;
  background-color: white;
  color: black;
}

input[type=date], input[type=number] {
  width: 100%;
  padding: 6px 10px;
  margin: 8px 0;
  box-sizing: border-box;
  border: none;
  background-color: var(--primarycolour);
  color: black;
}

textarea {
  height: 150px;
}

article {
  margin: auto;
  padding: 12px 12px;
  width: 85%;
  background-color: var(--secondarycolour);
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
  align-items: center;
  justify-content: center;
}

button {
  padding: 10px 20px;
  background-color: var(--primarycolour);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

button:hover {
  background-color: var(--secondarycolour);
}


/* Styles for tablets (max width of 768px) */
@media (max-width: 768px) {
  button {
      padding: 8px 16px;
      font-size: 12px;
  }
  
}

/* Styles for phones (max width of 480px) */
@media (max-width: 480px) {
  button {
      padding: 6px 12px;
      font-size: 10px;
  }
}

@media (max-width: 380px) {
  button {
      padding: 6px 8px;
      font-size: 9px;
  }
}

nav ul {
  display: flex;
  flex-direction: row;
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--primarycolour);
  line-height: 34px; /* flex container height minus 2x 4px padding for li a */
  justify-content: center; /* Center the menu items */
}

nav li a,
nav li {
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 4px 4px;
    text-decoration: none;
}

nav li a:hover:not(.active) {
  background-color: var(--secondarycolour);
}

nav .active {
  background-color: var(--accentcolour);
}

a.tlink:link, a.tlink:visited {
  color: black;
}

a.tlink:hover {
  color: var(--primarycolour);
}

.loadmess {
  text-align: center;
}

.navflexcont {
  display: flex;
  flex-direction: row;
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--primarycolour);
  justify-content: center;
  height: 42px;
  font-size: 16px;
}

.planter-flex {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: calc((3*104px) + (2*10px));
  margin: 0 auto;
}

.planter-flex > div {
  background-color: var(--accentcolour);
  color: whitesmoke;
  font-weight: bold;
  width: 100px;
  height: 100px;
  text-align: center;
  border-radius: 9px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #000;
}

.planter-flex > div img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/*
.inventory-row {
  display: flex;
  justify-content: flex-start;
}
*/

.planters-container {

  margin-top: 20px;
}

.inventory-container {
  display: flex;
  flex-direction: column; /* Arrange children in a column */
  justify-content: center;
  margin-top: 20px;
  align-items: center;
}

.creatures-container {
  margin-top: 20px;
}

.creature-container-title {
  text-align: center;
}

.creature-trap-container {
  display: flex;
  justify-content: center;
  flex-direction: row;
  align-items: center;
  margin: 10px 0; /* Space between rows */
}

.creature-trap-container img{
  width: 150px;
  height: 150px;
  border: 2px solid #000;
  border-radius: 10px; /* rounded corners */
  margin-left: 10px;
  margin-right: 10px;
  cursor: pointer;
}

.creature-pen-container {
  display: flex;
  justify-content: center;
  flex-direction: row;
  align-items: center;
  margin: 10px 0; /* Space between rows */
}
.creature-pen-container img{
  width: 150px;
  height: 150px;
  border: 2px solid #000;
  border-radius: 10px; /* rounded corners */
  margin-left: 10px;
  margin-right: 10px;
  cursor: pointer;
}

.other-container {
  margin-top: 20px;
}

.grow-details-container {
  display: flex;
  justify-content: space-around; /* Distributes items evenly */
  align-items: center; /* Aligns items vertically in the center */
  padding-bottom: 16px;
}

.grow-details-container div {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 10px; /* Optional: Adds space between the images */
}

.grow-details-container div img {
  width: 50px;
  height: 50px;
  border: 2px solid #000;
  border-radius: 6px; /* rounded corners */
}

/* Ensure nextGenBreedingContainer stacks its rows vertically */
.next-gen-breeding-container {
  display: flex;
  flex-direction: column; /* Stack rows vertically */
  align-items: center;
  padding-bottom: 16px;
}

/* Ensure rows within nextGenBreedingContainer are displayed in a row */
.next-gen-breeding-container > div {
  display: flex;
  justify-content: center;
  flex-direction: row;
  align-items: center;
  margin: 10px 0; /* Space between rows */
}
.next-gen-breeding-container > div > div {
  margin: 0 10px; /* Space between items within rows */
}
.next-gen-breeding-container > div img {
  width: 50px;
  height: 50px;
  border: 2px solid #000;
  border-radius: 6px; /* rounded corners */
}

/* Grid container for inventory items */
.inventory-table {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 items wide */
  gap: 10px; 
  width: 75%; 
  justify-content: space-between; /* Ensure items are evenly spread out */
  align-content: start; /* Ensure grid starts at the top */
}

.inventory-item {
  background-color: var(--accentcolour);
  color: whitesmoke;
  font-weight: bold;
  width: 60px;
  height: 60px;
  text-align: center;
  border-radius: 8px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.inventory-item img {
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  border-radius: 8px; 
  border: 2px solid #000;
}

.quantity-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 5px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
}

.tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: var(--bgcolour);
  color: #000;
  text-align: center;
  border-radius: 5px;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  bottom: 100%; 
  left: 50%;
  transform: translateX(-50%); /* Center the tooltip */
  opacity: 0;
  transition: opacity 0.3s;
  
}

.tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: black transparent transparent transparent;
}

.inventory-item:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Ensure tooltip stays within modal boundaries */
.inventory-item .tooltiptext {
  max-width: 200px; /* Max width for tooltip */
  word-wrap: break-word; /* Wrap long words */
}

.image-wrapper {
  position: relative;
  display: inline-block;
}

.instructions {
  display: flex;
  align-items: left;
  padding-bottom: 12px;
}

.creature-details-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 20px;
  padding-bottom: 12px;
}

.creature-details-container img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #000;
}

.item-details-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 20px;
}

.item-details-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #000;
}

.item-details-description {
  display: flex;
  width: 180px;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.item-details-description h2 {
  margin: 0;
  font-size: 1.5em;
}

.item-details-description p {
  margin: 0;
}

.item-details-description button {
  padding: 10px 20px;
  background-color: var(--primarycolour);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
}

.item-details-description button:hover {
  background-color: var(--secondarycolour);
}

.scroll-container {
  max-height: 400px;
  overflow-y: auto;
}

.harvest-results-container div {
display: flex;
flex-direction: row;
align-items: center;
justify-content: left;
gap: 10px;
text-align: left;
padding-top: 10px;
}

.harvest-results-container div img {
max-width: 50px;
max-height: 50px;
border-radius: 6px;
gap: 10px;
object-fit: cover; 
border: 2px solid #000;
}

.item-row {
  display: flex;
  align-items: center;
  margin: 10px 30px;
}

.item-image {
  width: 50px;
  height: 50px;
  margin-right: 10px;
  border-radius: 6px;
  border: 2px solid #000;
}

.item-details {
  display: flex;
  flex-direction: column;
}

.item-name {
  font-size:14px;
  font-weight: bold;
}

.item-quantity {
  font-size: 14px;
  color: white;
}


.button-details-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  padding: 20px 20px 2px 20px;
}

.modal {
  display: none; 
  position: fixed; 
  z-index: 1; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.4); 
  align-items: center; 
  justify-content: center;
  padding-top: 60px; /* Location of the box */
}

.modal-content {
  background-color: var(--accentcolour);
  padding: 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 800px; /* Set a maximum width */
  max-height: 90%;
  overflow: hidden; /* Hide overflow to prevent scrollbars */
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  border-radius: 10px;
  margin: auto; 
  display: flex;
  flex-direction: column;
  align-items: center; 
  justify-content: center; 
  /*animation: modalOpen 0.3s ease-out;*/
  position: relative;
}

@keyframes modalOpen {
  from { opacity: 0 }
  to { opacity: 1 }
}

.close {
  color: #aaaaaa;
  position: absolute;
  top: 0px;
  right: 6px;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.clearfix::after {
  content: "";
  clear: both;
  display: table;
}

.boxlink, .boxlinkalt {
  background-color: var(--bgcolour);
  border-radius: 4px;
  color: white;
  font-weight: normal;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  text-decoration: none;
  border: none;
  display: inline-block;
  padding: 5px 10px;
  margin-bottom: 5px;
}

.boxlink:hover, .boxlinkalt:hover {
  background-color: var(--accentcolour);
}

.logo {
  width: 250px;
  object-fit: scale-down;
  object-position: 0px 0px;
}

.floatyimage {
  float: left;
  margin-right: 20px;
  width: 55%;
  border-color: black;
  border-style: solid;
}

@media (max-width: 800px) {
  .floatyimage  {
      width: 100%;
  }
}

.div-clear {
  clear: both;
}

.footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: var(--primarycolour);
  color: white;
  text-align: center;
  font-size: 16px;
  padding: 5px;
}

.centreimage {
  width: 800px;
  object-fit: scale-down;
  display: block;
  margin: 0 auto;
  border-color: black;
  border-style: solid;
}

table, th, td {
  margin: auto;
  border: 1px solid black;
  border-collapse: collapse;
}

table {
  width: 95%;
}

th, td, tr {
  padding: 2px;
  font-family: Arial, sans-serif;
  border: 1px solid black;
}

table tr:nth-of-type(even) { 
  background-color: #dadada; 
}

table tr:nth-of-type(odd) { 
  background-color: #ffffff; 
}

table tr:first-of-type { 
  background-color: rgb(88, 88, 88); 
  color: #eaeaea; 
  font-size: 12px;
}

[type="checkbox"] {
  vertical-align: middle;
}

.infoText {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  text-align: left;
  float: right;
}

.pHeader, .sHeader, .aHeader, .pinkHeader {
  border: 1px solid black;
  font-weight: bold;
  padding: 2px;
}

.pHeader {
  background-color: var(--primarycolour);
  color: black;
}

.sHeader {
  background-color: var(--secondarycolour);
  color: black;
}

.aHeader {
  background-color: var(--accentcolour);
  color: black;
}

.pinkHeader {
  background-color: #ffaacd;
}

.descText {
  font-size: x-small;
}

/* SPARKLE STUFF BELOW FOR TEST */

.sparkle-image-container {
  position: relative;
  display: inline-block;
}

.sparkle-image {
  display: block;
  width: 100px; /* Adjust the size of the image as needed */
  height: auto;
}

.sparkle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

@keyframes sparkle {
  0% {
      opacity: 0;
      transform: scale(0);
  }
  50% {
      opacity: 1;
      transform: scale(1);
  }
  100% {
      opacity: 0;
      transform: scale(0);
  }
}

.sparkle {
  position: absolute;
  width: 5px;
  height: 5px;
  background-color: yellow;
  border-radius: 50%;
  opacity: 0;
  animation: sparkle 1s infinite;
}

/* Create multiple sparkles with different positions and animation delays */
.sparkle:nth-child(1) { top: 20%; left: 30%; animation-delay: 0.2s; }
.sparkle:nth-child(2) { top: 50%; left: 70%; animation-delay: 0.4s; }
.sparkle:nth-child(3) { top: 80%; left: 40%; animation-delay: 0.6s; }
.sparkle:nth-child(4) { top: 10%; left: 80%; animation-delay: 0.8s; }
.sparkle:nth-child(5) { top: 60%; left: 20%; animation-delay: 1s; }
.sparkle:nth-child(6) { top: 30%; left: 50%; animation-delay: 1.2s; }