:root {
  --bg-primary: #faf9f6;
  --bg-secondary: #ffffff;
  --text-primary: #333;
  --text-secondary: #7f8c8d;
  --text-muted: #95a5a6;
  --border-color: rgba(0,0,0,0.1);
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
  --button-primary: #3498db;
  --button-primary-hover: #2980b9;
  --button-secondary: #95a5a6;
  --button-secondary-hover: #7f8c8d;
  --button-disabled: #bdc3c7;
  --error-bg: #fadbd8;
  --error-text: #e74c3c;
  --success-text: #27ae60;
  --font-family: 'Georgia', serif;
}

.dark-mode {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --text-muted: #808080;
  --border-color: rgba(255,255,255,0.1);
  --shadow: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 8px rgba(0,0,0,0.4);
  --button-primary: #4a9eff;
  --button-primary-hover: #357abd;
  --button-secondary: #6c757d;
  --button-secondary-hover: #5a6268;
  --button-disabled: #495057;
  --error-bg: #2d1b1b;
  --error-text: #ff6b6b;
  --success-text: #51cf66;
}

.sans-serif {
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

footer {
  text-align: center;
  margin-top: 2rem;
}

#app {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
}

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

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

h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.book-list {
  list-style: none;
}

.book-item {
  margin-bottom: 1rem;
}

.book-button {
  width: 100%;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: none;
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: left;
  font-family: inherit;
}

.book-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.dark-mode .book-button:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.book-button:focus {
  outline: 2px solid var(--button-primary);
  outline-offset: 2px;
}

.book-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.book-author {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.book-progress {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.reading-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.reading-text {
  font-size: 1.4rem;
  line-height: 1.8;
  margin-bottom: 3rem;
  max-width: 650px;
  color: var(--text-primary);
}

.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background: var(--button-primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

button:disabled {
  background: var(--button-disabled);
  cursor: not-allowed;
}

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

.dark-mode-select {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  min-width: 120px;
}

.dark-mode-select:hover {
  background: var(--button-secondary);
  border-color: var(--button-secondary-hover);
}

.dark-mode-select:focus {
  outline: none;
  border-color: var(--button-primary);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.font-select {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  min-width: 120px;
}

.font-select:hover {
  background: var(--button-secondary);
  border-color: var(--button-secondary-hover);
}

.font-select:focus {
  outline: none;
  border-color: var(--button-primary);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.progress-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.completed-view {
  text-align: center;
  padding: 3rem;
}

.completed-view h2 {
  color: var(--success-text);
  margin-bottom: 2rem;
}

.error {
  color: var(--error-text);
  padding: 1rem;
  background: var(--error-bg);
  border-radius: 6px;
  margin-bottom: 1rem;
}

.loading {
  text-align: center;
  padding: 2rem;
  font-size: 1.2rem;
  color: var(--text-secondary);
}

/* About Page Styles */
.about-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
}

.about-reading-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.about-text {
  font-size: 1.4rem;
  line-height: 1.8;
  margin-bottom: 3rem;
  max-width: 650px;
  color: var(--text-primary);
}

.about-text p {
  margin-bottom: 2rem;
}

.about-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.back-link {
  color: white !important;
  text-decoration: none;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--button-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

/* Link styles */
a {
  color: var(--button-primary);
  text-decoration: underline;
}

.dark-mode a:visited {
  color: var(--text-muted);
}