body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  margin: 0;
  padding: 2em;
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 500px;
  background: white;
  padding: 2em;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  margin: 40px auto;
  text-align: center;
}

h1, h2 {
  text-align: center;
  margin-bottom: 1em;
}

.brand {
  color: #2a7de1;
}

.intro {
  font-size: 1.1em;
  margin-bottom: 2em;
  text-align: center;
}

p {
  text-align: center;
  margin-top: 1em;
}

label {
  margin: 0.5em 0 0.25em;
  display: block;
  font-weight: bold;
}

.error {
  color: red;
  font-weight: bold;
  margin-bottom: 1em;
}

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

.form-box input,
textarea,
select {
  margin-bottom: 1em;
  padding: 0.75em;
  font-size: 1em;
  border-radius: 4px;
  border: 1px solid #ccc;
  width: 100%;
  box-sizing: border-box;
}

textarea {
  resize: vertical;
}

/* Unified Button Styles */
.btn,
button,
.form-box button {
  padding: 0.75em 1.5em;
  font-size: 1em;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s ease;
  line-height: 1.25rem;
}

button:hover,
.btn:hover {
  opacity: 0.9;
}

.btn.primary {
  background-color: #2a7de1;
  color: white;
}
.btn.primary:hover {
  background-color: #216ac4;
}

.btn.secondary {
  background-color: #4caf50;
  color: white;
}
.btn.secondary:hover {
  background-color: #3e8e41;
}

.btn.tertiary {
  background-color: #6c757d;
  color: white;
}
.btn.tertiary:hover {
  background-color: #5a6268;
}

.button-group {
  display: flex;
  justify-content: center;
  gap: 1em;
  flex-wrap: wrap;
  margin-top: 1.5em;
}

.lesson-box {
  background: #f0f0f0;
  padding: 1em;
  margin-bottom: 1.5em;
  border-left: 4px solid #2a7de1;
  border-radius: 4px;
}

.chat-wrapper {
  max-width: 800px;
  margin: 2em auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  height: 70vh;
}

.chat-box {
  flex: 1;
  padding: 1em;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow-y: auto;
  margin-bottom: 1em;
}

.message {
  margin-bottom: 1em;
  padding: 0.75em 1em;
  border-radius: 12px;
  line-height: 1.5;
  max-width: 80%;
}

.message.user {
  background-color: #2a7de1;
  color: white;
  align-self: flex-end;
  margin-left: auto;
}

.message.ai {
  background-color: #f0f0f0;
  align-self: flex-start;
  margin-right: auto;
}

.message.system {
  text-align: center;
  color: #888;
  font-style: italic;
  background: transparent;
  padding: 0;
}

.chat-input {
  display: flex;
  padding: 1em;
  border-top: 1px solid #ddd;
  gap: 0.5em;
}

.chat-input textarea {
  flex: 1;
  resize: none;
  padding: 0.75em;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.chat-input button {
  background-color: #2a7de1;
  color: white;
  border: none;
  padding: 0.75em 1em;
  border-radius: 6px;
  cursor: pointer;
}

.reset-button {
  background-color: #d9534f;
  color: white;
  padding: 0.6em 1em;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  margin-top: 0.5em;
}

.reset-button:hover {
  background-color: #c9302c;
}

.site-footer {
  text-align: center;
  font-size: 0.9em;
  color: #666;
  padding: 30px 10px 10px;
  margin-top: 40px;
}
.site-footer a {
  color: #007BFF;
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  body {
    padding: 1em;
    font-size: 16px;
  }

  h1, h2 {
    font-size: 1.5em;
  }

  .container {
    padding: 1.5em;
  }

  .intro {
    font-size: 1em;
  }

  .btn {
    font-size: 1em;
    padding: 0.75em;
  }

  .button-group {
    flex-direction: column;
    gap: 0.75em;
    align-items: stretch;
  }

  .chat-box {
    font-size: 0.95em;
  }

  .chat-input {
    flex-direction: column;
    gap: 0.5em;
  }

  .chat-input textarea,
  .chat-input button {
    width: 100%;
  }
}
