/* Books Modal Styling */

.hidden {
  display: none !important;
}

.books-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.books-modal {
  background: var(--background-primary, #ffffff);
  border-radius: 16px;
  max-width: 90vw;
  max-height: 85vh;
  width: 800px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transform: scale(0.9);
  animation: modalZoomIn 0.3s ease-out forwards;
  overflow: hidden;
}

@keyframes modalZoomIn {
  to {
    transform: scale(1);
  }
}

.books-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--text-secondary, #666);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  transition: all 0.2s ease;
  color: var(--background-primary, #ffffff);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.books-modal-close:hover {
  background: var(--accent-primary, #6366f1);
  transform: scale(1.1);
}

.books-modal-close:active {
  transform: scale(0.95);
  background: var(--accent-primary, #5855eb);
}

.books-modal-close svg {
  width: 20px;
  height: 20px;
}

.books-modal-header {
  padding: 32px 32px 24px 32px;
  text-align: center;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.books-modal-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin: 0 0 8px 0;
}

.books-modal-header p {
  color: var(--text-secondary, #6b7280);
  font-size: 1.1rem;
  margin: 0;
}

.books-grid-container {
  padding: 32px;
  max-height: 60vh;
  overflow-y: auto;
}

.books-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary, #6b7280);
  text-align: center;
  margin: 0 auto;
  width: 100%;
}

/* Legacy loading spinner - Use bibliatech-loading class instead */
/* See loading-animation.css for the new loading styles */

.books-loading p {
  font-size: 1.1rem;
  margin: 0;
}

.error-message {
  color: var(--error-color, #dc2626);
  text-align: center;
  padding: 20px;
  font-size: 1rem;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  padding: 0;
  margin: 0 auto;
  justify-content: center;
  width: 100%;
}

.book-tile {
  background: var(--background-secondary, #f8fafc);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.book-tile:hover {
  background: var(--accent-light, #f0f9ff);
  border-color: var(--accent-primary, #6366f1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.book-tile:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.book-name {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  line-height: 1.3;
  display: block;
}

.book-tile:hover .book-name {
  color: var(--accent-primary, #6366f1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .books-modal {
    max-width: 95vw;
    max-height: 90vh;
    margin: 20px;
  }
  
  .books-modal-header {
    padding: 24px 20px 16px 20px;
  }
  
  .books-modal-header h2 {
    font-size: 2rem;
  }
  
  .books-grid-container {
    padding: 20px;
    max-height: 65vh;
  }
  
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }
  
  .book-tile {
    padding: 12px 8px;
    min-height: 70px;
    /* Larger touch targets for mobile */
    min-width: 44px;
    touch-action: manipulation;
  }
  
  .book-name {
    font-size: 0.85rem;
  }
  
  /* Larger close button for mobile */
  .books-modal-close {
    width: 48px;
    height: 48px;
    top: 12px;
    right: 12px;
    touch-action: manipulation;
  }
  
  .books-modal-close svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }
  
  .book-tile {
    padding: 10px 6px;
    min-height: 60px;
    /* Even larger touch targets for small screens */
    min-width: 50px;
    touch-action: manipulation;
  }
  
  .book-name {
    font-size: 0.8rem;
  }
  
  .books-modal-header h2 {
    font-size: 1.8rem;
  }
  
  .books-modal-header p {
    font-size: 1rem;
  }
  
  /* Extra large close button for small screens */
  .books-modal-close {
    width: 52px;
    height: 52px;
    top: 8px;
    right: 8px;
  }
  
  .books-modal-close svg {
    width: 26px;
    height: 26px;
  }
}

/* Smooth scrollbar for books grid container */
.books-grid-container::-webkit-scrollbar {
  width: 8px;
}

.books-grid-container::-webkit-scrollbar-track {
  background: var(--background-secondary, #f8fafc);
  border-radius: 4px;
}

.books-grid-container::-webkit-scrollbar-thumb {
  background: var(--border-color, #e5e7eb);
  border-radius: 4px;
}

.books-grid-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary, #6b7280);
}

/* Animation for book tiles */
.book-tile {
  animation: bookTileSlideIn 0.3s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes bookTileSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for book tiles */
.book-tile:nth-child(1) { animation-delay: 0.05s; }
.book-tile:nth-child(2) { animation-delay: 0.1s; }
.book-tile:nth-child(3) { animation-delay: 0.15s; }
.book-tile:nth-child(4) { animation-delay: 0.2s; }
.book-tile:nth-child(5) { animation-delay: 0.25s; }
.book-tile:nth-child(6) { animation-delay: 0.3s; }
.book-tile:nth-child(7) { animation-delay: 0.35s; }
.book-tile:nth-child(8) { animation-delay: 0.4s; }
.book-tile:nth-child(9) { animation-delay: 0.45s; }
.book-tile:nth-child(10) { animation-delay: 0.5s; }

/* Continue pattern for more tiles */
.book-tile:nth-child(n+11) {
  animation-delay: 0.5s;
}

/* Dark Theme Support */
[data-theme="dark"] .books-modal {
  background: var(--dark-background-primary, #1f2937);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .books-modal-header {
  border-bottom: 1px solid var(--dark-border-color, #374151);
}

[data-theme="dark"] .books-modal-header h2 {
  color: var(--dark-text-primary, #f9fafb);
}

[data-theme="dark"] .books-modal-header p {
  color: var(--dark-text-secondary, #d1d5db);
}

[data-theme="dark"] .books-modal-close {
  background: var(--dark-text-secondary, #9ca3af);
  color: var(--dark-background-primary, #1f2937);
}

[data-theme="dark"] .books-modal-close:hover {
  background: var(--dark-accent-primary, #6366f1);
  color: var(--dark-background-primary, #1f2937);
}

[data-theme="dark"] .book-tile {
  background: var(--dark-background-secondary, #374151);
  border-color: var(--dark-border-color, #4b5563);
}

[data-theme="dark"] .book-tile:hover {
  background: var(--dark-accent-light, #1e3a8a);
  border-color: var(--dark-accent-primary, #6366f1);
}

[data-theme="dark"] .book-name {
  color: var(--dark-text-primary, #f9fafb);
}

[data-theme="dark"] .book-tile:hover .book-name {
  color: var(--dark-accent-primary, #6366f1);
}

[data-theme="dark"] .books-loading {
  color: var(--dark-text-secondary, #d1d5db);
}

[data-theme="dark"] .loading-spinner {
  border-color: var(--dark-border-color, #4b5563);
  border-top-color: var(--dark-accent-primary, #6366f1);
}

[data-theme="dark"] .error-message {
  color: var(--dark-error-color, #f87171);
}

[data-theme="dark"] .books-grid-container::-webkit-scrollbar-track {
  background: var(--dark-background-secondary, #374151);
}

[data-theme="dark"] .books-grid-container::-webkit-scrollbar-thumb {
  background: var(--dark-border-color, #4b5563);
}

[data-theme="dark"] .books-grid-container::-webkit-scrollbar-thumb:hover {
  background: var(--dark-text-secondary, #9ca3af);
}

/* Enhanced Dark Theme Support */
[data-theme="dark"] .books-modal-overlay {
  background: rgba(14, 19, 36, 0.95);
}

[data-theme="dark"] .books-modal {
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border-color, #334155);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .books-modal-header h2 {
  color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] .books-modal-header p {
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .books-modal-close {
  color: var(--text-secondary, #cbd5e1);
  background: var(--bg-tertiary, #334155);
  border: 1px solid var(--border-color, #475569);
}

[data-theme="dark"] .books-modal-close:hover {
  color: var(--text-primary, #f8fafc);
  background: var(--bg-secondary, #1e293b);
  border-color: var(--accent-color, #6366f1);
}

[data-theme="dark"] .book-tile {
  background: var(--bg-tertiary, #334155);
  color: var(--text-primary, #f8fafc);
  border: 1px solid var(--border-color, #475569);
}

[data-theme="dark"] .book-tile:hover {
  background: var(--bg-secondary, #1e293b);
  border-color: var(--accent-color, #6366f1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

[data-theme="dark"] .book-tile:hover .book-name {
  color: var(--accent-color, #6366f1);
}

[data-theme="dark"] .book-tile:active {
  background: var(--accent-color, #6366f1);
  color: white;
}

[data-theme="dark"] .books-loading {
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .loading-spinner {
  border-color: transparent transparent var(--accent-color, #6366f1) transparent;
}

/* ===================================================================
   CHAPTERS MODAL STYLING (extends Books Modal styles)
   =================================================================== */

.chapters-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10001; /* Higher than books modal */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}

.chapters-modal {
  background: var(--background-primary, #ffffff);
  border-radius: 16px;
  max-width: 90vw;
  max-height: 85vh;
  width: 700px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transform: scale(0.9);
  animation: modalZoomIn 0.3s ease-out forwards;
  overflow: hidden;
}

.chapters-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--text-secondary, #666);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10002;
  transition: all 0.2s ease;
  color: var(--background-primary, #ffffff);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.chapters-modal-close:hover {
  background: var(--accent-primary, #6366f1);
  transform: scale(1.1);
}

.chapters-modal-close:active {
  transform: scale(0.95);
  background: var(--accent-primary, #5855eb);
}

.chapters-back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--background-secondary, #f8fafc);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 10002;
  transition: all 0.2s ease;
  color: var(--text-primary, #1f2937);
  font-size: 0.9rem;
  font-weight: 500;
  /* Enhanced touch support */
  -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* Increase touch target size on touch devices */
@media (hover: none) and (pointer: coarse) {
  .chapters-back-btn {
    padding: 12px 16px;
    min-width: 44px;
    min-height: 44px;
  }
  
  .chapters-back-btn:active {
    background: var(--accent-light, #f0f9ff);
    border-color: var(--accent-primary, #6366f1);
    color: var(--accent-primary, #6366f1);
    transform: scale(0.9);
    transition: all 0.1s ease;
  }
}

.chapters-back-btn:hover {
  background: var(--accent-light, #f0f9ff);
  border-color: var(--accent-primary, #6366f1);
  color: var(--accent-primary, #6366f1);
  transform: translateX(-2px);
}

.chapters-modal-header {
  padding: 32px 32px 24px 32px;
  text-align: center;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.chapters-modal-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin: 0 0 8px 0;
}

.chapters-modal-header p {
  color: var(--text-secondary, #6b7280);
  font-size: 1.1rem;
  margin: 0;
}

.chapters-grid-container {
  padding: 32px;
  max-height: 60vh;
  overflow-y: auto;
}

.chapters-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary, #6b7280);
  text-align: center;
  margin: 0 auto;
  width: 100%;
}

/* Legacy loading spinner - Use bibliatech-loading class instead */
/* See loading-animation.css for the new loading styles */

.chapters-loading p {
  font-size: 1.1rem;
  margin: 0;
}

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  padding: 0;
  margin: 0 auto;
  justify-content: center;
  width: 100%;
}

.chapter-tile {
  background: var(--background-secondary, #f8fafc);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  /* Enhanced touch support */
  -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* Touch feedback for better responsiveness */
@media (hover: none) and (pointer: coarse) {
  .chapter-tile {
    /* Increase touch target size on touch devices */
    min-height: 60px;
    padding: 20px 16px;
  }
  
  .chapter-tile:active {
    background: var(--accent-light, #f0f9ff);
    border-color: var(--accent-primary, #6366f1);
    transform: scale(0.95);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    transition: all 0.1s ease;
  }
}

.chapter-tile:hover {
  background: var(--accent-light, #f0f9ff);
  border-color: var(--accent-primary, #6366f1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.chapter-tile:focus {
  outline: none;
  background: var(--accent-light, #f0f9ff);
  border-color: var(--accent-primary, #6366f1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.chapter-tile:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.chapter-name {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  line-height: 1.3;
  display: block;
}

.chapter-action-hint {
  font-size: 0.7rem;
  color: var(--text-secondary, #6b7280);
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-weight: 400;
}

.chapter-tile:hover .chapter-name,
.chapter-tile:focus .chapter-name {
  color: var(--accent-primary, #6366f1);
}

.chapter-tile:hover .chapter-action-hint,
.chapter-tile:focus .chapter-action-hint {
  opacity: 1;
  color: var(--accent-primary, #6366f1);
}

/* Animation for chapter tiles */
.chapter-tile {
  animation: bookTileSlideIn 0.3s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

/* Stagger animation for chapter tiles */
.chapter-tile:nth-child(1) { animation-delay: 0.05s; }
.chapter-tile:nth-child(2) { animation-delay: 0.1s; }
.chapter-tile:nth-child(3) { animation-delay: 0.15s; }
.chapter-tile:nth-child(4) { animation-delay: 0.2s; }
.chapter-tile:nth-child(5) { animation-delay: 0.25s; }
.chapter-tile:nth-child(6) { animation-delay: 0.3s; }
.chapter-tile:nth-child(7) { animation-delay: 0.35s; }
.chapter-tile:nth-child(8) { animation-delay: 0.4s; }
.chapter-tile:nth-child(9) { animation-delay: 0.45s; }
.chapter-tile:nth-child(10) { animation-delay: 0.5s; }

/* Continue pattern for more tiles */
.chapter-tile:nth-child(n+11) {
  animation-delay: 0.5s;
}

/* Dark theme support for chapters modal */
[data-theme="dark"] .chapters-modal {
  background: var(--bg-primary, #0f172a);
  border: 1px solid var(--border-color, #334155);
}

[data-theme="dark"] .chapters-modal-header {
  border-bottom-color: var(--border-color, #334155);
}

[data-theme="dark"] .chapters-modal-header h2 {
  color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] .chapters-modal-header p {
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .chapters-back-btn {
  background: var(--bg-secondary, #1e293b);
  border-color: var(--border-color, #334155);
  color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] .chapters-back-btn:hover {
  background: var(--bg-secondary, #1e293b);
  border-color: var(--accent-color, #6366f1);
  color: var(--accent-color, #6366f1);
}

[data-theme="dark"] .chapter-tile {
  background: var(--bg-secondary, #1e293b);
  border-color: var(--border-color, #334155);
}

[data-theme="dark"] .chapter-tile:hover,
[data-theme="dark"] .chapter-tile:focus {
  background: var(--bg-secondary, #1e293b);
  border-color: var(--accent-color, #6366f1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

[data-theme="dark"] .chapter-tile:hover .chapter-name,
[data-theme="dark"] .chapter-tile:focus .chapter-name {
  color: var(--accent-color, #6366f1);
}

[data-theme="dark"] .chapter-tile:hover .chapter-action-hint,
[data-theme="dark"] .chapter-tile:focus .chapter-action-hint {
  opacity: 1;
  color: var(--accent-color, #6366f1);
}

[data-theme="dark"] .chapter-action-hint {
  color: var(--text-secondary, #94a3b8);
}

[data-theme="dark"] .chapter-tile:active {
  background: var(--accent-color, #6366f1);
  color: white;
}

[data-theme="dark"] .chapters-loading {
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .chapters-loading .loading-spinner {
  border-color: transparent transparent var(--accent-color, #6366f1) transparent;
}

/* Responsive Design for Chapters Modal */
@media (max-width: 768px) {
  .chapters-modal {
    max-width: 95vw;
    max-height: 90vh;
    margin: 20px;
    width: auto;
  }
  
  .chapters-modal-header {
    padding: 24px 20px 16px 20px;
  }
  
  .chapters-modal-header h2 {
    font-size: 2rem;
  }
  
  .chapters-grid-container {
    padding: 20px;
    max-height: 65vh;
  }
  
  .chapters-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
  }
  
  .chapter-tile {
    padding: 12px 8px;
    min-height: 70px;
    /* Larger touch targets for mobile */
    min-width: 44px;
    touch-action: manipulation;
  }
  
  .chapter-name {
    font-size: 0.85rem;
  }
  
  .chapters-back-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
    gap: 6px;
    /* Larger touch target */
    min-width: 44px;
    min-height: 44px;
  }
  
  /* Larger close button for mobile */
  .chapters-modal-close {
    width: 48px;
    height: 48px;
    top: 12px;
    right: 12px;
    touch-action: manipulation;
  }
  
  .chapters-modal-close svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .chapters-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
  }
  
  .chapter-tile {
    padding: 10px 6px;
    min-height: 60px;
    /* Even larger touch targets for small screens */
    min-width: 50px;
    touch-action: manipulation;
  }
  
  .chapter-name {
    font-size: 0.8rem;
  }
  
  .chapters-modal-header h2 {
    font-size: 1.8rem;
  }
  
  .chapters-modal-header p {
    font-size: 1rem;
  }
  
  /* Extra large close button for small screens */
  .chapters-modal-close {
    width: 52px;
    height: 52px;
    top: 8px;
    right: 8px;
  }
  
  .chapters-modal-close svg {
    width: 26px;
    height: 26px;
  }
  
  .chapters-back-btn {
    padding: 10px 14px;
    font-size: 0.9rem;
    gap: 6px;
    min-width: 48px;
    min-height: 48px;
  }
}

/* ============================================
   FORCED BOOK SELECTION STATE
   ============================================
   When user switches to a translation that doesn't 
   have their current book, force them to select a new book
   with a prominent visual indicator.
*/

.books-modal-overlay[data-forced-selection="true"] {
  /* Stronger overlay for forced selection */
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.books-modal-overlay[data-forced-selection="true"] .books-modal {
  /* Glowing border to indicate required action */
  box-shadow: 
    0 0 0 4px rgba(124, 58, 237, 0.5),
    0 0 40px rgba(124, 58, 237, 0.4),
    0 0 80px rgba(124, 58, 237, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(124, 58, 237, 0.6);
  animation: forcedSelectionPulse 2s ease-in-out infinite, modalZoomIn 0.3s ease-out forwards;
}

@keyframes forcedSelectionPulse {
  0%, 100% {
    box-shadow: 
      0 0 0 4px rgba(124, 58, 237, 0.5),
      0 0 40px rgba(124, 58, 237, 0.4),
      0 0 80px rgba(124, 58, 237, 0.2),
      0 20px 60px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 
      0 0 0 6px rgba(124, 58, 237, 0.7),
      0 0 60px rgba(124, 58, 237, 0.5),
      0 0 100px rgba(124, 58, 237, 0.3),
      0 20px 60px rgba(0, 0, 0, 0.4);
  }
}

/* Forced selection header message */
.books-modal-overlay[data-forced-selection="true"] .books-modal-header::before {
  content: "⚠️ Your current book is not available in this translation. Please select a different book.";
  display: block;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.15), rgba(234, 88, 12, 0.1));
  border: 1px solid rgba(251, 146, 60, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: var(--text-primary, #333);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  animation: warningFadeIn 0.5s ease-out 0.3s forwards;
  opacity: 0;
}

@keyframes warningFadeIn {
  to {
    opacity: 1;
  }
}

/* Dark mode forced selection */
[data-theme="dark"] .books-modal-overlay[data-forced-selection="true"] .books-modal {
  box-shadow: 
    0 0 0 4px rgba(167, 139, 250, 0.5),
    0 0 40px rgba(167, 139, 250, 0.4),
    0 0 80px rgba(167, 139, 250, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(167, 139, 250, 0.6);
}

[data-theme="dark"] .books-modal-overlay[data-forced-selection="true"] .books-modal-header::before {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.2), rgba(234, 88, 12, 0.15));
  border: 1px solid rgba(251, 146, 60, 0.4);
  color: var(--text-primary, #e2e8f0);
}
