/* === Reusable Component Styles === */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px var(--primary-glow);
}

.btn--outline {
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}

.btn--outline:hover { background: var(--bg-card); }

.btn--full { width: 100%; }

.btn--sm { padding: 8px 16px; font-size: 0.8rem; }

.btn--icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: var(--radius-full);
}

/* Input fields */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.input-group__label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-group__field {
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
  outline: none;
}

.input-group__field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-group__field::placeholder { color: var(--text-muted); }

/* Cards */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

/* Country tabs */
.country-tabs {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.country-tabs::-webkit-scrollbar { display: none; }

.country-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.country-tabs--hold {
  touch-action: none !important;
  overflow-x: hidden;
}

.country-tabs--hold .country-tab {
  touch-action: none !important;
}

/* 드래그 중 고스트가 좌·우 끝에 닿을 때만 가로 스크롤 허용 */
.country-tabs--edge-scroll {
  overflow-x: auto !important;
  touch-action: pan-x !important;
  -webkit-overflow-scrolling: touch;
}

.country-tabs--edge-scroll .country-tab {
  touch-action: pan-x !important;
}

.country-tab--drag-arming {
  touch-action: none;
  transform: scale(1.03);
  box-shadow: var(--shadow-sm);
}

.country-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

/* Payer picker — horizontal pill (initial + name) */
.payer-tabs {
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
}

.payer-circle {
  width: auto;
  min-width: 4rem;
  max-width: 11rem;
  height: auto;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  justify-content: center;
  gap: 0;
}

.payer-circle__name {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 10rem;
}

.payer-circle.active .payer-circle__name {
  color: white;
}

.country-tab--add {
  border-style: dashed;
  color: var(--text-muted);
}

.country-tab--add:hover { border-color: var(--primary); color: var(--primary); }

.country-tabs--reordering {
  user-select: none;
  touch-action: none;
}

.country-tab--drag-source {
  display: none !important;
}

.country-tab--placeholder {
  flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 2px dashed var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-sizing: border-box;
}

.country-tab--ghost {
  position: fixed;
  z-index: 1200;
  margin: 0;
  pointer-events: none;
  transform: scale(1.06);
  box-shadow: var(--shadow-lg), 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease;
}
