body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #a8edea, #fed6e3);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.container {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  font-size: x-small;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  width: 80%;
  max-width: 500px;
  text-align: center;
}

h1 {
  color: #333;
  margin-bottom: 1rem;
}

#question {
  font-size: 1rem;
  color: #667;
  margin-bottom: 1.5rem;
}

textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 460px;
  height: 150px;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 1rem;
  resize: none;
  margin: 0.5rem auto; /* centers horizontally inside .container */
  display: block;
}

button {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background-color: #8fbc8f;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
}

button:hover {
  background-color: #7aa77a;
}

#status {
  margin-top: 0.5rem;
  color: #666;
  font-size: 0.9rem;
}

footer {
  margin-top: 1rem;
  color: #888;
  font-size: 0.85rem;
}

a {
  color: #8fbc8f;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Saved answer cards */
.answers {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.answer-card {
  width: 90%;
  max-width: 460px;
  background: linear-gradient(180deg, #ffffff, #fbfbfb);
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  text-align: left;
}

.answer-question {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.answer-text {
  color: #222;
  font-size: 1rem;
  white-space: pre-wrap;
}

.message {
  margin-top: 0.5rem;
  color: #4a5568;
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .container {
    padding: 1.5rem;
  }
  textarea {
    height: 120px;
  }
}

#nextPrompt {
  display: inline-block;
  margin-top: 1rem;
  background: #e6f4ea;
  color: #4d7a4d;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
}



/* Modal background */
.modal {
  display: none; 
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.fade-in {
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}


/* Modal box */
.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Close button (the “×”) */
.close {
  color: #aaa;
  float: right;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #555;
}
