/**
 * search_widget.css — B2BGEMI Universal Search Widget
 * Χρησιμοποιείται σε: demo, landing, dashboard
 */

/* ── Variables (override per-page αν χρειαστεί) ── */
.sw-root {
  --sw-bg: #060d1a;
  --sw-surface: #0c1b2e;
  --sw-line: rgba(130,180,220,.12);
  --sw-line2: rgba(130,180,220,.07);
  --sw-text: #f0f7ff;
  --sw-muted: #7a9ab8;
  --sw-muted2: #4a6a85;
  --sw-teal: #00d4a8;
  --sw-teal2: #5dffe0;
  --sw-orange: #ff6b35;
  --sw-yellow: #ffb800;
}

/* ── Search bar ── */
.sw-bar-wrap { position: relative; width: 100%; }
.sw-bar {
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border: 2px solid rgba(0,212,168,.35);
  border-radius: 16px;
  overflow: hidden;
}
.sw-bar:focus-within {
  border-color: var(--sw-teal);
  box-shadow: 0 0 0 4px rgba(0,212,168,.1);
}
.sw-bar.scanning {
  border-color: var(--sw-teal);
  animation: swScanPulse 1.2s ease-in-out infinite;
}
@keyframes swScanPulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(0,212,168,.12); }
  50%      { box-shadow: 0 0 0 9px rgba(0,212,168,.04); }
}
.sw-icon {
  display: flex;
  align-items: center;
  padding: 0 14px 0 18px;
  color: var(--sw-teal);
  font-size: 18px;
  flex-shrink: 0;
}
.sw-input {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  border: none;
  color: #111827;
  font-size: clamp(14px,1.5vw,17px);
  font-weight: 500;
  padding: 17px 0;
  outline: none;
}
.sw-input::placeholder{
    color:#6b7280;
    opacity:1;
}
.sw-submit {
  background: linear-gradient(135deg, var(--sw-teal), var(--sw-teal2));
  color: #042b22;
  border: none;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity .15s;
  white-space: nowrap;
}
.sw-submit:hover   { opacity: .9; }
.sw-submit:disabled{ opacity: .55; cursor: not-allowed; }

/* Scan line under bar */
.sw-scan-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--sw-teal), var(--sw-teal2), transparent);
  width: 35%;
  border-radius: 1px;
  display: none;
  animation: swScanMove .9s linear infinite;
}
.sw-bar.scanning ~ .sw-scan-line { display: block; }
@keyframes swScanMove { 0%{transform:translateX(0)} 100%{transform:translateX(285%)} }

/* ── Meta row (chips + rate limit) ── */
.sw-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.sw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sw-chip {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--sw-line);
  color: var(--sw-muted);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11px;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.sw-chip:hover { color: var(--sw-teal); border-color: rgba(0,212,168,.3); }
.sw-rl {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--sw-muted2);
  flex-shrink: 0;
}
.sw-rl-dots { display: flex; gap: 4px; }
.sw-rl-dot  { width: 7px; height: 7px; border-radius: 50%; background: var(--sw-teal); }
.sw-rl-dot.used { background: rgba(130,180,220,.15); }

/* ── Results area ── */
.sw-results {
  width: 100%;
  background: var(--sw-surface);
  border: 1px solid var(--sw-line);
  border-radius: 14px;
  margin-top: 10px;
  overflow: hidden;
  display: none; /* shown by JS */
}
.sw-results.visible { display: block; }

/* Scanning state */
.sw-scan-state { padding: 32px; text-align: center; }
.sw-spin {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(0,212,168,.25);
  border-top-color: var(--sw-teal);
  margin: 0 auto 18px;
  animation: swSpin 1s linear infinite;
}
@keyframes swSpin { to { transform: rotate(360deg); } }
.sw-scan-title { font-size: 16px; font-weight: 700; color: var(--sw-text); margin-bottom: 14px; }
.sw-steps { display: flex; flex-direction: column; gap: 8px; max-width: 360px; margin: 0 auto; }
.sw-step {
  font-size: 13px;
  color: var(--sw-muted2);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: swStepIn .35s ease forwards;
}
.sw-step::before { content: '○'; font-size: 10px; flex-shrink: 0; }
.sw-step.done { color: var(--sw-teal); }
.sw-step.done::before { content: '✓'; color: var(--sw-teal); }
@keyframes swStepIn { from{opacity:0;transform:translateX(-8px)} to{opacity:1;transform:none} }

/* Results header */
.sw-res-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--sw-line2);
  flex-wrap: wrap;
  gap: 8px;
}
.sw-res-count { font-size: 14px; font-weight: 600; color: var(--sw-muted); }
.sw-res-count strong { font-size: 20px; color: var(--sw-teal); }
.sw-res-hint { font-size: 11px; color: var(--sw-muted2); }

/* Result cards */
.sw-list { padding: 12px; }
.sw-card {
  background: rgba(4,10,20,.6);
  border: 1px solid var(--sw-line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 9px;
  transition: border-color .15s, transform .15s;
}
.sw-card:last-child { margin-bottom: 0; }
.sw-card:hover { border-color: rgba(0,212,168,.22); transform: translateY(-1px); }
.sw-card.sw-blur { filter: blur(5px); opacity: .35; pointer-events: none; user-select: none; }
.sw-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 9px; }
.sw-card-name { font-weight: 700; font-size: 14px; color: var(--sw-text); }
.sw-card-kad  { font-size: 11px; color: var(--sw-muted2); margin-top: 2px; }
.sw-badges { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; flex-shrink: 0; }
.sw-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 6px; padding: 3px 8px;
  font-size: 10px; font-weight: 800; white-space: nowrap;
}
.sw-hot   { background: rgba(255,107,53,.13); color: #ff8055; }
.sw-warm  { background: rgba(255,184,0,.13);  color: #ffcc44; }
.sw-bnew  { background: rgba(0,212,168,.1);   color: var(--sw-teal); }
.sw-bnosite { background: rgba(255,77,77,.1); color: #ff7777; }
.sw-card-meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  font-size: 11px; color: var(--sw-muted);
  margin-bottom: 9px;
}
.sw-card-meta b { color: var(--sw-text); }
.sw-card-contact { display: flex; flex-wrap: wrap; gap: 6px; }
.sw-ci {
  display: flex; align-items: center; gap: 5px;
  background: rgba(0,212,168,.06);
  border: 1px solid rgba(0,212,168,.14);
  border-radius: 7px; padding: 5px 9px;
  font-size: 11px; color: var(--sw-muted);
}
.sw-ci.locked {
  background: rgba(255,255,255,.02);
  border-color: var(--sw-line2);
  color: var(--sw-muted2);
}

/* Upgrade overlay */
.sw-upgrade-wrap { position: relative; }
.sw-upgrade-overlay {
  background: linear-gradient(to top, var(--sw-surface) 55%, transparent);
  padding: 72px 20px 26px;
  text-align: center;
  margin-top: -50px;
  position: relative;
}
.sw-uo-title { font-size: 19px; font-weight: 800; color: var(--sw-text); margin-bottom: 8px; }
.sw-uo-sub {
  font-size: 13px; color: var(--sw-muted);
  max-width: 480px; margin: 0 auto 16px; line-height: 1.65;
}
.sw-uo-sub strong { color: var(--sw-text); }
.sw-uo-btns { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.sw-uo-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, var(--sw-teal), var(--sw-teal2));
  color: #042b22; border-radius: 10px; padding: 11px 20px;
  font-weight: 800; font-size: 13px; text-decoration: none;
}
.sw-uo-ghost {
  background: rgba(255,255,255,.05); border: 1px solid var(--sw-line);
  color: var(--sw-muted); border-radius: 10px; padding: 11px 16px;
  font-weight: 700; font-size: 12px; text-decoration: none;
}
.sw-uo-note { font-size: 11px; color: var(--sw-muted2); margin-top: 10px; }

/* Empty / error / limit states */
.sw-empty { padding: 28px; text-align: center; }
.sw-empty-icon { font-size: 32px; margin-bottom: 10px; }
.sw-empty h4 { font-size: 15px; font-weight: 700; color: var(--sw-text); margin-bottom: 6px; }
.sw-empty p  { font-size: 13px; color: var(--sw-muted); }
.sw-limit { padding: 24px; text-align: center; }
.sw-limit h4 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.sw-limit p  { font-size: 13px; color: var(--sw-muted); margin-bottom: 14px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .sw-submit span { display: none; }
  .sw-input { font-size: 14px; padding: 15px 0; }
  .sw-res-hdr { flex-direction: column; align-items: flex-start; }
}