:root {
  color-scheme: light dark;
  --primary-color: light-dark(#28a745, #1e7e34);
  --danger-color: #dc3545;
  --bg-color: light-dark(#f8f9fa, #121212);
  --card-bg: light-dark(#ffffff, #1e1e1e);
  --text-color: light-dark(#212529, #e0e0e0);
  --text-muted: light-dark(#6c757d, #adb5bd);
  --border-color: light-dark(#dee2e6, #444);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --radius: 8px;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
  background-color: var(--bg-color);
  color: var(--text-color);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

input,
textarea,
button {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  font-weight: 500;
}
button:hover {
  opacity: 0.9;
}

.note-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.note-form button {
  background-color: var(--primary-color);
  color: white;
}

#note-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.note-item {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-color);
}

.note-item h3 {
  margin-top: 0;
}

.note-delete {
  background: var(--danger-color);
  color: white;
  font-size: 0.8rem;
  margin-top: 1rem;
}

.auth-form {
  max-width: 400px;
  margin: 4rem auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}
.btn-secondary {
  background-color: var(--text-muted);
  color: white;
}

.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator {
  display: inline-block;
}
.htmx-request.htmx-indicator {
  display: inline-block;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
