:root {
  --primary-color: #6366f1;
  --secondary-color: #4f46e5;
  --background-color: #f8fafc;
  --card-background: #ffffff;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --input-border: #e2e8f0;
  --button-secondary: #e2e8f0;
  --button-secondary-hover: #cbd5e1;
  --option-pill-bg: #e2e8f0;
  --border-radius: 12px;
  --spacing: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #818cf8;
    --secondary-color: #6366f1;
    --background-color: #0f172a;
    --card-background: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --input-border: #334155;
    --button-secondary: #334155;
    --button-secondary-hover: #475569;
    --option-pill-bg: #334155;
  }
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--background-color);
  padding: var(--spacing);
}

header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem 0;
}

h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
}

main {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
}

.card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

h2 {
  color: var(--text-color);
  margin-bottom: 1.5rem;
}

.input-group {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.full-width {
  grid-column: 1 / -1;
}

.option-input-container {
  display: flex;
  gap: 0.5rem;
}

input {
  padding: 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius);
  font-size: 1rem;
  width: 100%;
  background-color: var(--card-background);
  color: var(--text-color);
}

input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: -1px;
}

button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.1s, background-color 0.2s;
}

button:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background-color: var(--secondary-color);
}

.btn-primary:disabled {
  background-color: var(--text-muted);
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--button-secondary);
  color: var(--text-color);
}

.btn-secondary:hover {
  background-color: var(--button-secondary-hover);
}

.result {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  min-height: 3rem;
}

.options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  min-height: 3rem;
}

.option-pill {
  background-color: var(--option-pill-bg);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.remove-option {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
}

.remove-option:hover {
  color: #ef4444;
}

footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--text-muted);
}

/* Animation classes */
.highlight {
  animation: highlight 0.5s ease-out;
}

@keyframes highlight {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Responsive design */
@media (min-width: 640px) {
  .input-group {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  body {
    padding: 0.5rem;
  }

  .card {
    padding: 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  .result {
    font-size: 1.5rem;
  }
}
