/* ==========================================================================
   FO-Spotlight — Apple Spotlight benzeri global arama paneli
   Layout: sabit backdrop + ortalanmış glass kart
   Tema: dark default, light override :root:not(.dark)
   ========================================================================== */

.fo-spotlight[hidden] { display: none !important; }

.fo-spotlight {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px 16px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  opacity: 0;
  transition: opacity 120ms ease-out;
}
.fo-spotlight.is-open { opacity: 1; }

.fo-spotlight-card {
  width: 100%;
  max-width: 680px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 12, 0.92);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 24px 64px -16px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translateY(-6px) scale(0.985);
  transition: transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}
.fo-spotlight.is-open .fo-spotlight-card {
  transform: translateY(0) scale(1);
}

/* Input */
.fo-spotlight-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.fo-spotlight-input-wrap svg { color: #71717A; flex-shrink: 0; }
.fo-spotlight-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: #E4E4E7;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.01em;
  padding: 4px 0;
}
.fo-spotlight-input::placeholder { color: #52525B; }
.fo-spotlight-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: #22D3EE;
  border-radius: 50%;
  animation: foSspSpin 0.6s linear infinite;
  display: none;
  flex-shrink: 0;
}
.fo-spotlight.is-loading .fo-spotlight-spinner { display: block; }
@keyframes foSspSpin { to { transform: rotate(360deg); } }

/* Footer (Esc hint) */
.fo-spotlight-foot {
  padding: 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  color: #71717A;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.fo-spotlight-foot .fo-spotlight-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Results */
.fo-spotlight-results {
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.fo-spotlight-results::-webkit-scrollbar { width: 6px; height: 6px; }
.fo-spotlight-results::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.10); border-radius: 99px; }

.fo-spt-empty,
.fo-spt-loading-state {
  padding: 36px 24px;
  text-align: center;
  color: #71717A;
  font-size: 13px;
}
.fo-spt-empty strong {
  color: #E4E4E7;
  font-weight: 600;
}

.fo-spt-cat {
  padding: 10px 4px 4px;
}
.fo-spt-cat:first-child { padding-top: 6px; }
.fo-spt-cat-title {
  padding: 6px 18px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #71717A;
  position: sticky;
  top: 0;
  background: rgba(10, 10, 12, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}
.fo-spt-cat-title .fo-spt-cat-count {
  font-size: 9.5px;
  color: #52525B;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.fo-spt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  margin: 0 6px;
  border-radius: 12px;
  cursor: pointer;
  color: #E4E4E7;
  text-decoration: none;
  transition: background-color 80ms ease-out;
  outline: none;
}
.fo-spt-item:hover { background: rgba(255, 255, 255, 0.04); }
.fo-spt-item.is-active {
  background: rgba(34, 211, 238, 0.10);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.30) inset;
}
.fo-spt-item.is-active .fo-spt-title { color: #67E8F9; }

/* Light mode: aktif satırdaki başlık rengi — turkuaz değil, koyu mavi */
:root:not(.dark) .fo-spt-item.is-active { background: rgba(0, 113, 227, 0.10); box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.40) inset; }
:root:not(.dark) .fo-spt-item.is-active .fo-spt-title { color: #0058B0; }
:root:not(.dark) .fo-spt-item.is-active .fo-spt-icon { background: rgba(0, 113, 227, 0.16); border-color: rgba(0, 113, 227, 0.30); color: #0058B0; }
:root:not(.dark) .fo-spt-item.is-active .fo-spt-arrow { color: #0058B0; }

/* Light mode: hover sadece background değiştirsin, yazı rengi sabit kalsın */
:root:not(.dark) .fo-spt-item:hover { background: rgba(0, 0, 0, 0.05); }
.fo-spt-item:focus-visible {
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.45);
}
.fo-spt-icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  color: #A1A1AA;
}
.fo-spt-item.is-active .fo-spt-icon {
  background: rgba(34, 211, 238, 0.16);
  border-color: rgba(34, 211, 238, 0.30);
  color: #67E8F9;
}
.fo-spt-icon svg { width: 16px; height: 16px; }
.fo-spt-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fo-spt-title {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fo-spt-subtitle {
  font-size: 11px;
  color: #71717A;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fo-spt-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.fo-spt-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #34D399;
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.30);
}
.fo-spt-arrow {
  color: #52525B;
  display: inline-flex;
}
.fo-spt-item.is-active .fo-spt-arrow { color: #67E8F9; }
:root:not(.dark) .fo-spt-item.is-active .fo-spt-arrow { color: #0058B0; }

/* Mark highlight */
.fo-spt-mark {
  background: rgba(34, 211, 238, 0.22);
  color: #A5F3FC;
  padding: 0 1px;
  border-radius: 3px;
}
/* Light mode: vurgu koyu olmalı (yazı rengi koyu, üstüne açık ton patlar) */
:root:not(.dark) .fo-spt-mark {
  background: rgba(255, 149, 0, 0.20);
  color: #B36800;
}

/* Light mode overrides */
:root:not(.dark) .fo-spotlight { background: rgba(0, 0, 0, 0.25); }
:root:not(.dark) .fo-spotlight-card {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 24px 64px -16px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}
:root:not(.dark) .fo-spotlight-input-wrap { border-bottom-color: rgba(0, 0, 0, 0.08); }
:root:not(.dark) .fo-spotlight-foot { border-top-color: rgba(0, 0, 0, 0.06); }
:root:not(.dark) .fo-spotlight-input { color: #18181B; }
:root:not(.dark) .fo-spotlight-input::placeholder { color: #A1A1AA; }
:root:not(.dark) .fo-spt-cat-title { background: rgba(255, 255, 255, 0.92); }
:root:not(.dark) .fo-spt-cat-title,
:root:not(.dark) .fo-spt-empty { color: #71717A; }
:root:not(.dark) .fo-spt-item { color: #18181B; }
:root:not(.dark) .fo-spt-item:hover { background: rgba(0, 0, 0, 0.04); }
:root:not(.dark) .fo-spt-icon {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #52525B;
}
:root:not(.dark) .fo-spt-subtitle { color: #71717A; }
:root:not(.dark) .fo-spt-cat-title .fo-spt-cat-count {
  background: rgba(0, 0, 0, 0.04);
  color: #52525B;
}

/* Sub-mobile sıkıştırma */
@media (max-width: 480px) {
  .fo-spotlight { padding-top: 6vh; }
  .fo-spotlight-card { border-radius: 16px; }
  .fo-spotlight-input { font-size: 15px; }
}
