/* ============ LIBRARY STYLES ============ */

.library-header {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.05) 0%, transparent 100%);
  padding: 60px 20px 40px;
  text-align: center;
}

.library-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.2;
}

.library-subtitle {
  font-size: 1.2rem;
  color: #aaa;
  max-width: 700px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* Search Bar */
.library-search {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #d4af37;
  background: rgba(255, 255, 255, 0.08);
}

.search-button {
  padding: 15px 30px;
  background: linear-gradient(135deg, #d4af37, #f4c430);
  border: none;
  border-radius: 10px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.search-button:hover {
  transform: translateY(-2px);
}

/* Search Results */
.search-results-section {
  padding: 40px 20px;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.search-results-header h2 {
  font-size: 1.8rem;
  color: #d4af37;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search-result-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #d4af37;
  transform: translateX(5px);
}

.search-result-reference {
  font-weight: 600;
  color: #d4af37;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.search-result-text {
  color: #ccc;
  line-height: 1.6;
}

.search-result-original {
  color: #999;
  font-style: italic;
  margin-top: 10px;
  font-size: 0.95rem;
  direction: rtl;
  text-align: right;
}

/* Library Content */
.library-content {
  padding: 40px 20px 80px;
}

.categories-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.category-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 16px;
  padding: 30px;
  transition: all 0.3s ease;
}

.category-section:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(212, 175, 55, 0.3);
}

.category-header {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(212, 175, 55, 0.2);
}

.category-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: #d4af37;
  margin-bottom: 8px;
}

.category-description {
  color: #999;
  font-size: 1rem;
  line-height: 1.5;
}

.category-meta {
  color: #666;
  font-size: 0.9rem;
  margin-top: 5px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.book-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.book-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #d4af37;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.15);
}

.book-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.book-badge {
  padding: 4px 10px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  font-size: 0.85rem;
  color: #d4af37;
}

.book-description {
  color: #aaa;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 12px;
}

/* Reading Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
}

.modal-content {
  position: relative;
  background: #1a1a1a;
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  z-index: 1001;
}

.reading-modal-content {
  max-width: 1000px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 30px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.reading-title {
  font-size: 1.8rem;
  color: #d4af37;
  margin: 0;
}

.reading-summary {
  color: #999;
  font-size: 1rem;
  margin-top: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: #999;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #d4af37;
}

.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
}

.reading-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.language-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #ccc;
}

.language-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.verses-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.verse-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.verse-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-left-color: #d4af37;
}

.verse-number {
  font-weight: 700;
  color: #d4af37;
  font-size: 1.1rem;
  min-width: 30px;
}

.verse-content {
  flex: 1;
}

.verse-text-english {
  color: #fff;
  line-height: 1.8;
  font-size: 1.05rem;
}

.verse-text-original {
  color: #999;
  font-style: italic;
  margin-top: 12px;
  font-size: 1rem;
  direction: rtl;
  text-align: right;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  display: none;
}

.verse-text-original.show {
  display: block;
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.spinner-ring {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(212, 175, 55, 0.2);
  border-top-color: #d4af37;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Utility Buttons */
.btn-secondary-small {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  color: #d4af37;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-small:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #d4af37;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .library-title {
    font-size: 2rem;
  }

  .library-subtitle {
    font-size: 1rem;
  }

  .library-search {
    flex-direction: column;
  }

  .books-grid {
    grid-template-columns: 1fr;
  }

  .category-section {
    padding: 20px;
  }

  .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .modal-header,
  .modal-body {
    padding: 20px;
  }

  .reading-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .search-results-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
}
