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

:root{
  color-scheme: light dark;

  /* Glas / surfaces (lichter dan voorheen) */
  --surface: rgba(255,255,255,.70);
  --surface-strong: rgba(255,255,255,.78);

  --stroke: rgba(0,0,0,.10);
  --stroke-strong: rgba(0,0,0,.14);

  --text: rgba(0,0,0,.86);
  --muted: rgba(0,0,0,.55);

  --inner: inset 0 1px 0 rgba(255,255,255,.60);

  --blur: 22px;
  --radius: 26px;
}

@media (prefers-color-scheme: dark){
  :root{
    /* Minder "blauw/ink", meer glas */
    --surface: rgba(40,42,48,.40);
    --surface-strong: rgba(40,42,48,.48);

    --stroke: rgba(255,255,255,.10);
    --stroke-strong: rgba(255,255,255,.16);

    --text: rgba(255,255,255,.88);
    --muted: rgba(255,255,255,.55);

    --inner: inset 0 1px 0 rgba(255,255,255,.08);

    --blur: 26px;
  }
}

/* =========================
   Floating button (FAB)
========================= */
.spot-fab{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;

  height: 44px;
  padding: 0 14px 0 12px;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);

  border: 1px solid var(--stroke);
  box-shadow:
    var(--inner),
    0 14px 34px rgba(0,0,0,0.40);

  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);

  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  transition: opacity .14s ease, transform .14s ease, border-color .14s ease;
}

.spot-fab.is-hidden{
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px) scale(0.96);
}

.spot-fab__icon{
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: .85;
}

.spot-fab__hint{
  font: 700 13px/1 "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  letter-spacing: 0.2px;
  color: var(--muted);
}

.spot-fab:hover{ border-color: var(--stroke-strong); }
.spot-fab:active{ transform: translateY(1px); }

@media (max-width: 420px){
  .spot-fab{ width:44px; padding:0; justify-content:center; }
  .spot-fab__hint{ display:none; }
}

/* =========================
   Overlay
========================= */
.spot-overlay{
  position: fixed;
  inset: 0;
  z-index: 9998;

  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);

  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.spot-overlay.is-open{
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   One unified panel (macOS-like)
========================= */
.spot-panel{
  position: fixed;
  top: 14vh;
  left: 50%;
  transform: translateX(-50%) scale(.12);
  transform-origin: 100% 0%;
  opacity: 0;

  width: min(760px, calc(100vw - 48px));
  max-height: min(72vh, 640px);

  border-radius: var(--radius);

  /* Lichter glas + subtiele top-to-bottom sheen */
  background:
    linear-gradient(to bottom, rgba(255,255,255,.10), rgba(255,255,255,.02)),
    var(--surface-strong);

  backdrop-filter: blur(var(--blur)) saturate(1.25);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.25);

  border: 1px solid var(--stroke);

  /* minder "blok", meer lucht */
  box-shadow:
    var(--inner),
    0 28px 90px rgba(0,0,0,.45);

  overflow: hidden;

  transition:
    transform .28s cubic-bezier(.2,.9,.2,1),
    opacity .18s ease,
    border-color .18s ease;
}

@media (prefers-color-scheme: dark){
  .spot-panel{
    background:
      linear-gradient(to bottom, rgba(255,255,255,.06), rgba(255,255,255,.02)),
      var(--surface-strong);
  }
}

.spot-overlay.is-open .spot-panel{
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

/* Right/top glass sheen (zoals macOS) */
.spot-panel::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(900px 380px at 85% 10%,
      rgba(255,255,255,.10),
      transparent 55%
    );
  opacity: .9;
}

@media (prefers-color-scheme: dark){
  .spot-panel::before{ opacity: .75; }
}

/* top shadow appears when results scroll */
.spot-panel::after{
  content:"";
  position:absolute;
  left:0; right:0;
  top: 56px;            /* direct onder input row */
  height: 18px;
  pointer-events:none;
  opacity: 0;
  transition: opacity .16s ease;
  background: linear-gradient(to bottom, rgba(0,0,0,.22), transparent);
}

@media (prefers-color-scheme: dark){
  .spot-panel::after{
    background: linear-gradient(to bottom, rgba(0,0,0,.50), transparent);
  }
}

.spot-panel.has-scroll::after{ opacity: 1; }

/* =========================
   Spotlight row (inside panel)
========================= */
.spotlight{
  height: 56px;
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 0 14px 0 16px;

  background: transparent;
  position: relative;
}

/* subtiele divider onder input row (zachter) */
.spotlight::after{
  content:"";
  position:absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background: rgba(0,0,0,.08);
}

@media (prefers-color-scheme: dark){
  .spotlight::after{
    background: rgba(255,255,255,.07);
  }
}

.spotlight__icon{
  width: 20px;
  height: 20px;
  fill: currentColor;
  opacity: .75;
  flex: 0 0 auto;
}

.spotlight__input{
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  font: 700 18px/1.2 "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  caret-color: var(--text);
}

.spotlight__input:focus{
  outline: none;
  box-shadow: none;
}

.spotlight__input::placeholder{
  color: var(--muted);
  opacity: .65;
}

.spotlight__input::-webkit-search-cancel-button,
.spotlight__input::-webkit-search-decoration{
  display:none;
}

.spotlight__close{
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;

  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color: var(--muted);

  font: 700 12px/1 "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  cursor: pointer;
}

.spotlight__close:hover{
  border-color: var(--stroke-strong);
}

/* =========================
   Results (inside panel)
========================= */
.search-bar-results{
  padding: 10px 0 12px;
  max-height: calc(min(72vh, 640px) - 56px);
  overflow: auto;
}

.search-bar-group-label{
  padding: 12px 18px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.4px;
}

/* Result items */
.search-bar-result-item{
  position: relative;
  display:flex;
  gap: 12px;

  padding: 14px 18px;
  color: var(--text);
  text-decoration:none;

  background: transparent;
  cursor: pointer;

  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  transition: background-color .12s ease;
}

/* subtle separators, straight */
.search-bar-result-item + .search-bar-result-item::before{
  content:"";
  position:absolute;
  top:0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: rgba(0,0,0,.06);
}

@media (prefers-color-scheme: dark){
  .search-bar-result-item + .search-bar-result-item::before{
    background: rgba(255,255,255,.08);
  }
}

/* hover / selected (subtiel, niet blauw) */
.search-bar-result-item:hover,
.search-bar-result-item.selected{
  background: rgba(255,255,255,.05);
}

@media (prefers-color-scheme: dark){
  .search-bar-result-item:hover,
  .search-bar-result-item.selected{
    background: rgba(255,255,255,.06);
  }
}

.search-bar-result-icon{
  font-size: 18px;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.search-bar-result-text{ flex: 1; min-width: 0; }

.search-bar-result-name{
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.search-bar-result-desc{
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-bar-no-results,
.search-bar-error{
  padding: 28px 18px;
  text-align:center;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

/* Scrollbar */
.search-bar-results::-webkit-scrollbar{ width: 8px; }
.search-bar-results::-webkit-scrollbar-track{ background: transparent; }
.search-bar-results::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.20);
  border-radius: 4px;
}
.search-bar-results::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,0.30);
}

@media (prefers-reduced-motion: reduce){
  .spot-overlay, .spot-panel, .spot-fab { transition: none !important; }
}

@media (max-width: 420px){
  .spot-panel{ width: min(360px, calc(100vw - 32px)); }
  .spotlight__input{ font-size: 16px; }
}
