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

body {
  font-family: "Open Sans", sans-serif;
  background-color: #f5f9ff;
  color: #333;
  line-height: 1.6;
  padding: 40px;
}

/* Layout */
.container {
  width: 800px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
  text-align: center;
  margin-bottom: 30px;
}

h1 {
  font-family: "Libre Baskerville", serif;
  color: #2a5ca7;
  font-size: 2.5em;
  margin-bottom: 10px;
}

.tagline {
  color: #666;
  font-style: italic;
}

/* Form */
#poemForm {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

#poemTopic {
  flex: 1;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

#poemTopic:focus {
  outline: none;
  border-color: #2a5ca7;
}

button {
  padding: 12px 25px;
  background: #2a5ca7;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
}

button:hover {
  background: #1e4b8f;
}

/* Poem Output */
.poem-output {
  min-height: 200px;
  padding: 20px;
  background: #f8fafc;
  border-left: 4px solid #2a5ca7;
  font-style: italic;
  line-height: 1.8;
  border-radius: 8px;
}

/* Loading & Error States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #2a5ca7;
  font-style: italic;
  min-height: 100px;
}

.error {
  color: #d32f2f;
  background: #ffebee;
  padding: 15px;
  border-radius: 4px;
  border-left: 3px solid #d32f2f;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(42, 92, 167, 0.2);
  border-radius: 50%;
  border-top-color: #2a5ca7;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Footer */
footer {
  text-align: center;
  color: #666;
  font-size: 0.9em;
  margin-top: 30px;
}

footer a {
  color: #2a5ca7;
  text-decoration: none;
  font-weight: 600;
}

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