/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-primary-gradient {
  background: var(--primary-gradient);
  color: var(--text-white);
}
.btn-primary-gradient:hover { filter: brightness(1.1); }

.btn-outline {
  background: transparent;
  color: var(--text-body);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-body);
  border: none;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--primary); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: #FFF0F0; }

.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--primary); }

/* ============================================
   Tags / Chips
   ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-drama { background: linear-gradient(135deg, #FFF0F0, #FFF5EB); color: #F53F3F; }
.tag-comic { background: linear-gradient(135deg, #F5EEFF, #F0E8FF); color: #722ED1; }
.tag-success { background: #E8FFEA; color: var(--success); }
.tag-warning { background: #FFF7E8; color: var(--warning); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--text-body);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-normal);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 20px; }

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-mask);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 720px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp .3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}
.modal-header h2 { margin: 0; }

.modal-body { padding: 20px 28px 28px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 28px 24px;
}

.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  font-size: 20px; color: var(--text-secondary);
  cursor: pointer; border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--bg-hover); }

/* ============================================
   Form Controls
   ============================================ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition-fast);
  outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,82,217,.1); }

.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card);
  resize: vertical;
  min-height: 80px;
  outline: none;
  line-height: 1.6;
  transition: border-color var(--transition-fast);
}
.form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,82,217,.1); }

.chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text-primary);
  color: var(--text-white);
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all .3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 2px;
  transition: width .5s ease;
}

/* ============================================
   Badge / Status Dot
   ============================================ */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.completed { background: var(--success); }
.status-dot.active { background: var(--primary); animation: pulse 1.5s infinite; }
.status-dot.pending { background: var(--border); }
.status-dot.error { background: var(--danger); }

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  text-align: center;
}
.empty-state svg { margin-bottom: 16px; opacity: .4; }
.empty-state p { font-size: 14px; }

/* ============================================
   Divider
   ============================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ============================================
   Avatar
   ============================================ */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================
   Toggle Switch
   ============================================ */
.format-toggle {
  display: inline-flex;
  background: var(--bg-input);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}
.format-toggle-btn {
  padding: 6px 20px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}
.format-toggle-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* ============================================
   Step Indicator
   ============================================ */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.step.active { color: var(--primary); font-weight: 600; }
.step.completed { color: var(--success); }
.step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-card);
}
.step.active .step-num { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.step.completed .step-num { border-color: var(--success); background: var(--success); color: #fff; }
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  min-width: 24px;
}
.step.completed + .step-line,
.step-line.completed { background: var(--success); }

/* ============================================
   Upload Zone
   ============================================ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-input);
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone svg { margin-bottom: 12px; }
.upload-zone p { color: var(--text-secondary); font-size: 14px; }
.upload-zone .upload-hint { font-size: 12px; color: var(--text-placeholder); margin-top: 8px; }

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
