/* Styles for the psalm reading experience */

.phrase-block {
  transition: background-color 0.5s ease, transform 0.3s ease;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.phrase-block.active-phrase {
  background-color: rgba(99, 102, 241, 0.2); /* Light indigo background */
  transform: scale(1.03);
  box-shadow: 0 6px 12px -1px rgba(0, 0, 0, 0.15), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-left: 4px solid rgba(99, 102, 241, 0.8); /* Indigo left border */
  padding-left: 0.85rem; /* Adjust padding to account for border */
}

/* Verse playback styles */
.verse-container {
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  /* Better touch targets for mobile */
  min-height: 44px;
  -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
}

.verse-container:hover {
  background-color: rgba(99, 102, 241, 0.05);
}

.verse-container:active {
  background-color: rgba(99, 102, 241, 0.1);
  transform: scale(0.98);
}

.verse-container.verse-playing {
  background-color: rgba(99, 102, 241, 0.1);
  border-left: 4px solid rgba(99, 102, 241, 0.6);
  padding-left: 0.75rem;
}

.verse-play-button {
  transform: scale(0.9);
  transition: all 0.2s ease;
}

.verse-container:hover .verse-play-button,
.verse-container:focus-within .verse-play-button {
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1);
}

.verse-play-button:hover {
  transform: scale(1.1);
}

/* Mobile touch improvements */
@media (hover: none) and (pointer: coarse) {
  .verse-container {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .verse-container:active {
    background-color: rgba(99, 102, 241, 0.1);
    transform: scale(0.98);
  }
  
  .verse-play-button {
    opacity: 0.7;
    visibility: visible;
  }
}

.psalm-divider {
  position: relative;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(156, 163, 175, 0.2);
  margin-bottom: 2rem;
}

.psalm-divider::before {
  content: "♪";
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  padding: 0 10px;
  color: rgba(156, 163, 175, 0.6);
  font-size: 1.25rem;
}

.dark .psalm-divider::before {
  background-color: rgb(17, 24, 39); /* dark:bg-gray-900 */
  color: rgba(156, 163, 175, 0.4);
}

/* Infinite scroll styles */
.psalm-section {
  margin-bottom: 3rem;
  scroll-margin-top: 100px; /* Accounts for fixed header space */
}

.psalm-section:not(:last-child) {
  position: relative;
  padding-bottom: 2rem;
}

.psalm-section:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(156, 163, 175, 0.3), transparent);
}

/* Load triggers for infinite scroll */
.load-trigger-top,
.load-trigger-bottom {
  opacity: 0;
  pointer-events: none;
}

/* Loading states (can be enhanced with animations) */
.psalm-section.loading {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

/* Add an end marker that's not visible but can be detected by the intersection observer */
.end-marker {
  height: 20px;
  margin-top: 4rem;
  opacity: 0;
}

/* Currently playing psalm highlighting */
.psalm-section.psalm-playing {
  background-color: rgba(99, 102, 241, 0.02);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 0.75rem;
  position: relative;
}

.psalm-section.psalm-playing::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.6), rgba(99, 102, 241, 0.3));
  border-radius: 0.75rem 0.75rem 0 0;
}
