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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  background-color: #2c3e50;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 1.5rem;
}

#user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#user-name {
  color: white;
  font-size: 0.9rem;
}

.btn-login,
.btn-logout {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s;
  cursor: pointer;
}

.btn-login {
  background-color: #4285f4;
  color: white;
  border: 1px solid #4285f4;
}

.btn-login:hover {
  background-color: #357ae8;
}

.btn-logout {
  background-color: transparent;
  color: white;
  border: 1px solid white;
}

.btn-logout:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#admin-link {
  margin-right: 0.5rem;
}

#main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#sidebar {
  width: 250px;
  background-color: white;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  padding: 1rem;
}

#sidebar h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

#book-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.book-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 0.9rem;
}

.book-item:hover {
  background-color: #ecf0f1;
}

.book-item.active {
  background-color: #3498db;
  color: white;
}

#content {
  flex: 1;
  background-color: white;
  overflow-y: auto;
  padding: 2rem;
}

#chapter-selector {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

#propose-change-btn {
  margin-left: auto;
}

#propose-change-btn:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
  opacity: 0.6;
}

#chapter-selector label {
  font-weight: bold;
}

#chapter-select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  min-width: 150px;
}

#chapter-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #2c3e50;
}

#verses {
  max-width: 900px;
}

.verse {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  line-height: 1.8;
}

.verse:hover {
  background-color: #e9ecef;
}

.verse.selected {
  background-color: #e3f2fd;
  border-left: 4px solid #3498db;
}

.verse-number {
  display: inline-block;
  font-weight: bold;
  color: #3498db;
  margin-right: 0.5rem;
  min-width: 30px;
}

.chapter-divider {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
  padding: 1rem 0.75rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-top: 2px solid #3498db;
  border-bottom: 1px solid #ecf0f1;
  background-color: #f8f9fa;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
  display: block;
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 700px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-height: 85vh;
  overflow-y: auto;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close:hover,
.close:focus {
  color: #000;
}

.modal-content h2 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.verse-info {
  background-color: #f8f9fa;
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #2c3e50;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group textarea {
  resize: vertical;
}

.form-group input[readonly],
.form-group textarea[readonly] {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-primary,
.btn-secondary,
.btn-info {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-info {
  background-color: #16a085;
  color: white;
}

.btn-info:hover {
  background-color: #138d75;
}

.success-message {
  background-color: #d4edda;
  color: #155724;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  border: 1px solid #c3e6cb;
}

.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  border: 1px solid #f5c6cb;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 2rem;
  color: #7f8c8d;
}

/* Bulk change preview */
#bulk-preview-section {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

#bulk-preview-section h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

#bulk-preview-results {
  max-height: 300px;
  overflow-y: auto;
}

.preview-item {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background-color: white;
  border-radius: 4px;
  border-left: 3px solid #3498db;
}

.preview-item-ref {
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

.preview-item-old {
  color: #e74c3c;
  margin-bottom: 0.25rem;
}

.preview-item-new {
  color: #27ae60;
}

.preview-total {
  font-weight: bold;
  margin-bottom: 1rem;
  color: #2c3e50;
}

/* View changes modal */
.modal-large {
  max-width: 900px;
}

.changes-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #ddd;
  margin-bottom: 1.5rem;
}

.changes-tab-btn {
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #666;
  transition: all 0.2s;
}

.changes-tab-btn:hover {
  color: #333;
  background-color: #f8f9fa;
}

.changes-tab-btn.active {
  color: #3498db;
  border-bottom-color: #3498db;
}

.badge {
  display: inline-block;
  background-color: #e74c3c;
  color: white;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  margin-left: 0.5rem;
  min-width: 20px;
  text-align: center;
}

.changes-tab-btn.active .badge {
  background-color: #3498db;
}

#changes-list {
  max-height: 500px;
  overflow-y: auto;
}

.change-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: #fff;
}

.change-item-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #ecf0f1;
}

.change-item-ref {
  font-weight: bold;
  color: #2c3e50;
  font-size: 1.05rem;
}

.change-item-meta {
  text-align: right;
  font-size: 0.85rem;
  color: #7f8c8d;
}

.change-item-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.change-item-status.proposed {
  background-color: #fff3cd;
  color: #856404;
}

.change-item-status.accepted {
  background-color: #d4edda;
  color: #155724;
}

.change-item-desc {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.change-item-diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.change-item-old,
.change-item-new {
  padding: 0.75rem;
  border-radius: 4px;
}

.change-item-old {
  background-color: #ffebee;
  border-left: 3px solid #e74c3c;
}

.change-item-new {
  background-color: #e8f5e9;
  border-left: 3px solid #27ae60;
}

.change-item-old strong,
.change-item-new strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.empty-changes {
  text-align: center;
  padding: 2rem;
  color: #7f8c8d;
}

/* Responsive design */
@media (max-width: 768px) {
  #main-container {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }

  header {
    flex-direction: column;
    gap: 1rem;
  }

  #chapter-selector {
    flex-wrap: wrap;
  }

  #chapter-selector .btn-primary,
  #chapter-selector .btn-secondary,
  #chapter-selector .btn-info {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .modal-content {
    width: 95%;
    margin: 2% auto;
  }

  .change-item-diff,
  .change-item-diff {
    grid-template-columns: 1fr;
  }
}
