/* watchlist_button.css — "+ Watchlist" quick-add button + popover/bottom-sheet
   All classes prefixed with wlq- to avoid colliding with /watchlist/ page (.wl-*).  */

.wlq-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  background: transparent;
  color: var(--text-primary, #f1f5f9);
  border: 1px solid var(--border, #2a3148);
  border-radius: 6px;
  font: 600 13px/1 inherit;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-width: 44px;
  min-height: 44px;
  margin-left: 12px;
  white-space: nowrap;
}
.wlq-trigger:hover,
.wlq-trigger.wlq-open {
  background: rgba(37,99,235,0.10);
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
}
.wlq-trigger .wlq-plus { font-size: 16px; line-height: 1; font-weight: 700; }

/* ===== Popover (desktop) ===== */
.wlq-popover {
  position: absolute;
  z-index: 1000;
  width: 300px;
  background: var(--bg-secondary, #161b2c);
  border: 1px solid var(--border, #2a3148);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  overflow: hidden;
  animation: wlq-pop-in 0.15s ease-out;
  transform-origin: top left;
  color: var(--text-primary, #f1f5f9);
}
@keyframes wlq-pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.wlq-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #2a3148);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.wlq-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}
.wlq-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  color: inherit;
}
.wlq-row:hover, .wlq-row:focus-visible {
  background: rgba(255,255,255,0.05);
  outline: none;
}
.wlq-row .wlq-name { flex: 1; font-size: 14px; }
.wlq-row .wlq-count {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
}
.wlq-row .wlq-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border, #2a3148);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.15s;
}
.wlq-row.wlq-added .wlq-icon {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}
.wlq-row.wlq-loading { opacity: 0.5; pointer-events: none; }

.wlq-divider { height: 1px; background: var(--border, #2a3148); margin: 4px 0; }

.wlq-create {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--accent, #2563eb);
  font-size: 14px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.wlq-create:hover, .wlq-create:focus-visible {
  background: rgba(37,99,235,0.08);
  outline: none;
}
.wlq-create .wlq-plus-create {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--accent, #2563eb);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.wlq-create-input { padding: 12px 16px; display: none; }
.wlq-create-input.wlq-show { display: block; }
.wlq-create-input input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary, #1e2435);
  color: var(--text-primary, #f1f5f9);
  border: 1px solid var(--border, #2a3148);
  border-radius: 6px;
  font: 14px inherit;
  min-height: 44px;
  box-sizing: border-box;
}
.wlq-create-input input:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
}
.wlq-create-input .wlq-helper {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-top: 6px;
}

.wlq-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
}

.wlq-foot {
  border-top: 1px solid var(--border, #2a3148);
  padding: 10px 16px;
  font-size: 12px;
  text-align: center;
}
.wlq-foot a { color: var(--text-muted, #94a3b8); text-decoration: none; }
.wlq-foot a:hover { color: var(--accent, #2563eb); }

/* ===== Bottom-sheet (mobile) ===== */
@media (max-width: 767px) {
  .wlq-popover {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    border-radius: 12px 12px 0 0;
    max-height: 80vh;
    animation: wlq-sheet-up 0.25s ease-out;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
  @keyframes wlq-sheet-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .wlq-popover::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: var(--border, #2a3148);
    border-radius: 2px;
    margin: 8px auto 4px;
  }
  .wlq-list { max-height: 60vh; }
}

.wlq-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  animation: wlq-fade-in 0.15s;
}
@keyframes wlq-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 767px) { .wlq-backdrop.wlq-show { display: block; } }

/* ===== Signup modal (anon) ===== */
.wlq-signup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: wlq-fade-in 0.2s;
}
.wlq-signup {
  background: var(--bg-secondary, #161b2c);
  border: 1px solid var(--border, #2a3148);
  border-radius: 10px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  color: var(--text-primary, #f1f5f9);
  animation: wlq-pop-in 0.2s ease-out;
}
.wlq-signup h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.wlq-signup p { margin: 0 0 20px; color: var(--text-muted, #94a3b8); font-size: 14px; line-height: 1.5; }
.wlq-signup p strong { color: var(--text-primary, #f1f5f9); }
.wlq-signup .wlq-btn-row { display: flex; gap: 8px; flex-direction: column; }
.wlq-signup button, .wlq-signup a {
  padding: 12px 16px;
  border-radius: 6px;
  font: 600 14px inherit;
  cursor: pointer;
  border: 1px solid transparent;
  min-height: 44px;
  transition: all 0.15s;
  text-decoration: none;
  display: block;
  text-align: center;
}
.wlq-signup .wlq-btn-primary {
  background: var(--accent, #2563eb); color: white; border-color: var(--accent, #2563eb);
}
.wlq-signup .wlq-btn-primary:hover { background: #1d4fc7; }
.wlq-signup .wlq-btn-secondary {
  background: transparent;
  color: var(--text-secondary, #cbd5e1);
  border-color: var(--border, #2a3148);
}
.wlq-signup .wlq-btn-secondary:hover { background: rgba(255,255,255,0.05); }
.wlq-signup .wlq-btn-tertiary {
  background: transparent; color: var(--text-muted, #94a3b8); border: none;
  font-size: 12px; margin-top: 4px; min-height: 0; padding: 8px;
}

/* ===== Toast ===== */
.wlq-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: var(--bg-tertiary, #1e2435);
  color: var(--text-primary, #f1f5f9);
  padding: 12px 18px;
  border-radius: 6px;
  border: 1px solid var(--border, #2a3148);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  transition: all 0.25s;
  z-index: 3000;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.wlq-toast.wlq-show { opacity: 1; transform: translate(-50%, 0); }
.wlq-toast.wlq-success { border-color: #22c55e; color: #22c55e; }
.wlq-toast.wlq-error { border-color: #ef4444; color: #ef4444; }
