/* Floating Bible reader - included on every page via the footer partial
   (and added directly to index.html) so it's accessible site-wide. */

#bible-widget-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 5000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--enr-accent) 0%, var(--enr-accent-dark) 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#bible-widget-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(var(--enr-accent-rgb), 0.5);
}

#bible-widget-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 92vw;
  height: 100%;
  z-index: 5001;
  background: linear-gradient(180deg, rgba(var(--enr-surface-rgb), 0.08) 0%, rgba(var(--enr-surface-rgb), 0.04) 100%), var(--enr-bg);
  -webkit-backdrop-filter: var(--enr-glass-blur);
  backdrop-filter: var(--enr-glass-blur);
  border-left: 1px solid rgba(var(--enr-accent-rgb), 0.3);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transition: right 0.35s ease;
}

#bible-widget-panel.open {
  right: 0;
}

.bible-widget-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(var(--enr-accent-rgb), 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bible-widget-header h4 {
  color: var(--enr-text);
  margin: 0;
  font-size: 1.1rem;
}

.bible-widget-close {
  background: none;
  border: none;
  color: var(--enr-text);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
}

.bible-widget-close:hover {
  opacity: 1;
}

.bible-widget-controls {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(var(--enr-accent-rgb), 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bible-widget-controls select,
.bible-widget-controls input {
  width: 100%;
  background: rgba(var(--enr-surface-rgb), 0.06);
  border: 1px solid rgba(var(--enr-accent-rgb), 0.3);
  color: var(--enr-text);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  transition: border-color 0.3s ease;
  /* Fixed height (not just matching padding) so the plain <select> and
     the Select2-rendered box line up exactly - their internal markup
     renders slightly differently otherwise. */
  height: 42px;
  box-sizing: border-box;
}

.bible-widget-controls select:focus,
.bible-widget-controls input:focus {
  outline: none;
  border-color: rgba(var(--enr-accent-rgb), 0.9);
}

/* Modern select styling (matches give.php) - replaces the native
   browser dropdown look with a custom chevron and consistent theming,
   so the Bible/translation pickers read as the same system as the rest
   of the site rather than a generic browser control. */
.bible-widget-controls select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235d7963' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  cursor: pointer;
}

.bible-widget-controls select option {
  background: var(--enr-surface-start);
  color: var(--enr-text);
}

.bible-widget-controls .bible-row {
  display: flex;
  gap: 0.5rem;
}

/* Version only shows the short acronym (KJV/WEB) now, so it needs much
   less room than the book picker (full book names, searchable). */
#bible-translation-select {
  flex: 35 1 0;
  min-width: 0;
}

#bible-book-select,
#bible-widget-panel .select2-container {
  flex: 65 1 0;
  min-width: 0;
}

.bible-widget-nav-btn {
  background: rgba(var(--enr-accent-rgb), 0.25);
  border: 1px solid rgba(var(--enr-accent-rgb), 0.4);
  color: var(--enr-text);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}

.bible-widget-nav-btn:hover {
  background: rgba(var(--enr-accent-rgb), 0.45);
}

.bible-widget-search-row {
  display: flex;
  gap: 0.5rem;
}

.bible-widget-search-row button {
  background: linear-gradient(135deg, var(--enr-accent) 0%, var(--enr-accent-dark) 100%);
  border: none;
  color: var(--enr-text);
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.bible-widget-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  color: var(--enr-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.bible-widget-chapter-title {
  color: var(--enr-text);
  margin-bottom: 0.75rem;
}

.bible-widget-body .bible-verse {
  margin-bottom: 0.6rem;
}

.bible-widget-body .bible-verse-num {
  color: #8aa893;
  font-weight: 700;
  margin-right: 0.35rem;
  font-size: 0.8rem;
  vertical-align: top;
}

.bible-widget-body .bible-result-ref {
  display: block;
  color: #8aa893;
  font-weight: 700;
  font-size: 0.8rem;
  margin-top: 1rem;
}

.bible-widget-body .bible-empty,
.bible-widget-body .bible-loading {
  color: var(--enr-text-muted);
  text-align: center;
  margin-top: 2rem;
}

.bible-widget-chapter-nav {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(var(--enr-accent-rgb), 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.bible-chapter-select {
  flex: 1;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: rgba(var(--enr-surface-rgb), 0.06);
  border: 1px solid rgba(var(--enr-accent-rgb), 0.4);
  border-radius: 6px;
  color: var(--enr-text);
  padding: 0.4rem 2rem 0.4rem 0.6rem;
  font-size: 0.85rem;
  text-align: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235d7963' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  cursor: pointer;
}

.bible-chapter-select:focus {
  outline: none;
  border-color: rgba(var(--enr-accent-rgb), 0.9);
}

.bible-chapter-select option {
  background: var(--enr-surface-start);
  color: var(--enr-text);
}

@media (max-width: 480px) {
  #bible-widget-panel {
    width: 100vw;
    right: -100vw;
  }

  #bible-widget-toggle {
    bottom: 16px;
    right: 16px;
  }
}

/* Select2 dark theme - the book picker (66 books) is hard to browse as a
   long native dropdown, so it's upgraded to a searchable Select2 control.
   Select2's default theme is light/white; these overrides make it match
   the rest of the site's dark, olive-accented look instead of looking
   like a bolted-on third-party widget. */
#bible-widget-panel .select2-container--default .select2-selection--single {
  background: rgba(var(--enr-surface-rgb), 0.06);
  border: 1px solid rgba(var(--enr-accent-rgb), 0.4);
  border-radius: 6px;
  height: 42px;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
}

#bible-widget-panel .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--enr-text);
  line-height: 1.3;
  padding: 0;
  width: 100%;
}

#bible-widget-panel .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--enr-text-muted);
}

#bible-widget-panel .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  top: 0;
  right: 8px;
}

#bible-widget-panel .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--enr-accent) transparent transparent transparent;
}

#bible-widget-panel .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent var(--enr-accent) transparent;
}

#bible-widget-panel .select2-container--default.select2-container--focus .select2-selection--single,
#bible-widget-panel .select2-container--default.select2-container--open .select2-selection--single {
  border-color: rgba(var(--enr-accent-rgb), 0.9);
}

/* The open dropdown panel - rendered inside #bible-widget-panel via
   dropdownParent, so it stays correctly positioned within the slide-over. */
.select2-dropdown {
  background: var(--enr-surface-start);
  border: 1px solid rgba(var(--enr-accent-rgb), 0.4);
  border-radius: 6px;
  z-index: 5010;
}

.select2-search--dropdown {
  padding: 0.5rem;
  background: var(--enr-surface-start);
}

.select2-search--dropdown .select2-search__field {
  background: rgba(var(--enr-surface-rgb), 0.06);
  border: 1px solid rgba(var(--enr-accent-rgb), 0.4);
  border-radius: 6px;
  color: var(--enr-text);
  padding: 0.4rem 0.6rem;
}

.select2-search--dropdown .select2-search__field:focus {
  outline: none;
  border-color: rgba(var(--enr-accent-rgb), 0.9);
}

.select2-results__options {
  max-height: 280px;
}

.select2-container--default .select2-results__option {
  color: var(--enr-text-muted);
  padding: 0.5rem 0.75rem;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: rgba(var(--enr-accent-rgb), 0.5);
  color: var(--enr-text);
}

.select2-container--default .select2-results__option[aria-selected="true"] {
  background: rgba(var(--enr-accent-rgb), 0.25);
}

.select2-results__message {
  color: var(--enr-text-muted);
}

/* Inline SVG chevrons can't use CSS variables - swap in the red version
   for light mode so it matches the rest of the theme. */
:root[data-theme="light"] .bible-widget-controls select,
:root[data-theme="light"] .bible-chapter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23A9444D' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

/* Required copyright notice, shown only when NIV (copyrighted) is the
   active translation - KJV/WEB are public domain and need none. */
.bible-copyright-notice {
  margin: 0;
  padding: 0.6rem 1.25rem;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--enr-text-muted);
  background: rgba(var(--enr-accent-rgb), 0.08);
  border-bottom: 1px solid rgba(var(--enr-accent-rgb), 0.15);
}
