/* Base Reset and Mobile Scaling */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f4f4;
  color: #111;
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3 {
  text-align: center;
  margin-top: 1rem;
}

/* Container for All Pages */
.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
}

/* Forms */
input,
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #111;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 4px;
  margin-top: 0.5rem;
  cursor: pointer;
  width: 100%;
}

button:hover {
  background-color: #222;
}

/* Book/Chapter Cards */
.book-card,
.chapter-card,
.card {
  background: white;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.book-card a,
.chapter-card a {
  word-break: break-word;
  color: #1a73e8;
}

.book-card a:hover,
.chapter-card a:hover {
  text-decoration: underline;
}

/* Paragraph Preservation */
.chapter-content {
  white-space: pre-wrap;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding: 1rem;
  text-align: center;
  background: #333;
  color: white;
}

footer a {
  color: #eee;
  text-decoration: none;
  margin: 0 0.5rem;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive Enhancements */
@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  button {
    font-size: 1rem;
    padding: 0.75rem;
  }

  .container {
    padding: 1rem 0.75rem;
  }
}

/* Dark Mode */
body.dark-mode {
  background: #121212;
  color: #eee;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  background: #222;
  color: #eee;
  border-color: #555;
}

body.dark-mode .book-card,
body.dark-mode .chapter-card,
body.dark-mode .card {
  background: #1e1e1e;
  border: 1px solid #444;
}

body.dark-mode footer {
  background: #000;
}

body.dark-mode a {
  color: #9cf;
}

body.dark-mode .chapter-content {
  background: transparent;
  color: #eee;
}

/* Login Page Box */
.box {
  max-width: 400px;
  margin: auto;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

body.dark-mode .box {
  background: #1e1e1e;
  border: 1px solid #333;
}

/* Error and Success Messages */
.error-text,
.error-message {
  margin-top: 1rem;
  color: red;
  font-weight: bold;
  text-align: center;
}

.message {
  font-weight: bold;
  margin-top: 0.5rem;
  color: green;
}

body.dark-mode .message {
  color: lightgreen;
}

/* <details> and <summary> Styles */
details summary {
  cursor: pointer;
  font-weight: bold;
  padding: 0.5rem 0;
  margin-top: 1rem;
  color: #333;
}

details[open] {
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 8px;
}

body.dark-mode details summary {
  color: #ccc;
}

body.dark-mode details[open] {
  background: #1e1e1e;
  border: 1px solid #444;
}