/* ============================================
   Qian Site - Admin Wishlist Kanban Styles
   Kanban 布局、卡片、Drawer、Toast 样式
   ============================================ */

/* ============================================
   Page Layout
   ============================================ */

.admin-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================
   Header / Toolbar
   ============================================ */

.admin-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.admin-header__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-header__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.admin-header__center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Search Input */
.search-input {
  position: relative;
  width: 280px;
}

.search-input__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input input {
  padding-left: 36px;
}

/* Admin Key Input */
.admin-key-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-key-input input {
  width: 160px;
}

/* ============================================
   Kanban Board
   ============================================ */

.kanban {
  flex: 1;
  display: flex;
  gap: 12px;
  padding: 20px;
  overflow-x: auto;
  overflow-y: hidden;
}

.kanban::-webkit-scrollbar {
  height: 12px;
}

/* ============================================
   Kanban Column
   ============================================ */

.kanban-column {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  width: var(--column-width);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  max-height: calc(100vh - var(--header-height) - 40px);
}

.kanban-column__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
}

.kanban-column__indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-column__indicator--open { background: var(--status-open); }
.kanban-column__indicator--accepted { background: var(--status-accepted); }
.kanban-column__indicator--doing { background: var(--status-doing); }
.kanban-column__indicator--done { background: var(--status-done); }
.kanban-column__indicator--archived { background: var(--status-archived); }

.kanban-column__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.kanban-column__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card);
  border-radius: 10px;
}

.kanban-column__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
  min-height: 100px;
}

/* Empty State */
.kanban-column__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================
   Kanban Card
   ============================================ */

.kanban-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kanban-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.kanban-card__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.kanban-card__votes {
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-card__votes svg {
  width: 14px;
  height: 14px;
}

/* SortableJS - Drag States */
.kanban-card.sortable-ghost {
  opacity: 0.4;
  background: var(--accent-light);
  border-color: var(--accent);
}

.kanban-card.sortable-chosen {
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
}

.kanban-card.sortable-drag {
  opacity: 1;
}

/* Drop placeholder */
.kanban-column__body.sortable-drag-over {
  background: var(--accent-light);
}

/* ============================================
   Type Badge
   ============================================ */

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-transform: capitalize;
}

.type-badge--widget {
  background: rgba(59, 130, 246, 0.1);
  color: var(--type-widget);
}

.type-badge--framework {
  background: rgba(139, 92, 246, 0.1);
  color: var(--type-framework);
}

.type-badge--bug {
  background: rgba(239, 68, 68, 0.1);
  color: var(--type-bug);
}

.type-badge--integration {
  background: rgba(16, 185, 129, 0.1);
  color: var(--type-integration);
}

.type-badge--ui {
  background: rgba(245, 158, 11, 0.1);
  color: var(--type-ui);
}

.type-badge--performance {
  background: rgba(6, 182, 212, 0.1);
  color: var(--type-performance);
}

.type-badge--other {
  background: rgba(107, 114, 128, 0.1);
  color: var(--type-other);
}

/* ============================================
   Drawer Overlay & Container
   ============================================ */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-width);
  height: 100vh;
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-drawer);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
}

.drawer.is-open {
  transform: translateX(0);
}

/* Drawer Header */
.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.drawer__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.drawer__close:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

/* Drawer Body */
.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.drawer__section {
  margin-bottom: 20px;
}

.drawer__label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.drawer__value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.drawer__value--id {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.drawer__copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.drawer__copy-btn:hover {
  background: var(--border);
  color: var(--text);
}

.drawer__description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Drawer Form Elements */
.drawer__select {
  width: 100%;
}

.drawer__textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

/* Drawer Footer */
.drawer__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.2s ease forwards;
}

.toast.is-leaving {
  animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast__message {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

.toast--success .toast__icon {
  color: var(--toast-success);
}

.toast--error .toast__icon {
  color: var(--toast-error);
}

.toast--info .toast__icon {
  color: var(--toast-info);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state__title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state__description {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 320px;
}

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
  .admin-header {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
  }

  .admin-header__center {
    order: 3;
    width: 100%;
  }

  .search-input {
    width: 100%;
  }

  .drawer {
    width: 100%;
  }

  .kanban {
    padding: 12px;
  }

  .kanban-column {
    width: 280px;
  }
}
