/* Adaptive project-fleet exploration layer.
   Progressive enhancement only: the project directory remains fully readable and linked without JS. */

.fleet-explorer {
  --fleet-lens-accent: #78b9ff;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(12px, 1.8vw, 18px);
  align-items: end;
  margin: 0 0 clamp(18px, 2.5vw, 28px);
  padding: clamp(16px, 2vw, 22px);
  border: 1px solid color-mix(in srgb, var(--fleet-lens-accent) 22%, rgba(220,238,255,.12));
  border-radius: clamp(20px, 2.3vw, 28px);
  background:
    radial-gradient(circle at var(--fleet-lens-x, 24%) 0%, rgba(120,185,255,.16), transparent 42%),
    linear-gradient(145deg, rgba(255,255,255,.075), transparent 36%),
    rgba(7,16,29,.72);
  box-shadow:
    inset 0 1px rgba(255,255,255,.13),
    inset 0 -1px rgba(255,255,255,.025),
    0 18px 52px rgba(0,0,0,.22);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  transition: border-color 220ms ease, box-shadow 280ms ease, background 280ms ease;
}

.fleet-explorer:focus-within {
  border-color: color-mix(in srgb, var(--fleet-lens-accent) 46%, rgba(255,255,255,.2));
  box-shadow:
    inset 0 1px rgba(255,255,255,.18),
    0 20px 58px rgba(0,0,0,.26),
    0 0 36px rgba(78,154,255,.11);
}

.fleet-search-group {
  min-width: 0;
}

.fleet-search-group label {
  display: block;
  margin: 0 0 8px;
  color: #dcecff;
  font-size: .78rem;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fleet-search-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.fleet-search-shell::before {
  content: "⌕";
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-52%);
  color: #8fb9e8;
  font-size: 1.15rem;
  pointer-events: none;
}

#fleet-search {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 13px 48px 13px 44px;
  border: 1px solid rgba(196,222,250,.16);
  border-radius: 15px;
  outline: none;
  color: #f8fbff;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), transparent),
    rgba(3,10,19,.62);
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 8px 22px rgba(0,0,0,.14);
  font: inherit;
  caret-color: #84c1ff;
  transition: border-color 180ms ease, box-shadow 220ms ease, background 220ms ease;
}

#fleet-search::placeholder {
  color: #7f93aa;
  opacity: 1;
}

#fleet-search:focus-visible {
  border-color: rgba(123,190,255,.66);
  box-shadow:
    inset 0 1px rgba(255,255,255,.10),
    0 0 0 3px rgba(74,157,255,.20),
    0 12px 28px rgba(0,0,0,.20);
  background: rgba(5,15,27,.82);
}

.fleet-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  color: #dfeeff;
  background: rgba(255,255,255,.07);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 180ms cubic-bezier(.2,.86,.22,1), background 180ms ease;
}

.fleet-search-clear[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
}

.fleet-search-clear:hover,
.fleet-search-clear:focus-visible {
  background: rgba(126,190,255,.16);
}

.fleet-search-clear:focus-visible {
  outline: 2px solid #8bc5ff;
  outline-offset: 2px;
}

.fleet-search-clear:active {
  transform: translateY(-50%) scale(.94);
}

.fleet-result-summary {
  min-width: 9.5rem;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid rgba(194,221,250,.14);
  border-radius: 15px;
  color: #aebfd3;
  background: rgba(4,12,22,.58);
  box-shadow: inset 0 1px rgba(255,255,255,.06);
  text-align: center;
  white-space: nowrap;
}

.fleet-result-summary strong {
  color: #f7fbff;
  font-variant-numeric: tabular-nums;
}

.project-card[data-fleet-hidden="true"] {
  display: none;
}

.fleet-empty {
  display: none;
  grid-column: 1 / -1;
  min-height: 190px;
  place-items: center;
  padding: clamp(24px, 4vw, 42px);
  border: 1px dashed rgba(166,205,244,.24);
  border-radius: 24px;
  color: #9eb2c8;
  background: rgba(6,15,26,.55);
  text-align: center;
}

.fleet-empty[data-visible="true"] {
  display: grid;
}

.fleet-empty strong {
  display: block;
  margin-bottom: 7px;
  color: #f7fbff;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
}

@media (max-width: 42rem) {
  .fleet-explorer {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .fleet-result-summary {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }
}

@media (hover: none), (pointer: coarse) {
  #fleet-search,
  .fleet-result-summary {
    min-height: 56px;
  }

  .fleet-search-clear {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fleet-explorer,
  #fleet-search,
  .fleet-search-clear {
    transition: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .fleet-explorer,
  #fleet-search,
  .fleet-result-summary,
  .fleet-empty {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #0b1726;
  }
}

@media (forced-colors: active) {
  .fleet-explorer,
  #fleet-search,
  .fleet-result-summary,
  .fleet-empty {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
    box-shadow: none;
  }

  #fleet-search:focus-visible,
  .fleet-search-clear:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }
}
