/* styles/components.css
   +USDT Studio — 공용 컴포넌트 스타일
   반드시 tokens.css 다음에 로드할 것
*/

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Tabler Icons CDN ── */
/* 각 HTML에서 직접 로드: https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@3/dist/tabler-icons.min.css */

/* ── Header ── */
.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.studio-header .header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.studio-logo {
  height: 28px;
  width: auto;
  display: block;
}

.header-divider {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
}

.header-page-label {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.studio-header .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-primary-lg {
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  font-size: 14px;
  border-radius: var(--radius);
  width: 100%;
  justify-content: center;
}
.btn-primary-lg:hover:not(:disabled) { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  padding: 7px 14px;
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--surface-alt);
}

.btn-ghost-sm {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 11px;
}
.btn-ghost-sm:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 11px;
}
.btn-danger-ghost:hover:not(:disabled) {
  border-color: var(--error);
  color: var(--error);
}

.btn-icon {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 6px;
  border-radius: var(--radius-sm);
}
.btn-icon:hover:not(:disabled) {
  background: var(--surface-alt);
  color: var(--text-primary);
}

/* ── Form Elements ── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.form-input {
  background: var(--surface-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

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

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.form-select {
  background: var(--surface-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s;
}
.form-select:focus { border-color: var(--accent); }

/* ── Card / Section ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-body { padding: 20px; }

.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

/* ── Chip / Badge ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-xl);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
}

.chip-blue {
  background: var(--accent-muted);
  color: var(--accent);
  border-color: rgba(46, 111, 239, 0.25);
}

.chip-muted {
  background: rgba(124, 138, 156, 0.12);
  color: var(--text-muted);
  border-color: var(--border);
}

/* ── Toggle Pill (필터, 언어, 채널) ── */
.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.toggle-item {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  line-height: 1;
}

.toggle-item:hover { border-color: var(--accent); color: var(--text-primary); }

.toggle-item.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Inline Alert ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
}

.alert-error {
  background: var(--error-muted);
  border: 1px solid rgba(252, 92, 101, 0.25);
  color: var(--error);
}

.alert-success {
  background: var(--success-muted);
  border: 1px solid rgba(38, 192, 107, 0.25);
  color: var(--success);
}

/* ── UI Language Select ── */
.ui-lang-select {
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
}
.ui-lang-select:focus { border-color: var(--accent); }
