/* General Styling */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  color: #333;
  line-height: 1.6;
}

/* Splash Screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.5s ease;
}

.splash-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-screen h2 {
  font-size: 1.5em;
  margin-bottom: 20px;
  color: #333;
}

.progress-bar {
  width: 50%;
  max-width: 300px;
  height: 20px;
  background-color: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background-color: #4caf50;
  transition: width 0.2s ease;
}

#progress-text {
  margin-top: 10px;
  font-size: 1.2em;
  color: #333;
}

/* Main Content */
.main-content {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.main-content.hidden {
  opacity: 0;
  pointer-events: none;
}

.app-header {
  background-color: #4caf50;
  color: white;
  padding: 15px;
  text-align: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.app-header h1 {
  margin: 0;
  font-size: 1.8em;
  flex-grow: 1;
  text-align: left;
}

.version-selector {
  flex-shrink: 0;
  text-align: right;
  margin-left: 10px;
}

.version-selector label {
  margin-right: 5px;
}

.version-selector select {
  padding: 5px;
  border-radius: 4px;
  border: none;
}

.app-nav {
  background-color: #eee;
  padding: 10px 15px;
  border-bottom: 1px solid #ddd;
}

.search-bar {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.search-bar input {
  flex-grow: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.search-bar button {
  padding: 8px 12px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.search-bar button:hover {
  background-color: #0056b3;
}

.book-list-header {
  margin-top: 10px;
  margin-bottom: 5px;
  text-align: center;
}

.toggle-button {
  width: 100%;
  padding: 10px;
  background-color: #607d8b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1em;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s ease;
}

.toggle-button:hover {
  background-color: #455a64;
}

.arrow-icon {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

#book-list-wrapper {
  transition: max-height 0.3s ease, padding 0.3s ease, border-width 0.3s ease;
  overflow: hidden;
}

.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px;
  padding: 8px;
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.book-list button {
  padding: 8px 6px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8em;
  text-align: center;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.2;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
  transition: all 0.2s ease;
}

.book-list button {
  word-wrap: break-word;
  hyphens: auto;
}

.book-list button:hover,
.book-list button.active {
  background-color: #e0e0e0;
  border-color: #999;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.app-content {
  padding: 15px;
}

.verse-viewer {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.verse-viewer h2 {
  color: #4caf50;
  margin-top: 0;
  margin-bottom: 15px;
}

#verse-display p {
  margin-bottom: 10px;
}

#verse-display .verse-number {
  font-weight: bold;
  margin-right: 5px;
  color: #666;
}

.navigation-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.navigation-controls button {
  padding: 10px 15px;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
}

.navigation-controls button:hover {
  background-color: #43a047;
}

.search-results {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.search-results h2 {
  color: #007bff;
  margin-top: 0;
  margin-bottom: 15px;
}

#results-list {
  list-style: none;
  padding: 0;
}

#results-list li {
  padding: 8px 0;
  border-bottom: 1px dashed #eee;
  cursor: pointer;
}

#results-list li:hover {
  background-color: #f9f9f9;
}

#results-list li strong {
  color: #007bff;
}

#back-to-study {
  margin-top: 15px;
  padding: 10px 15px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#back-to-study:hover {
  background-color: #5a6268;
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
  }

  .app-header h1 {
    margin-bottom: 10px;
    text-align: center;
    width: 100%;
  }

  .version-selector {
    width: 100%;
    text-align: center;
    margin-left: 0;
  }

  .version-selector select {
    width: 80%;
  }

  #book-list-wrapper {
    max-height: 0;
    padding: 0;
    border: none;
  }

  #book-list-wrapper.expanded {
    max-height: 300px;
    padding: 8px 0;
  }

  #book-list-wrapper.expanded .book-list {
    max-height: 250px;
    border: 1px solid #ddd;
    padding: 8px;
  }

  .toggle-button .arrow-icon {
    transform: rotate(0deg);
  }

  .toggle-button.expanded .arrow-icon {
    transform: rotate(180deg);
  }

  @media (max-width: 400px) {
    .book-list {
      grid-template-columns: repeat(2, 1fr);
      gap: 2px;
    }
    
    .book-list button {
      font-size: 0.7em;
      padding: 5px 3px;
      min-height: 38px;
    }
  }
}

@media (min-width: 769px) {
  .book-list-header {
    display: none;
  }

  #book-list-wrapper {
    max-height: 350px;
    overflow: visible;
    padding: 0;
    border: none;
  }

  #book-list-wrapper .book-list {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 8px;
  }
}
