body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #e8f0ff, #fef9ff);
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

body.dark {
  background: #121212;
  color: #f8f9fa;
}

.container {
  text-align: center;
  width: 90%;
  max-width: 650px;
  background: white;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: background 0.3s, color 0.3s;
}

body.dark .container {
  background: #1f1f1f;
  color: #e4e4e4;
}

.mode-toggle {
  text-align: right;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 0.3rem;
}

body.dark h1 {
  color: #fff;
}

.subtitle {
  font-size: 1rem;
  color: #6c757d;
  margin-bottom: 1.5rem;
}

body.dark .subtitle {
  color: #bfbfbf;
}

.card {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 1rem;
}

input {
  flex: 1;
  padding: 0.8rem;
  font-size: 1rem;
  border: 1px solid #ced4da;
  border-radius: 10px;
  outline: none;
  transition: border 0.3s ease;
}

input:focus {
  border-color: #007bff;
}

button {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background-color: #0056b3;
}

body.dark button {
  background-color: #2196f3;
}

#loading {
  margin-top: 20px;
  font-style: italic;
  color: #555;
}

.hidden {
  display: none;
}

#resultCard {
  margin-top: 2rem;
  background: #f8f9fa;
  border-radius: 15px;
  padding: 1.2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: background 0.3s;
}

body.dark #resultCard {
  background: #2a2a2a;
}

#primaryWord {
  font-size: 1.8rem;
  font-weight: 600;
  color: #007bff;
}

body.dark #primaryWord {
  color: #4da8ff;
}

#definition {
  margin-top: 0.5rem;
  color: #333;
}

body.dark #definition {
  color: #ddd;
}

#alternatives {
  margin-top: 1rem;
  color: #666;
  font-style: italic;
}

body.dark #alternatives {
  color: #b3b3b3;
}

.actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 10px;
}

#retryBtn {
  background-color: #6c757d;
}

#retryBtn:hover {
  background-color: #555;
}

body.dark #retryBtn {
  background-color: #444;
}

body.dark #retryBtn:hover {
  background-color: #666;
}


/* Collapsible About Section */
.seo-text {
  text-align: center;
  margin: 1.5rem auto 1rem auto;
  max-width: 600px;
}

.toggle-about {
  background: none;
  border: none;
  color: #444;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.toggle-about:hover {
  color: #000;
}

body.dark .toggle-about {
  color: #ddd;
}

body.dark .toggle-about:hover {
  color: #fff;
}

/* Animated content */
.about-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.35s ease;
}

.about-content p {
  margin-top: 0.8rem;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5;
}

body.dark .about-content p {
  color: #ccc;
}

.about-content.open {
  max-height: 200px; /* enough for 1–2 paragraphs */
  opacity: 1;
}

/* Footer */
footer {
  text-align: center;
  font-size: 0.8rem;
  color: #888;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.08);
}

body.dark footer {
  color: #aaa;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Mobile */
@media (max-width: 600px) {
  .card {
    flex-direction: column;
  }
  button {
    width: 100%;
  }
}
