/* Book page specific styles */
html, body, .container, .sections, .section {
  box-sizing: border-box;
}

.sections {
  box-sizing: border-box;
}

.section {
  word-break: break-word;
  overflow-x: auto;
  margin-bottom: 2em;
  padding: 1em;
  background: #f9f9f9;
  border-radius: 4px;
}

/* Control header sizes in book content */
.section h1 {
  font-size: 1.2rem;
  margin: 0.5rem 0;
  color: #2c3e50;
}
.section h2 {
  font-size: 1.1rem;
  margin: 0.4rem 0;
  color: #2c3e50;
}
.section h3 {
  font-size: 1rem;
  margin: 0.3rem 0;
  color: #2c3e50;
}
.section h4, .section h5, .section h6 {
  font-size: 0.9rem;
  margin: 0.2rem 0;
  color: #2c3e50;
}

.section-content {
  margin-bottom: 1em;
}

.highlighted-bullet {
  background: #ff8;
  color: black;
  padding: 0.5em 1em;
  border-radius: 8px;
  margin: 0.5em 0;
}

li.highlighted-bullet {
  background: #ff8;
  color: black;
  padding: 0.5em 1em;
  border-radius: 8px;
  margin: 0.5em 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2em auto;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 8px #eee;
}

.toggle-button {
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #dee2e6;
  padding: 0.25em 0.5em;
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 0.5em;
  font-size: 0.75em;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.toggle-button:hover {
  background: #e9ecef;
  opacity: 1;
}

.original-text {
  display: none;
  background: #f5f5f5;
  padding: 1em;
  border-radius: 4px;
  border-left: 4px solid #007bff;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  line-height: 1.4;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}

.summary-content {
  display: block;
}

.arbitrary-prompt-btn {
  position: absolute;
  top: 1.5rem;
  right: 1rem;
  background: #f8f9fa;
  color: #aaa;
  border: 1px solid #eee;
  border-radius: 3px;
  font-size: 0.85em;
  padding: 0.25em 0.7em;
  opacity: 0.5;
  cursor: pointer;
  z-index: 10;
  transition: opacity 0.2s, color 0.2s;
  max-width: calc(100vw - 2rem);
  box-sizing: border-box;
}

.arbitrary-prompt-btn:hover {
  opacity: 1;
  color: #007bff;
  border-color: #007bff;
}

.arbitrary-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.3);
}

.arbitrary-modal-content {
  background: #fff;
  margin: 7vh auto;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  width: 95%;
  max-width: 500px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  position: relative;
}

.arbitrary-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  color: #aaa;
  font-size: 1.5em;
  cursor: pointer;
  font-weight: bold;
}

.arbitrary-modal-close:hover {
  color: #333;
}

.arbitrary-modal label {
  font-size: 0.95em;
  color: #555;
  margin-bottom: 0.2em;
  display: block;
}

.arbitrary-modal input, .arbitrary-modal textarea {
  width: 100%;
  margin-bottom: 0.7em;
  padding: 0.4em;
  border-radius: 3px;
  border: 1px solid #ddd;
  font-size: 1em;
}

.arbitrary-modal .btn {
  font-size: 0.95em;
  padding: 0.4em 1.2em;
  border-radius: 3px;
  border: none;
  background: #eee;
  color: #333;
  cursor: pointer;
  margin-right: 0.5em;
}

.arbitrary-modal .btn-primary {
  background: #007bff;
  color: #fff;
}

.arbitrary-modal .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.arbitrary-modal .progress {
  height: 16px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin: 0.7em 0;
}

.arbitrary-modal .progress-bar {
  height: 100%;
  background: #007bff;
  transition: width 0.3s ease;
}

.arbitrary-modal .results-container {
  background: #fafbfc;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 0.7em;
  margin-top: 0.7em;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.97em;
}

.arbitrary-result-container {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 1em;
  margin: 1em 0;
  border-left: 4px solid #007bff;
}

.arbitrary-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5em;
  font-size: 0.9em;
}

/* Book-specific styles */
html, body, .container, .sections, .section {
  box-sizing: border-box;
}
.sections {
  box-sizing: border-box;
}
.section {
  word-break: break-word;
  overflow-x: auto;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f9f9f9;
  border-radius: 4px;
}
.section-content {
  margin-bottom: 0.5rem;
}
.highlighted-bullet {
  background: #ff8;
  color: black;
  padding: 0.25em 0.5em;
  border-radius: 4px;
  margin: 0.25em 0;
}
li.highlighted-bullet {
  background: #ff8;
  color: black;
  padding: 0.25em 0.5em;
  border-radius: 4px;
  margin: 0.25em 0;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
  border: 1px solid #ccc;
  box-shadow: 1px 1px 4px #eee;
}
.toggle-button {
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #dee2e6;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 0.5rem;
  font-size: 0.75em;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.toggle-button:hover {
  background: #e9ecef;
  opacity: 1;
}
.original-text {
  display: none;
  background: #f5f5f5;
  padding: 0.75rem;
  border-radius: 4px;
  border-left: 3px solid #007bff;
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  line-height: 1.3;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}
.summary-content {
  display: block;
}
.arbitrary-prompt-btn {
  position: absolute;
  top: 1rem;
  right: 0.5rem;
  background: #f8f9fa;
  color: #aaa;
  border: 1px solid #eee;
  border-radius: 3px;
  font-size: 0.8em;
  padding: 0.2em 0.5em;
  opacity: 0.5;
  cursor: pointer;
  z-index: 10;
  transition: opacity 0.2s, color 0.2s;
  max-width: calc(100vw - 1rem);
  box-sizing: border-box;
}
.arbitrary-prompt-btn:hover {
  opacity: 1;
  color: #007bff;
  border-color: #007bff;
}
.arbitrary-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.3);
}
.arbitrary-modal-content {
  background: #fff;
  margin: 5vh auto;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  width: 95%;
  max-width: 450px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  position: relative;
}
.arbitrary-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  color: #aaa;
  font-size: 1.3em;
  cursor: pointer;
  font-weight: bold;
}
.arbitrary-modal-close:hover {
  color: #333;
}
.arbitrary-modal label {
  font-size: 0.9em;
  color: #555;
  margin-bottom: 0.15em;
  display: block;
}
.arbitrary-modal input, .arbitrary-modal textarea {
  width: 100%;
  margin-bottom: 0.5em;
  padding: 0.3em;
  border-radius: 3px;
  border: 1px solid #ddd;
  font-size: 0.95em;
}
.arbitrary-modal .btn {
  font-size: 0.9em;
  padding: 0.3em 1em;
  border-radius: 3px;
  border: none;
  background: #eee;
  color: #333;
  cursor: pointer;
  margin-right: 0.5em;
}
.arbitrary-modal .btn-primary {
  background: #007bff;
  color: #fff;
}
.arbitrary-modal .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.arbitrary-modal .progress {
  height: 12px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  margin: 0.5em 0;
}
.arbitrary-modal .progress-bar {
  height: 100%;
  background: #007bff;
  transition: width 0.3s ease;
}
.arbitrary-modal .results-container {
  background: #fafbfc;
  border: 1px solid #eee;
  border-radius: 3px;
  padding: 0.5em;
  margin-top: 0.5em;
  max-height: 150px;
  overflow-y: auto;
  font-size: 0.9em;
}
.arbitrary-result-container {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 0.75rem;
  margin: 0.75rem 0;
  border-left: 3px solid #007bff;
}
.arbitrary-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4em;
  font-size: 0.85em;
}
.arbitrary-result-status {
  font-weight: 500;
  color: #6c757d;
}
.arbitrary-result-status.complete {
  color: #28a745;
}
.arbitrary-result-status.error {
  color: #dc3545;
}
.arbitrary-result-content {
  font-size: 0.9em;
  line-height: 1.4;
}
.global-progress-indicator {
  position: fixed;
  top: 15px;
  right: 15px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 1000;
  min-width: 250px;
}
.global-progress-content {
  padding: 0.75rem;
}
.global-progress-text {
  font-size: 0.85em;
  color: #555;
  margin-bottom: 0.4em;
}
.global-progress-bar {
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.4em;
}
.global-progress-fill {
  height: 100%;
  background: #007bff;
  transition: width 0.3s ease;
}
.global-progress-close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: none;
  border: none;
  font-size: 1.1em;
  color: #aaa;
  cursor: pointer;
  padding: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.global-progress-close:hover {
  color: #333;
}
.global-progress-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.4em;
}
.global-progress-stop {
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #dee2e6;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.7em;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.global-progress-stop:hover {
  background: #e9ecef;
  opacity: 1;
}
.arbitrary-result-status.stopped {
  color: #6c757d;
} 