/* Bible Reader Styles */

.bible-app {
  display: flex;
  min-height: calc(100vh - 80px);
  background: #f8fafc;
}

/* Sidebar */
.bible-sidebar {
  width: 320px;
  min-width: 320px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 80px;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  line-height: 1;
}

.translation-select {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.translation-select label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.translation-select select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

.search-box {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.search-box input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.search-btn {
  padding: 10px 12px;
  background: var(--brand-1);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: var(--brand-2);
}

.testament-tabs {
  display: flex;
  padding: 12px 20px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.testament-tabs .tab {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.testament-tabs .tab:hover {
  background: #f0f9ff;
}

.testament-tabs .tab.active {
  background: var(--brand-1);
  color: #fff;
  border-color: var(--brand-1);
}

.books-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.book-item {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.book-item:hover {
  background: #f0f9ff;
}

.book-item.active {
  background: linear-gradient(135deg, #e0f2fe, #ddd6fe);
  font-weight: 600;
}

.book-item .book-abbrev {
  width: 40px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

.book-chapters {
  display: none;
  padding: 8px 0 8px 54px;
  flex-wrap: wrap;
  gap: 4px;
}

.book-item.expanded + .book-chapters {
  display: flex;
}

.chapter-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.chapter-btn:hover {
  background: #f0f9ff;
  border-color: var(--brand-1);
}

.chapter-btn.active {
  background: var(--brand-1);
  color: #fff;
  border-color: var(--brand-1);
}

/* Main content */
.bible-content {
  flex: 1;
  margin-left: 320px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 80px);
}

.content-header {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 80px;
  z-index: 50;
  gap: 16px;
}

.menu-toggle {
  display: none;
  padding: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.current-location {
  flex: 1;
}

#bookTitle {
  font-weight: 700;
  font-size: 18px;
}

#chapterInfo {
  color: var(--muted);
  font-size: 14px;
  margin-left: 8px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.font-size-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.font-size-btn:hover {
  background: #f0f9ff;
}

/* Welcome screen */
.welcome-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.welcome-content {
  max-width: 800px;
  text-align: center;
}

.welcome-content h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-content .lead {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 40px;
}

.quick-start {
  margin-bottom: 40px;
}

.quick-start h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 16px;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.quick-links button {
  padding: 12px 24px;
  background: linear-gradient(135deg, #e0f2fe, #ddd6fe);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
}

.quick-links button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.translations-info h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 16px;
}

.translation-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.t-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: left;
}

.t-card strong {
  display: block;
  font-size: 20px;
  color: var(--brand-1);
  margin-bottom: 4px;
}

.t-card span {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.t-card small {
  font-size: 13px;
  color: var(--muted);
}

/* Search results */
.search-results {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.search-header h2 {
  margin: 0;
}

.close-search {
  padding: 8px 16px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.search-result-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.search-result-item:hover {
  border-color: var(--brand-1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.search-result-item .reference {
  font-weight: 700;
  color: var(--brand-1);
  margin-bottom: 8px;
}

.search-result-item .text {
  color: var(--ink);
  line-height: 1.7;
}

.search-result-item .text mark {
  background: #fef08a;
  padding: 2px 4px;
  border-radius: 3px;
}

/* Chapter content */
.chapter-content {
  flex: 1;
  padding: 32px 24px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.chapter-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

#chapterTitle {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 16px;
}

.chapter-nav-inline {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chapter-nav-inline button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.chapter-nav-inline button:hover {
  background: #f0f9ff;
}

.chapter-nav-inline button.active {
  background: var(--brand-1);
  color: #fff;
  border-color: var(--brand-1);
}

.verses {
  line-height: 2;
  font-size: 18px;
}

.verse {
  margin-bottom: 8px;
}

.verse-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-1);
  vertical-align: super;
  margin-right: 4px;
}

.verse-text {
  color: var(--ink);
}

/* Bottom navigation */
.chapter-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  gap: 16px;
}

.chapter-navigation button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.chapter-navigation button:hover:not(:disabled) {
  background: #f0f9ff;
  border-color: var(--brand-1);
}

.chapter-navigation button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chapter-selector select {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

/* Loading state */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--muted);
}

.loading::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 900px) {
  .bible-sidebar {
    transform: translateX(-100%);
  }

  .bible-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .bible-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }
}

@media (max-width: 600px) {
  .bible-sidebar {
    width: 100%;
    min-width: 100%;
  }

  .chapter-content {
    padding: 20px 16px;
  }

  .verses {
    font-size: 16px;
    line-height: 1.9;
  }

  #chapterTitle {
    font-size: 24px;
  }

  .welcome-content h1 {
    font-size: 28px;
  }

  .chapter-navigation {
    padding: 12px 16px;
  }

  .chapter-navigation button {
    padding: 10px 14px;
  }

  .chapter-navigation button span {
    display: none;
  }

  .translation-cards {
    grid-template-columns: 1fr 1fr;
  }

  .quick-links button {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* Adjust for page header */
@media (min-width: 901px) {
  .bible-sidebar {
    top: 80px;
  }
}

/* Page footer adjustment */
.page-footer {
  margin-left: 320px;
}

@media (max-width: 900px) {
  .page-footer {
    margin-left: 0;
  }
}

/* Empty state */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.no-results h3 {
  margin-bottom: 8px;
}
