/* style.css */

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

html, body {
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background-color: #edf5ec; /* soft greenish-grey, complements header */
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header h1 {
  background-color: #2d6a4f;
  color: white;
  padding: 20px;
  text-align: center;
  font-size: 2.5rem;
}

nav a {
  margin: 0 10px;
  color: white;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

main {
  flex: 1; /* Ensures main grows and pushes footer down */
  padding: 20px;
  min-height: calc(100vh - 160px); /* 100vh minus header + footer */
}

form {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  margin: 20px auto;
}

input,
button,
textarea {
  font-size: 16px;
  padding: 10px;
  margin: 8px 0;
  width: 100%;
}

textarea {
  resize: vertical;
}

/* Flex container for admin forms */
.admin-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.admin-flex form {
  flex: 1 1 400px;
  max-width: 500px;
}

/* Footer */
footer {
  text-align: center;
  padding: 10px;
  background-color: #ddd;
  margin-top: auto;
  width: 100%;
}

/* Responsive fix */
@media (max-width: 768px) {
  nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  form {
    margin: 20px 10px;
  }

  input, button, textarea {
    font-size: 15px;
  }

  header h1 {
    font-size: 1.8rem;
  }
}

/* Layout for role buttons */
.role-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  padding: 12px 24px;
  background-color: #2d6a4f;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.button:hover {
  background-color: #22543d;
}

/* Center the homepage content vertically */
.homepage-main {
  min-height: calc(100vh - 140px); /* Adjust based on header + footer */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.intro p {
  max-width: 700px;
  margin: 0 auto 30px;
  font-size: 18px;
  line-height: 1.6;
  color: #333;
  text-align: center;
}

/* User Auth Container */
.auth-container {
  max-width: 400px;
  margin: 30px auto;
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.auth-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.toggle-button {
  flex: 1;
  padding: 12px;
  background-color: #e0e0e0;
  border: none;
  cursor: pointer;
  font-weight: bold;
  border-radius: 6px 6px 0 0;
  transition: background-color 0.3s;
}

.toggle-button.active {
  background-color: #2d6a4f;
  color: white;
}

.toggle-button:not(:last-child) {
  margin-right: 5px;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-form input,
.auth-form button {
  margin-top: 10px;
  font-size: 16px;
  padding: 10px;
}

.hidden {
  display: none;
}

.results-section {
  margin-top: 20px;
  text-align: left;
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.results-section p {
  margin: 8px 0;
}

/* Ensure the nav in header is styled properly */
header nav {
  margin-top: 10px;
  text-align: center;
}

header nav a {
  color: white;
  text-decoration: none;
  background-color: #40916c;
  padding: 8px 16px;
  border-radius: 5px;
  display: inline-block;
  transition: background-color 0.3s ease;
}

header nav a:hover {
  background-color: #2d6a4f;
}

/* Subheader layout */
.subheader {
  background-color: #95d5b2; /* slightly lighter green */
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-bottom: 2px solid #2d6a4f;
}

.subheader h2 {
  margin: 0;
  font-size: 1.5em;
  color: #1b4332;
  flex: 1;
  text-align: center;
}

.subheader .home-link {
  text-decoration: none;
  background-color: #2d6a4f;
  color: white;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.95em;
  transition: background-color 0.3s ease;
}

/*.subheader .home-link {
  text-decoration: none;
  background-color: #2d6a4f;
  color: white;
  padding: 8px 10px;
  border-radius: 50%;
  font-size: 1.1em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}*/

.subheader .home-link:hover {
  background-color: #1b4332;
}

@media (max-width: 600px) {
  .subheader {
    flex-direction: column;
    align-items: center;
  }

  .subheader h2 {
    margin-bottom: 8px;
  }

  .subheader .home-link {
    align-self: flex-end;
  }
}

.form-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  margin-top: 50px; /* or more, like 30px */
}
