/* ══════════════════════════════════════════════════════════════
   Search Box — MarketVisuals Ana Sayfa
   report-common.css'teki CSS değişkenlerini kullanır:
     --bg-card, --border, --border-light, --text-primary,
     --text-secondary, --text-muted, --accent, --radius, --radius-sm
   Dolayısıyla light/dark tema otomatik destekli.
   ══════════════════════════════════════════════════════════════ */

.home-search {
  position: relative;
  margin-bottom: 14px;
}

.home-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.08),
              0 0 0 4px rgba(var(--accent-rgb), 0.04);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.home-search-bar:focus-within {
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.18),
              0 0 0 4px rgba(var(--accent-rgb), 0.08);
}

.home-search-icon {
  flex-shrink: 0;
  color: var(--accent);
}

.home-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  padding: 2px 0;
  font-family: inherit;
}

.home-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.home-search-clear {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}

.home-search-clear:hover {
  background: var(--accent);
  color: #111;
}

/* ── Dropdown ─────────────────────────────────────────────────── */

.home-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4),
              0 4px 8px rgba(0, 0, 0, 0.2);
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 0;
}

.home-search-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.home-search-group {
  margin-bottom: 4px;
}

.home-search-group:last-child {
  margin-bottom: 0;
}

.home-search-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.home-search-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--border);
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: 0;
}

.home-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.12s;
  cursor: pointer;
}

.home-search-item:hover,
.home-search-item.active {
  background: rgba(var(--accent-rgb), 0.09);
}

.home-search-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.home-search-item-badge {
  flex-shrink: 0;
  min-width: 54px;
  text-align: center;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color: #111;
  background: var(--accent);
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
}

.home-search-item-badge-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.home-search-item-badge-page {
  min-width: 28px;
  width: 28px;
  height: 28px;
  line-height: 20px;
  background: var(--border);
  color: var(--text-primary);
  border-radius: 50%;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-search-item-text {
  flex: 1;
  min-width: 0;
}

.home-search-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-search-item-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.home-search-hints {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 10px 16px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.home-search-hints kbd {
  background: var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 10px;
  margin-right: 3px;
  color: var(--text-primary);
}

/* ── Light mode tweaks ────────────────────────────────────────── */
[data-theme="light"] .home-search-bar {
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08),
              0 0 0 4px rgba(217, 119, 6, 0.04);
}

[data-theme="light"] .home-search-bar:focus-within {
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.18),
              0 0 0 4px rgba(217, 119, 6, 0.08);
}

[data-theme="light"] .home-search-dropdown {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08),
              0 4px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .home-search-item:hover,
[data-theme="light"] .home-search-item.active {
  background: rgba(217, 119, 6, 0.08);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .home-search-input {
    font-size: 15px;
  }
  .home-search-item-badge {
    min-width: 46px;
    font-size: 11px;
  }
  .home-search-hints {
    flex-wrap: wrap;
    gap: 8px;
  }
}
