:root {
  --white: #ffffff;
  --light-grey: #f2f2f2;
  --dark-grey: #555555;
  --black: #000000;
  --green: #006400;
  --border-width: 3px;
  --header-height: 15vh;
  --footer-height: 5vh;
}

html, body {
  height: 100%;
  min-height: 100vh;
  overflow-y: auto;
}

body {
  height: 100%;
  margin: 0;
  font-family: Courier new;
  background-color: var(--light-grey);
  color: var(--green);
  text-align: center;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 1 auto;
  height: calc(100vh - var(--header-height) - var(--footer-height));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

#header-placeholder,
header {
  background-color: var(--green);
  border: var(--border-width) solid var(--black);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0.5rem 1rem;
  overflow: hidden;
  width: 100%;
}

#footer-placeholder,
footer {
  height: var(--footer-height);
  box-sizing: border-box;
  background-color: var(--dark-grey);
  color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  width: 100%;
}

.header-top {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

header h1 {
  color: var(--white);
  flex-shrink: 0;
  margin: 10px;
  padding: 0px;
  text-align: center;
}

#menu-toggle {
  display: none;
  background: var(--white);
  color: var(--green);
  border: var(--border-width) solid var(--black);
  padding: 5px 10px;
  font-size: 1.2rem;
  position: absolute;
  right: 0;
}

nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  flex-shrink: 1;
}

nav a {
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  border: var(--border-width) solid transparent;
  transition: border-color 0.2s;
  background-color: transparent;
  color: var(--white);
  box-sizing: border-box;
}

nav a:hover {
  border-color: currentColor;
  background-color: transparent;
  color: var(--white);
}

ul {
  list-style-position: inside;
  text-align: left;
  display: inline-block;
}

button {
  background-color: var(--green);
  color: var(--white);
  border: var(--border-width) solid var(--black);
  padding: 6px 12px;
  margin: 10px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: var(--light-grey);
  color: var(--green);
}

button.active {
  background-color: var(--light-grey);
  color: var(--green);
}


form label {
  display: inline-block;
  width: 100px;
  text-align: right;
  margin-right: 10px;
}

form input,
form textarea {
  width: 300px;
  box-sizing: border-box;
  vertical-align: top;
}

form textarea {
  width: 800px;
  height: 150px;
}

#posts-wrapper {
  flex: 1 1 auto;
  background-color: var(--white);
  max-width: 90vw;
  margin: auto;
  width: 100%;
  overflow-y: auto;
}

#posts-container {
  height: 85%;
  padding: 15px;
  border-radius: 12px;
  box-sizing: border-box;
}

#posts-container img,
#posts-container video {
  max-width: 70%;
  max-height: 70%;
  height: auto;
  border: var(--border-width) solid var(--green);
  border-radius: 8px;
  box-sizing: border-box;
  display: block;
	margin: 10px auto;
}

#posts-container figcaption {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--dark-grey);
  margin-top: 4px;
  margin-bottom: 15px;
  text-align: center;
  max-width: 70%;
  margin-left: auto;
  margin-right: auto;
}

.tag-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.end-break {
  border: none;
  height: 20px;
  background: transparent;
}

.image-container {
  width: 300px;
  height: auto;
  overflow: hidden;
  margin: 0 auto;
}

.image-container img {
  width: 100%;
  height: auto;
  display: block;
}

.price {
  font-style: italic;
}

.lists-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 80px;
  text-align: left;
  margin: 0 auto;
  width: fit-content;
}

#control-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.copy-load-group,
.behaviour-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#control-container button {
  flex: 1 1 auto;
  margin: 5px 0;
}

#chat-container {
  width: 60%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 70vh;
}

#chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  box-sizing: border-box;
  border: 2px solid var(--green);
  border-radius: 8px;
  background-color: var(--white);
}

#chat-input-area {
  display: flex;
  gap: 10px;
  padding: 20px;
}

#chat-input {
  font-family: "Courier New", monospace;
  flex: 1 1 auto;
  padding: 8px;
  font-size: 1rem;
}

#chat-send {
  flex: 0 0 auto;
  padding: 8px 16px;
}

.chat-message {
  text-align: right;
  font-weight: bold;
}

.chat-message.error,
.chat-message.bot {
  text-align: left;
  font-weight: bold;
}

.chat-message.bot {
  color: black;
}

.chat-message.error{
  color: red;
}

/* --- MOBILE STYLES --- */
@media (max-width: 768px) {
  #menu-toggle {
    display: block;
  }
	
	#chat-container {
		width: 90%;
		display: flex;
		flex-direction: column;
		gap: 10px;
		min-height: 60vh;
	}

  nav {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  nav a {
    text-align: center;
    width: 100%;
  }

  nav.show {
    display: flex;
  }

  header h1 {
    text-align: center;
    flex: 1;
  }

  #header-placeholder,
  header {
    height: auto;
    padding-bottom: 0.5rem;
    align-items: center;
  }
}
