:root {
  --primary-color: #06436e;
  --accent-color: #2f7ce0;
  --background-color: #ffffff;
  --button-color: #06436e;
  --button-hover: #1a4e66;
  --text-color: #000000;
  --feedback-bg: #eef6ff;
  --feedback-border: #007acc;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.03rem;
  line-height: 1.6;
}

.container {
  max-width: 70%;
  margin: auto;
  padding: 1.5rem;
  background-color: #E2EEF7;
  overflow-wrap: break-word;
}

h1, h2 {
  color: var(--primary-color);
  text-align: center;
}

h3 {
  color: var(--primary-color);
}

/* Links */
a {
  color: var(--accent-color);
  font-weight: bold;
  text-decoration: underline;
}

/* Layout for index page */
.layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.image-container {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.image-container img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

.text-container {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  max-width: 600px;
  flex: 1;
  text-align: left;
}

/* Form elements */
form {
  margin-top: 1rem;
}

label {
  display: block;
  margin-bottom: 0.75rem;
}

select {
  font-size: 1rem;
  margin: 0 4px;
  padding: 4px;
}

textarea {
  width: 100%;
  max-width: 100%;
  height: 150px;
  box-sizing: border-box;
  resize: vertical;
  font-size: 1.03rem;
}

button {
  background-color: var(--button-color);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 1rem;
  touch-action: manipulation;
}

button:hover,
button:focus {
  background-color: var(--button-hover);
  outline: none;
}

/* Navigation buttons */
.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.nav-buttons button {
  flex: 0 1 auto;
  min-width: 120px;
}

/* Feedback display */
.feedback {
  display: none;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 2px solid var(--feedback-border);
  border-radius: 8px;
  background-color: var(--feedback-bg);
  white-space: pre-line;
}

/* Gap fill activity elements */
.keywords {
  background-color: #f9f9f9;
  border: 1px dashed var(--accent-color);
  border-radius: 8px;
  padding: 1rem;
  margin: 1.5rem auto;
  max-width: 60%;
  text-align: center;
}

.gap-container {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#gapParagraph {
  line-height: 2.3;
}

/* Instruction box */
.instruction-box {
  background-color: #f9f9f9;
  border: 1px dashed var(--accent-color);
  border-radius: 8px;
  padding: 0.5rem;
  margin: 1.5rem auto;
  max-width: 60%;
  text-align: center;
}

/* Responsive design */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
    max-width: 100%;
  }

  .layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .text-container {
    text-align: left;
    width: 100%;
  }

  .nav-buttons {
    flex-direction: column;
    align-items: center;
  }

  .nav-buttons button {
    width: auto;
  }

  select {
    display: inline-block;
    margin-top: 0.5rem;
  }
  
  .keywords, .instruction-box {
    max-width: 100%;
  }
}