/* ==========================================================================
   COMPONENTES AUXILIARES (components.css)
   Player de Áudio, Sumário Drawer, Busca e Marcadores
   ========================================================================== */

/* Drawer de Sumário (TOC) */
.toc-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.toc-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.toc-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  color: var(--text-light);
  z-index: 1001;
  box-shadow: 4px 0 25px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  transition: left var(--transition-normal);
}

.toc-drawer-overlay.active .toc-drawer {
  left: 0;
}

.toc-header {
  padding: 25px 20px;
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #FFF;
}

.toc-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px 0;
}

.toc-chapter-item {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.toc-chapter-item:hover {
  background: var(--bg-sidebar-hover);
}

.toc-chapter-item.active {
  background: var(--accent-sertao);
  border-left: 4px solid #FFF;
}

.toc-chapter-title {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: #FFF;
}

.toc-chapter-pages {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
}

/* Mini-Player de Áudio */
.audio-player-widget {
  background: var(--bg-sidebar);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  color: #FFF;
}

.audio-icon-vinyl {
  width: 40px;
  height: 40px;
  background: var(--accent-sertao);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rotateVinyl 6s linear infinite;
  animation-play-state: paused;
}

.audio-icon-vinyl.playing {
  animation-play-state: running;
}

.audio-details h4 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.audio-details p {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

@keyframes rotateVinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Modal de Busca */
.search-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.search-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-card {
  background: var(--bg-book);
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

.search-input-box {
  padding: 15px;
  background: var(--bg-book-subtle);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  outline: none;
  color: var(--text-main);
}

.search-results-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px 0;
}

.search-result-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.search-result-item:hover {
  background: var(--bg-book-subtle);
}

.search-result-item h5 {
  font-size: 0.85rem;
  color: var(--accent-sertao-hover);
  margin-bottom: 4px;
}

.search-result-item p {
  font-size: 0.9rem;
  color: var(--text-main);
}
