/* Theme Toast Notification */
.theme-toast {
  position: fixed;
  bottom: 80px;
  left: 20px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 9999;
  pointer-events: none;
}

.theme-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Theme Selector Dropdown (Alternative to Toggle Button) */
.theme-selector-dropdown {
  position: relative;
  margin-top: 1rem;
}

.theme-selector-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  font-weight: 500;
}

.theme-selector-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-selector-btn::after {
  content: '▾';
  margin-left: auto;
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.theme-selector-dropdown.active .theme-selector-btn::after {
  transform: rotate(180deg);
}

.theme-selector-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
}

.theme-selector-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-option {
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  text-align: left;
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.theme-option .theme-icon {
  font-size: 1.5rem;
  width: 2rem;
  text-align: center;
}

.theme-option .theme-label {
  font-weight: 500;
  font-size: 0.9rem;
}

/* Scrollbar for theme selector */
.theme-selector-menu::-webkit-scrollbar {
  width: 6px;
}

.theme-selector-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.theme-selector-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

.theme-selector-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Light theme adjustments for dropdown */
.sidebar-theme-light .theme-selector-btn,
.sidebar-theme-minimal .theme-selector-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #333;
}

.sidebar-theme-light .theme-selector-btn:hover,
.sidebar-theme-minimal .theme-selector-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.sidebar-theme-light .theme-selector-menu,
.sidebar-theme-minimal .theme-selector-menu {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.sidebar-theme-light .theme-option,
.sidebar-theme-minimal .theme-option {
  color: #333;
}

.sidebar-theme-light .theme-option:hover,
.sidebar-theme-minimal .theme-option:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
  .theme-toast {
    bottom: 70px;
    left: 15px;
    right: 15px;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
  }

  .theme-selector-menu {
    max-height: 250px;
  }
}

/* Enhanced menu item badges */
.book-menu .menu-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 10px;
  margin-left: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.book-menu .menu-badge.badge-new {
  background: #28a745;
  animation: pulse 2s infinite;
}

.book-menu .menu-badge.badge-updated {
  background: #ffc107;
}

.book-menu .menu-badge.badge-beta {
  background: #17a2b8;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Loading skeleton for menu items */
.book-menu .menu-skeleton {
  animation: skeleton-loading 1.5s infinite;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 200% 100%;
  border-radius: 8px;
  height: 40px;
  margin: 0.25rem 0;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Breadcrumb integration with sidebar */
.book-menu .breadcrumb {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 0.85rem;
}

.book-menu .breadcrumb-item {
  color: rgba(255, 255, 255, 0.7);
}

.book-menu .breadcrumb-item.active {
  color: rgba(255, 255, 255, 0.95);
}

.book-menu .breadcrumb-item + .breadcrumb-item::before {
  content: '›';
  color: rgba(255, 255, 255, 0.5);
}
