/* ========================================
   Chat Tabs, Swipe Card & Wizard Styles
   ======================================== */

/* ─── Tab Bar ─── */
.tab-bar {
  display: flex;
  position: relative;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
  z-index: 10;
}
.tab-btn {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 3px;
  background: var(--primary-color, #ff80ab);
  border-radius: 3px 3px 0 0;
  transition: transform 0.25s ease;
}
.tab-btn.active {
  color: var(--text-color, #444);
}
.tab-btn.active::after {
  transform: translateX(-50%) scaleX(1);
}
.tab-btn:active {
  background: rgba(255,128,171,0.08);
}

/* ─── Tab Panel ─── */
.tab-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.tab-panel.active {
  display: flex;
}
#chat-list-screen .tab-content-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  position: relative;
}

/* ─── New Card (置顶新建卡片) ─── */
.new-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  margin: 8px 12px;
  border: 2px dashed #ddd;
  border-radius: var(--radius-md, 12px);
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.new-card:hover {
  border-color: var(--primary-color, #ff80ab);
  background: #fef6f9;
}
.new-card:active {
  transform: scale(0.98);
}
.new-card__icon {
  font-size: 22px;
  line-height: 1;
}
.new-card__text {
  font-size: 14px;
  font-weight: 500;
  color: #999;
}

/* ─── Swipe Card ─── */
.swipe-card {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #f0f0f0;
}
.swipe-card__wrapper {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}
.swipe-card__inner {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  background: #fff;
  position: relative;
  z-index: 2;
}
.swipe-card__inner.dragging {
  transition: none;
  --swipe-btn-width: 180px;
}
.swipe-card__inner.swiped {
  transform: translateX(-180px);
}

/* ─── Action Buttons (behind card) ─── */
.swipe-card__actions {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  display: flex;
  flex-direction: row;
  z-index: 1;
  pointer-events: none;
}
.swipe-card__actions .swipe-card__action-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  min-width: 60px;
}
.swipe-card__action-btn.action-delete {
  background: #ff6b6b;
}
.swipe-card__action-btn.action-delete:active {
  background: #e05555;
}
.swipe-card__action-btn.action-pin {
  background: var(--primary-color, #ff80ab);
}
.swipe-card__action-btn.action-pin:active {
  background: var(--primary-dark, #e0608a);
}
.swipe-card__action-btn.action-read {
  background: #90caf9;
}
.swipe-card__action-btn.action-read:active {
  background: #64b5f6;
}

/* ─── Contact Picker ─── */
.contact-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background 0.2s;
}
.contact-picker-item:active {
  background: #fdf6f8;
}
.contact-picker-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary-color, #ff80ab);
  flex-shrink: 0;
}
.contact-picker-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #eee;
}
.contact-picker-item .picker-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color, #444);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}
.picker-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #eee;
}
.picker-actions .btn {
  flex: 1;
  padding: 10px;
  font-size: 14px;
}
.picker-search {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  outline: none;
  background: #fafafa;
}
.picker-search:focus {
  background: #fff;
}

/* ─── Wizard (向导弹窗) ─── */
.wizard-modal .modal-window {
  max-width: 380px;
  padding: 20px;
}
.wizard-step {
  display: none;
  animation: fadeIn 0.25s ease;
}
.wizard-step.active {
  display: block;
}
.wizard-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 16px;
}
.wizard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  transition: all 0.25s;
}
.wizard-dot.active {
  background: var(--primary-color, #ff80ab);
  transform: scale(1.3);
}
.wizard-dot.done {
  background: var(--primary-color, #ff80ab);
  opacity: 0.5;
}
.wizard-step h3 {
  text-align: center;
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--text-color, #444);
}
.wizard-step .wizard-subtitle {
  text-align: center;
  font-size: 12px;
  color: #999;
  margin: 0 0 16px;
}
.wizard-nav {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.wizard-nav .btn {
  flex: 1;
  padding: 10px;
  font-size: 14px;
}
.wizard-avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
}
.wizard-avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f0f0;
  border: 2px dashed #ddd;
  cursor: pointer;
  transition: border-color 0.2s;
}
.wizard-avatar-preview:hover {
  border-color: var(--primary-color, #ff80ab);
}
.wizard-avatar-upload input[type="file"] {
  display: none;
}
.wizard-import-zone {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}
.wizard-import-zone:hover {
  border-color: var(--primary-color, #ff80ab);
  background: #fef6f9;
}
.wizard-import-zone .import-icon {
  font-size: 32px;
  margin-bottom: 6px;
}
.wizard-import-zone .import-text {
  font-size: 13px;
  color: #888;
}
.wizard-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  color: #ccc;
  font-size: 12px;
}
.wizard-separator::before,
.wizard-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #eee;
}
.wizard-manual-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: #f5f5f5;
  border: 1px solid #eee;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}
.wizard-manual-btn:hover {
  border-color: var(--primary-color, #ff80ab);
  color: var(--primary-color, #ff80ab);
}

/* ─── World Book Selection in Wizard ─── */
.wizard-wb-list {
  max-height: 180px;
  overflow-y: auto;
  margin: 8px 0;
}
.wizard-wb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: #555;
}
.wizard-wb-item input[type="checkbox"] {
  width: auto;
  accent-color: var(--primary-color, #ff80ab);
}

/* ─── Quick Group Create ─── */
.group-create-name-input {
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
.group-create-name-input:focus {
  border-color: var(--primary-color, #ff80ab);
}

/* ─── Empty State ─── */
.tab-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.tab-empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.tab-empty-state .empty-text {
  font-size: 14px;
  color: #aaa;
  line-height: 1.6;
}

/* ─── Chat list header title ─── */
#chat-list-title {
  transition: opacity 0.2s;
}

/* ─── Ensure action btn group hidden ─── */
#chat-list-screen .action-btn-group {
  display: none;
}

/* ─── Selected count badge (picker) ─── */
.picker-selected-count {
  font-size: 12px;
  color: #999;
  padding: 0 16px 6px;
  text-align: right;
}

/* ─── Tag badge for contact type ─── */
.contact-type-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #999;
  margin-left: 6px;
  white-space: nowrap;
}

/* ─── World Book list: remove all outer padding for flush-left alignment ─── */
#world-book-list-container {
  padding: 0 !important;
  margin: 0 !important;
}
#world-book-list-container .swipe-card__inner {
  padding-left: 0;
}
</content>