/* ============================================
   SPYFOX GADGETS — SUPPORT SEARCH SYSTEM
   Aesthetic: Clean White / Professional
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg:            #ffffff;
  --bg-panel:      #f7f8fa;
  --bg-card:       #ffffff;
  --bg-card-hover: #f7f8fa;
  --border:        #e2e5ea;
  --border-active: #111;
  --accent:        #111111;
  --accent-soft:   #f0f0f0;
  --text-primary:  #111111;
  --text-secondary:#555555;
  --text-muted:    #999999;
  --tag-camera:    #e8f4ff;
  --tag-gps:       #e8fff4;
  --tag-audio:     #fff8e8;
  --tag-detector:  #f5e8ff;
  --tag-camera-text:   #0066cc;
  --tag-gps-text:      #007744;
  --tag-audio-text:    #885500;
  --tag-detector-text: #6600aa;
  --tag-camera-border:   #b3d4f5;
  --tag-gps-border:      #b3e8cc;
  --tag-audio-border:    #f5d9a0;
  --tag-detector-border: #d4b3f0;
  --radius:        6px;
  --radius-lg:     10px;
  --shadow:        0 1px 4px rgba(0,0,0,0.08), 0 2px 12px rgba(0,0,0,0.05);
  --shadow-hover:  0 4px 20px rgba(0,0,0,0.12);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-panel);
  color: var(--text-primary);
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── HEADER ── */
.site-header {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.site-header img {
  width: 100%;
  display: block;
  max-height: 260px;
  object-fit: cover;
}

.header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(247,248,250,0.6) 100%);
}

/* ── MAIN CONTAINER ── */
.main-wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ── PAGE TITLE ── */
.page-title {
  text-align: center;
  padding: 36px 0 24px;
}

.page-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin: 14px auto 0;
  border-radius: 2px;
}

.page-title h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.page-title h1 span {
  color: var(--text-secondary);
}

.page-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  margin-top: 8px;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── SEARCH BAR ── */
.search-section {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(to bottom, var(--bg-panel) 80%, transparent);
  padding: 12px 0 18px;
}

.search-wrapper {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}

#search-input {
  width: 100%;
  padding: 14px 44px 14px 46px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

#search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.88rem;
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.07);
}

.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  display: none;
  transition: color 0.15s;
  line-height: 1;
}

.clear-btn:hover { color: var(--text-primary); }
.clear-btn.visible { display: block; }

/* Autocomplete dropdown */
#autocomplete {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 200;
  display: none;
  box-shadow: var(--shadow-hover);
}

#autocomplete.open { display: block; }

.autocomplete-item {
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s, color 0.1s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--bg-panel); color: var(--text-primary); }
.autocomplete-item .ac-icon { opacity: 0.4; font-size: 0.8rem; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
  opacity: 0.25;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── RESULTS GRID ── */
#results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ── RESULT CARD ── */
.result-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  animation: card-in 0.25s ease both;
  position: relative;
  box-shadow: var(--shadow);
}

.result-card:hover {
  border-color: #bbb;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Relevance badge */
.relevance-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* Card layout */
.card-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

@media (max-width: 680px) {
  .card-layout { grid-template-columns: 1fr; }
}

/* LEFT: Info + Steps */
.card-info {
  padding: 22px 24px;
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 680px) {
  .card-info { border-right: none; border-bottom: 1.5px solid var(--border); }
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Category tag */
.card-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  width: fit-content;
  border: 1px solid transparent;
}

.card-category-tag.camera   { background: var(--tag-camera);   color: var(--tag-camera-text);   border-color: var(--tag-camera-border); }
.card-category-tag.gps      { background: var(--tag-gps);      color: var(--tag-gps-text);      border-color: var(--tag-gps-border); }
.card-category-tag.audio    { background: var(--tag-audio);    color: var(--tag-audio-text);    border-color: var(--tag-audio-border); }
.card-category-tag.detector { background: var(--tag-detector); color: var(--tag-detector-text); border-color: var(--tag-detector-border); }

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.25;
  padding-right: 60px;
}

.card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Steps */
.steps-title {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.steps-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  max-height: 280px;
  padding-right: 4px;
}

.steps-list::-webkit-scrollbar { width: 3px; }
.steps-list::-webkit-scrollbar-track { background: transparent; }
.steps-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.step-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 5px 6px;
  border-radius: 4px;
  transition: background 0.1s;
}

.step-item:hover { background: var(--bg-panel); }

.step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 1px;
}

/* RIGHT: Video */
.card-video {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-panel);
}

.video-label {
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-label .rec-dot {
  width: 6px;
  height: 6px;
  background: #e63030;
  border-radius: 50%;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── FOOTER ── */
.site-footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  background: #fff;
  margin-top: 20px;
}
