/* Bookmarks Page Styles - WuxiaWorld Style */

.bookmarks-page {
  padding: 2rem 0 4rem;
  min-height: 70vh;
}

.bookmarks-page .page-header {
  margin-bottom: 1.5rem;
}

.bookmarks-page .page-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Tabs */
.bookmarks-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.bookmark-tab {
  padding: 0.875rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.bookmark-tab:hover {
  color: var(--color-text-primary);
}

.bookmark-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Controls Bar */
.bookmarks-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.view-toggles {
  display: flex;
  background: var(--color-bg-secondary);
  border-radius: 6px;
  padding: 2px;
}

.view-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.view-toggle:hover {
  color: var(--color-text-secondary);
}

.view-toggle.active {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-select {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.sort-direction {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.sort-direction:hover {
  background: var(--color-bg-tertiary);
}

/* Added sort direction animation */
.sort-direction svg {
  transition: transform 0.2s;
}

.sort-direction.asc svg {
  transform: rotate(180deg);
}

/* Bookmarks Grid */
.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.bookmarks-grid.list-view {
  grid-template-columns: 1fr;
}

/* Bookmark Card */
.bookmark-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  position: relative;
  transition: all 0.2s;
}

.bookmark-card:hover {
  background: var(--color-bg-tertiary);
}

.bookmark-remove {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  border-radius: 4px;
}

.bookmark-card:hover .bookmark-remove {
  opacity: 1;
}

.bookmark-remove:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
}

.bookmark-cover {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  border-radius: 4px;
  overflow: hidden;
}

.bookmark-cover img {
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.bookmark-cover .placeholder-cover {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
}

.status-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 2px 6px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 3px;
  background: var(--color-accent);
  color: white;
}

.status-badge.status-completed {
  background: #10b981;
}

.status-badge.status-ongoing {
  background: var(--color-accent);
}

.status-badge.status-hiatus {
  background: #f59e0b;
}

/* Bookmark Info */
.bookmark-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.bookmark-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.bookmark-title a {
  color: var(--color-text-primary);
  text-decoration: none;
}

.bookmark-title a:hover {
  color: var(--color-accent);
}

.bookmark-progress {
  margin-bottom: 0.75rem;
}

.progress-text {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.375rem;
  display: block;
}

.progress-bar {
  height: 4px;
  background: var(--color-bg-primary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Bookmark Actions */
.bookmark-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.action-btn.locked,
.action-btn.active {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  margin-top: 2rem;
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.page-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Favorite Chapters - Accordion */
.favorite-chapters-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.novel-accordion {
  background: var(--color-bg-secondary);
  border-radius: 8px;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: var(--color-bg-tertiary);
}

.accordion-novel-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.accordion-cover {
  width: 40px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
}

.accordion-cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
}

.accordion-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.accordion-arrow {
  color: var(--color-text-muted);
  transition: transform 0.2s;
}

.novel-accordion.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: 0 1rem 1rem;
}

.novel-accordion.open .accordion-content {
  display: block;
}

.favorite-chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  background: var(--color-bg-primary);
  border-radius: 4px;
  margin-top: 0.375rem;
  transition: opacity 0.2s;
}

.chapter-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
}

.chapter-link:hover {
  color: var(--color-accent);
}

.remove-fav-chapter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  border-radius: 4px;
}

.favorite-chapter-item:hover .remove-fav-chapter {
  opacity: 1;
}

.remove-fav-chapter:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--color-text-muted);
}

.empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.125rem;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .bookmarks-grid {
    grid-template-columns: 1fr;
  }

  .bookmarks-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-controls {
    justify-content: flex-end;
  }

  .bookmark-remove {
    opacity: 1;
  }
}

/* User Menu Dark Mode Toggle Styles */
.user-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
  margin-top: 0.5rem;
}

.mode-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.theme-toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--color-bg-tertiary);
  border-radius: 12px;
  transition: background 0.2s;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

[data-theme="dark"] .toggle-thumb {
  transform: translateX(20px);
}

[data-theme="dark"] .toggle-track {
  background: var(--color-accent);
}

.theme-toggle-switch .moon-icon {
  color: var(--color-accent);
}

.menu-badge {
  background: var(--color-accent);
  color: white;
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
  margin-left: auto;
}

/* Bookmark card transitions */
.bookmark-card {
  transition: opacity 0.3s, transform 0.3s;
}

/* Favorite chapter item transition */
.favorite-chapter-item {
  transition: opacity 0.2s;
}
