/* ===== Page Container: Match manage-groups exactly ===== */
.page-container { max-width: 1400px; padding: 32px 40px; margin: 0 auto; height: calc(100vh - 64px); display: flex; box-sizing: border-box; }
.split-view { gap: 32px; align-items: stretch; }

.main-workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; padding-right: 16px; }

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 26px; font-weight: 700; color: var(--text-primary); margin: 0 0 8px; }
.page-subtitle { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ===== Quiz Info Bar ===== */
.quiz-info-bar { margin-bottom: 30px; }

.quiz-info-row {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.quiz-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-info-item > .material-symbols-rounded {
  font-size: 20px;
  color: var(--accent-primary, #667eea);
  background: rgba(102, 126, 234, 0.1);
  padding: 10px;
  border-radius: 10px;
}

.quiz-info-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quiz-info-item small {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.quiz-info-item strong {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
}

/* ===== Section Title ===== */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.section-title .material-symbols-rounded {
  font-size: 22px;
  color: var(--accent-primary, #667eea);
}

.count-badge {
  background: rgba(102, 126, 234, 0.1);
  color: var(--accent-primary, #667eea);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
}

/* ===== Available Candidates Pool ===== */
.available-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  min-height: 120px;
  padding: 4px 0;
}

.empty-pool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 48px 20px;
  color: var(--text-muted);
  background: var(--bg-hover);
  border-radius: 12px;
  border: 2px dashed var(--border-color);
  text-align: center;
}

.empty-pool .material-symbols-rounded {
  font-size: 40px;
  margin-bottom: 8px;
  opacity: 0.3;
}

.empty-pool p { margin: 0; font-size: 14px; }

/* ===== Candidate Cards (Left Pool) ===== */
.candidate-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: grab;
  transition: all 0.2s ease;
  min-width: 280px;
  flex: 0 1 auto;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.candidate-card:hover {
  border-color: var(--accent-primary, #667eea);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.08);
  transform: translateY(-2px);
}

.candidate-card:active {
  cursor: grabbing;
}

.candidate-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.candidate-details {
  flex: 1;
  min-width: 0;
}

.candidate-details h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.candidate-details p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.candidate-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.comfort-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.level-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.level-pill[data-level="beginner"] { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.level-pill[data-level="intermediate"] { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.level-pill[data-level="advanced"] { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.level-pill[data-level="expert"] { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.drag-icon {
  color: var(--text-muted);
  opacity: 0.5;
  font-size: 20px;
  cursor: grab;
}

/* ===== SIDEBAR: Assigned (matches unassigned-sidebar from manage-groups) ===== */
.assigned-sidebar {
  width: 340px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
  background: var(--surface, var(--bg-card));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 16px);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(102,126,234,0.05);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-title .material-symbols-rounded {
  color: #22c55e;
  font-size: 20px;
}

.sidebar-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-badge {
  background: #22c55e;
  color: white;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.assigned-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.empty-assigned {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  opacity: 0.7;
  min-height: 200px;
}

.empty-assigned .material-symbols-rounded {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-assigned p {
  margin: 0;
  font-size: 13px;
}

/* Highlight when dragging over the assigned zone */
.assigned-list.cdk-drop-list-receiving {
  background: rgba(102,126,234,0.04);
}

/* ===== Assigned Cards (Sidebar Items — match unassigned-card from manage-groups) ===== */
.assigned-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: grab;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.assigned-card:hover {
  border-color: var(--accent-primary, #667eea);
  box-shadow: 0 4px 12px rgba(102,126,234,0.08);
  transform: translateY(-2px);
}

.assigned-card:active {
  cursor: grabbing;
}

.assigned-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.assigned-details {
  flex: 1;
  min-width: 0;
}

.assigned-details h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assigned-details p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Sidebar Footer ===== */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.save-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 15px;
  font-family: inherit;
  background: var(--accent-gradient, linear-gradient(135deg, #667eea, #764ba2));
  color: #fff;
  box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.save-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

.save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.save-toast {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #22c55e;
  justify-content: center;
}

/* ===== CDK Drag & Drop (matches manage-groups exactly) ===== */
.custom-drag-placeholder {
  opacity: 0.3;
  background: rgba(102,126,234,0.1);
  border: 2px dashed var(--accent-primary, #667eea);
  border-radius: 12px;
  min-height: 60px;
  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}

.cdk-drag-preview {
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-radius: 12px;
  opacity: 0.95;
  z-index: 1000 !important;
  cursor: grabbing !important;
}

.cdk-drag-animating {
  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}

.available-pool.cdk-drop-list-dragging .candidate-card:not(.cdk-drag-placeholder) {
  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}

.assigned-list.cdk-drop-list-dragging .assigned-card:not(.cdk-drag-placeholder) {
  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}

/* ===== Loading State ===== */
.loading-center { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; color: var(--text-muted); gap: 16px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .split-view { flex-direction: column; }
  .assigned-sidebar { width: 100%; height: 400px; }
  .page-container { height: auto; padding: 20px 16px; }
  .quiz-info-row { flex-direction: column; gap: 16px; }
}
