/* ============================================================
   links.css — TimeSave Link Collector 목록 페이지 (전체 탭)
   design token은 popup.css 와 동기화 유지
   ============================================================ */

:root {
  --bg-base:      #f8f9fb;
  --bg-surface:   #ffffff;
  --bg-card:      #ffffff;
  --bg-card-hover:#f2f4f7;

  --accent:       #2563EB;
  --accent-dim:   rgba(37, 99, 235, 0.08);
  --accent-glow:  rgba(37, 99, 235, 0.18);

  --text-primary:   #111218;
  --text-secondary: #55556a;
  --text-muted:     #9898b0;

  --border:       rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.16);

  --radius:    8px;
  --radius-sm: 5px;

  --font-mono: 'Space Mono', monospace;
  --font-body: 'DM Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────── */
.header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo { display: flex; align-items: center; gap: 12px; }

.logo-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  box-shadow: 0 0 12px var(--accent-glow);
  flex-shrink: 0;
}

.logo-texts {
  display: flex; flex-direction: column; gap: 1px;
}

.logo-name {
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.logo-sub {
  font-size: 11px; font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.header-actions {
  display: flex; align-items: center; gap: 12px;
}

.count-label {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-muted);
}

.btn-copy-all {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
  white-space: nowrap;
}

.btn-copy-all:hover { filter: brightness(1.1); }

/* ── Main ────────────────────────────────────────── */
.main {
  padding: 28px 24px;
}

.container {
  max-width: 760px;
  margin: 0 auto;
}

/* ── Empty State ─────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 24px; gap: 10px; text-align: center;
}

.empty-icon { color: var(--text-muted); margin-bottom: 8px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.empty-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.7; white-space: pre-line; }

/* ── List Wrapper (광고 · 목록 row · 광고 — 세로 스택) ── */
.list-wrapper {
  display: flex;
  flex-direction: column;
}

/* 목록 + 우측 Copy all 버튼 (좌우 배치) */
.list-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

/* ── Link List ───────────────────────────────────── */
.link-list {
  flex: 1;
  display: flex; flex-direction: column; gap: 8px;
}

/* ── Side Copy Button ────────────────────────────── */
.btn-copy-side {
  min-width: 72px;
  width: max-content;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, background 0.2s;
  padding: 16px 8px;
}

.btn-copy-side:hover:not(:disabled) { filter: brightness(1.1); }

.btn-copy-side:disabled {
  background: var(--border-hover);
  cursor: not-allowed;
  filter: none;
}

.btn-copy-label {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.btn-copy-count {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
}

/* ── Link Card ───────────────────────────────────── */
.link-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  animation: slideIn 0.18s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.link-card.removing {
  pointer-events: none;
}

.link-card:hover {
  border-color: rgba(37,99,235,0.3);
  background: var(--bg-card-hover);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.card-num {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(37,99,235,0.18);
  border-radius: 4px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.card-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}

.card-domain {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-url {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.4;
}

/* ── Card Actions ────────────────────────────────── */
.card-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}

.btn-open,
.btn-copy,
.btn-delete {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-open {
  background: var(--bg-base);
  border: 1px solid var(--border-hover);
  color: var(--text-secondary);
}

.btn-open:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-copy {
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  color: var(--text-secondary);
}

.btn-copy:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.btn-check {
  width: 30px; height: 30px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-hover);
  background: transparent;
  color: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.btn-check:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.link-card.selected .btn-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.link-card.selected {
  background: var(--accent-dim);
  border-left-color: var(--accent);
  border-color: rgba(37, 99, 235, 0.25);
}

.btn-copy-side.has-selection {
  background: #16a34a;
}

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: var(--radius-sm);
  color: #fff; font-size: 12px; font-weight: 500;
  padding: 8px 16px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: all 0.2s; z-index: 200;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Hidden ──────────────────────────────────────── */
.hidden { display: none !important; }
