/* ============================================================================
 * ct-pg-srv 업체 SaaS — 공용 CSS
 *
 * 출처: docs/ct-pg-merchant-mockup.html <style> 블록 (변형 없이 클로닝).
 * Tailwind 유틸 클래스가 대부분을 담당하고, 본 파일은 Tailwind 만으로
 * 재현 못하는 시각 요소(애니메이션·hover·배지 등) 만 정의한다.
 *
 * 페이지별 추가 CSS 가 필요하면 dashboard.css / sandbox.css 등으로 분리.
 * 본 PR 은 main.css 단일 파일로 시작.
 * ==========================================================================*/

/* ── 본문 폰트 ─────────────────────────────────────────────── */
body {
  font-family: 'Pretendard', system-ui, -apple-system, sans-serif;
}

/* ── 가는 스크롤바 (사이드바 nav, 샌드박스 콜백 로그 등) ─────── */
.scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scrollbar-thin::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

/* ── Alpine x-cloak 흔적 — 본 layout 은 jQuery 사용이지만, mockup
 * 에서 그대로 옮긴 페이지가 데이터 도착 전 깜빡임을 막는 데 유용. */
[x-cloak] { display: none !important; }

/* ── 배지 (상태·태그·카운터) ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
}

/* ── KPI 메가카드 hover 애니메이션 (대시보드) ───────────────── */
.stat-card { transition: transform 0.15s ease; }
.stat-card:hover { transform: translateY(-2px); }

/* ── 거래 테이블 행 hover ─────────────────────────────────── */
.row-hover:hover {
  background: #F8FAFC;
  cursor: pointer;
}

/* ── 사이드바 nav 활성 표시 ───────────────────────────────── */
.nav-item.active {
  background: #0F1E3D;
  color: white;
}
.nav-item.active svg { color: #F59E0B; }

/* ── ping pulse — 대시보드 회색지대 카드의 알림 도트 ─────── */
.ping-pulse { animation: ping-pulse 1.5s ease-out infinite; }
@keyframes ping-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ── 라이브 콜백 로그 ticker fade-in (샌드박스) ───────────── */
.ticker-row { animation: ticker-fade 0.4s ease-out; }
@keyframes ticker-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
 * 공통 유틸 (mockup 외 추가) — common.js 의 toast / dialog / 시간 helper 가
 * 사용한다. mockup 에 대응 시각이 없는 부분이라 최소한으로만 추가.
 * ==========================================================================*/

/* ── 토스트 ────────────────────────────────────────────── */
.toast {
  pointer-events: auto;
  background: #0F172A;
  color: white;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  animation: toast-in 0.18s ease-out;
  max-width: 360px;
}
.toast.toast-success { background: #10B981; }
.toast.toast-error   { background: #DC2626; }
.toast.toast-warn    { background: #F59E0B; color: #0F1E3D; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 다이얼로그 (확인 / 알림) ───────────────────────────── */
.ct-dialog-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.ct-dialog {
  background: white;
  border-radius: 12px;
  max-width: 440px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.ct-dialog h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 8px;
}
.ct-dialog p { font-size: 14px; color: #475569; margin-bottom: 16px; }
.ct-dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
.ct-dialog button {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #E2E8F0;
  background: white;
}
.ct-dialog button.primary {
  background: #0F1E3D;
  color: white;
  border-color: #0F1E3D;
}
.ct-dialog button.danger {
  background: #DC2626;
  color: white;
  border-color: #DC2626;
}
.ct-dialog .ct-dialog-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-bottom: 16px;
  font-family: inherit;
  background: white;
  box-sizing: border-box;
}
.ct-dialog .ct-dialog-input:focus {
  outline: none;
  border-color: #0F1E3D;
  box-shadow: 0 0 0 3px rgba(15, 30, 61, 0.1);
}
textarea.ct-dialog-input { resize: vertical; min-height: 80px; }

/* ── 거래 상세 모달 / 새 API 키 모달 등 — backdrop ─────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}

/* ── secret 비밀키 1회 표시 모달 — 강조용 ─────────────────── */
.secret-input {
  font-family: 'JetBrains Mono', 'Menlo', monospace;
  letter-spacing: 0.02em;
}
