:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --border-color: #cccccc;
  --modal-bg: rgba(0, 0, 0, 0.5);
  --button-bg: #ffffff;
  --button-border: #cccccc;
  --button-hover: #e9e9e9;
  --input-bg: #ffffff;
  --fieldset-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --border-color: #444444;
    --modal-bg: rgba(0, 0, 0, 0.8);
    --button-bg: #2a2a2a;
    --button-border: #555555;
    --button-hover: #3a3a3a;
    --input-bg: #2a2a2a;
    --fieldset-bg: #2a2a2a;
  }
}

body {
  font-family: sans-serif;
  font-family: 1.2em;
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
  line-height: 1.5;
  background-color: var(--bg-color);
  color: var(--text-color);
}
header,
main,
footer,
section,
fieldset,
article,
form,
div,
label,
input,
select,
textarea,
button {
  margin-bottom: 0.5rem;
}
label {
  margin-right: 1ch;
}
fieldset {
  padding: 0.5rem;
  background-color: var(--fieldset-bg);
  border: 1px solid var(--border-color);
}
input, select, textarea, button {
  margin: 0.25rem 0;
  background-color: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}
button {
  background-color: var(--button-bg);
  cursor: pointer;
}
button:hover {
  background-color: var(--button-hover);
}
h1, h2, h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
textarea {
  width: 100%;
  height: 30ch;
  box-sizing: border-box;
}
#modeToggle {
  margin: 1rem 0;
}

/* Modal overlay for dialogs */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modal-bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-dialog {
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  max-width: 400px;
  width: 90%;
  padding: 1rem;
}

/* PWA-specific styles */
.install-banner {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.install-banner button {
  background: white;
  color: #2196f3;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

#dismiss-btn {
  background: transparent !important;
  color: white !important;
}

.offline-banner {
  background: #ff9800;
  color: white;
  text-align: center;
  padding: 0.5rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

body.offline {
  filter: grayscale(0.5);
}
