/* Lukas's Meme Generator */
body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: "Poppins", sans-serif;
  background-color: rgb(22, 27, 75);
  color: #e0e0ff;
}

/* Form Reset CSS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

input,
select,
textarea,
button {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

button,
input {
  overflow: visible;
}

button,
select {
  text-transform: none;
}

/* area 1 ////////////////////////////////////////////////////////*/
#area1 {
  background-color: rgb(22, 27, 75);
  min-height: 920px; /* Changed from height: 100% */
  width: 100%;
  position: relative;
}

.background-image-1 {
  background-image: url(images/city-and-platform.svg);
  background-position: center;
  background-repeat: no-repeat;
  height: 100%;
  width: 100%;
  margin-top: 20px;
  position: absolute;
  display: block;
  z-index: 1;
}
.background-image-2 {
  background-image: url(images/city-and-platform2.svg);
  background-position: center;
  background-repeat: no-repeat;
  height: 100%;
  width: 100%;
  margin-top: 20px;
  position: absolute;
  z-index: 0;
}

/* area 2 ////////////////////////////////////////////////////////*/
#area2 {
  background-color: rgb(81, 81, 87);
  color: white;
  min-height: 100vh; /* Changed from height: 90vh */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem; /* Added padding */
  z-index: 2;
}

#error-box {
  display: none;
  background-color: rgb(227, 89, 89);
  color: white;
  text-align: center;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem;
  width: 90%; /* Changed from 40vw */
  max-width: 500px; /* Added max-width */
  font-size: 1.2rem; /* Reduced from 1.5rem */
  font-weight: bold;
}

form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  background-color: rgb(118, 118, 126);
  min-height: auto; /* Changed from height: 65vh */
  width: 95%; /* Changed from 40vw */
  max-width: 600px; /* Added max-width */
  color: white;
  text-align: center;
  border: #e0e0ff solid 2px;
  border-radius: 0.5rem;
  margin: 1rem;
  padding: 1.5rem; /* Increased padding */
}

form > input {
  margin-bottom: 0.9rem;
}

form label {
  font-weight: bold;
  font-size: 1.1rem; /* Reduced from 1.5rem */
  color: rgb(230, 251, 255);
}

form input {
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: solid 2px #a4a4ff;
  background-color: rgb(208, 211, 255);
  color: rgb(94, 94, 94);
  text-align: center;
  width: 100%; /* Changed from 80% */
  max-width: 400px; /* Added max-width */
  font-size: 1rem; /* Reduced from 1.2rem */
  font-weight: bold;
}

form input:hover {
  background-color: #f8ff94;
  cursor: pointer;
}

form input:active {
  background-color: #f8ff94;
  cursor: pointer;
  border: solid 2px #f8ff94;
}

form button {
  padding: 0.7rem; /* Increased from 0.5rem */
  border-radius: 0.5rem;
  border: solid 2px #a4a4ff;
  background-color: rgb(228, 228, 228);
  color: rgb(17, 10, 69);
  text-align: center;
  width: 100%; /* Changed from 80% */
  max-width: 400px; /* Added max-width */
  font-size: 1.2rem; /* Reduced from 1.5rem */
  font-weight: bold;
  margin-top: 20px; /* Reduced from 50px */
}

form button:hover {
  background-color: #f8ff94;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.3rem; /* Reduced from 1.6rem */
  border: solid 2px #f8ff94;
}

input:invalid {
  box-shadow: 0 0 5px 1px red;
}

input:valid {
  box-shadow: 0 0 5px 1px rgb(11, 199, 232);
}

/* area 3 ////////////////////////////////////////////////////////*/
#area3 {
  background-color: black;
  color: white;
  display: flex;
  justify-content: space-evenly;
  flex-direction: row;
  flex-wrap: wrap;
  min-height: 100vh; /* Changed from height: 100vh */
  padding: 15px; /* Reduced from 30px */
}

.meme-image {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin: 4px;
}

.top-text {
  color: white;
  text-align: center;
  font-family: Arial;
  font-weight: 600;
  text-shadow: 2px 2px 4px #000000;
  margin-bottom: auto;
  padding-top: 1rem;
}

.top-text h1 {
  font-size: 1.2rem; /* Added responsive font size */
}

.bottom-text {
  color: white;
  text-align: center;
  font-family: Arial;
  font-weight: 600;
  text-shadow: 2px 2px 4px #000000;
  padding-bottom: 1rem;
}

.bottom-text h1 {
  font-size: 1.2rem; /* Added responsive font size */
}

.box-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.box {
  background-color: lightgray;
  padding: 1px;
  color: black;
  display: flex;
  flex-direction: column;
  justify-content: left;
  align-items: space-between;
  gap: 1rem;
  height: 400px; /* Changed from 54vh */
  width: 95%; /* Changed from 30vw for mobile first */
  max-width: 450px; /* Added max-width */
  border-radius: 4px;
  border: solid 2px #a4a4ff53;
}

#close-button {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px; /* Reduced from 50px */
  width: 40px; /* Reduced from 50px */
  margin: 0.5rem; /* Reduced from 1rem */
  cursor: pointer;
  font-size: 1.2rem; /* Added font size */
}

/* Tablet and larger screens (768px and up) */
@media (min-width: 768px) {
  form label {
    font-size: 1.3rem;
  }

  .box {
    width: 45%;
    height: 450px;
  }

  .top-text h1,
  .bottom-text h1 {
    font-size: 1.5rem;
  }

  #close-button {
    height: 50px;
    width: 50px;
    margin: 1rem;
  }
}

/* Desktop screens (1024px and up) */
@media (min-width: 1024px) {
  form {
    width: 40vw;
    min-width: 500px;
  }

  form label {
    font-size: 1.5rem;
  }

  form input {
    font-size: 1.2rem;
  }

  form button {
    font-size: 1.5rem;
    margin-top: 50px;
  }

  .box {
    width: 30vw;
    min-width: 350px;
    height: 54vh;
  }

  .top-text h1,
  .bottom-text h1 {
    font-size: 2rem;
  }

  #error-box {
    width: 40vw;
    font-size: 1.5rem;
  }
}
