/* ==========================================================================
   AUTHENTIC GETLAYERS SEARCH MODAL & COMMAND PALETTE (1:1 PIXEL-PERFECT)
   High-performance GPU transitions, magnetic highlight follower, shimmer loading
   ========================================================================== */
.gsearch-backdrop {
  z-index: 99999;
  padding: 5.5rem 1rem 1rem;
  touch-action: none;
  overscroll-behavior: contain;
  background: rgba(5, 5, 5, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  justify-content: center;
  align-items: flex-start;
  display: flex;
  position: fixed;
  inset: 0px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.28s cubic-bezier(0.16, 1, 0.3, 1), -webkit-backdrop-filter 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
  will-change: opacity, backdrop-filter;
}
.gsearch-backdrop.active,
.gsearch-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(5, 5, 5, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.gsearch-panel {
  border-radius: 20px;
  background: radial-gradient(100% 100% at 50% 0%, rgba(28, 30, 38, 0.96) 0%, rgba(10, 10, 12, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  width: min(40rem, 100%);
  max-width: calc(100vw - 2rem);
  max-height: min(72vh, 40rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}
.gsearch-backdrop.active .gsearch-panel,
.gsearch-backdrop.is-open .gsearch-panel {
  transform: translateY(0px) scale(1);
  opacity: 1;
}

.gsearch-inputrow {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.15rem;
  display: flex;
  flex: 0 0 auto;
}
.gsearch-inputrow-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: #94a3b8;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.gsearch-inputrow-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}
.gsearch-input {
  flex: 1 1 0%;
  min-width: 0px;
  color: #fff;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.02rem;
  font-family: inherit;
}
.gsearch-input::placeholder {
  color: #64748b;
}
.gsearch-clear {
  width: 1.8rem;
  height: 1.8rem;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: all 0.15s ease;
}
.gsearch-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.gsearch-clear svg {
  width: 0.95rem;
  height: 0.95rem;
}
.gsearch-kbd {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  cursor: pointer;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-family: monospace;
  font-weight: 500;
  transition: all 0.15s ease;
}
.gsearch-kbd:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.gsearch-results {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.5rem;
  scrollbar-width: none;
  position: relative;
  isolation: isolate;
}
.gsearch-results::-webkit-scrollbar {
  display: none;
}

/* Authentic Floating Highlight Pill (Follower) */
.gsearch-thumb-hl {
  z-index: 0;
  border-radius: 12px;
  pointer-events: none;
  will-change: transform, width, height, opacity;
  background: linear-gradient(rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
  position: absolute;
  top: 0px;
  left: 0px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), width 0.16s ease, height 0.16s ease, opacity 0.14s ease;
}
.gsearch-results[data-thumb] .gsearch-row:hover,
.gsearch-results[data-thumb] .gsearch-row.gsearch-row-on {
  background: transparent !important;
}

/* Empty State */
.gsearch-empty {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 2.5rem 1.2rem 2.2rem;
  animation: gsearchFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.gsearch-empty-icon {
  width: 3.4rem;
  height: 3.4rem;
  margin-bottom: 0.65rem;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 24px -6px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.gsearch-empty-title {
  letter-spacing: -0.01em;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0;
}
.gsearch-suggest {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1rem;
}
.gsearch-chip {
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  padding: 0.38rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.gsearch-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Grouped Results Entrance */
.gsearch-group {
  margin-bottom: 0.85rem;
  animation: gsearchFadeIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes gsearchFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gsearch-glabel {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  margin: 0;
}
.gsearch-glabel-icon {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
}
.gsearch-glabel-icon svg {
  width: 0.85rem;
  height: 0.85rem;
}
.gsearch-gcount {
  font-family: monospace;
  letter-spacing: 0px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 0.08rem 0.45rem;
  font-size: 0.64rem;
  font-weight: 600;
}

.gsearch-row {
  border-radius: 12px;
  text-align: left;
  width: 100%;
  color: #cbd5e1;
  background: transparent;
  border: none;
  cursor: pointer;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0.6rem;
  display: flex;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: inherit;
  position: relative;
  z-index: 1;
}
.gsearch-row:hover,
.gsearch-row.gsearch-row-on {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

/* High-Fidelity Thumbnail & Previews */
.gsearch-thumb {
  aspect-ratio: 960 / 684;
  background: radial-gradient(120% 120% at 30% 20%, #1a1e28 0%, #0d0f14 100%);
  width: 4.6rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 4px 12px -4px rgba(0,0,0,0.6);
  border-radius: 8px;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
}
.gsearch-row:hover .gsearch-thumb,
.gsearch-row.gsearch-row-on .gsearch-thumb {
  transform: scale(1.03);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 6px 16px -4px rgba(0,0,0,0.8);
}
.gsearch-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.gsearch-thumb-img.is-loaded {
  opacity: 1;
}
.gsearch-thumb-ramp {
  position: absolute;
  inset: 0px;
  border-radius: inherit;
}
.gsearch-thumb-placeholder {
  position: absolute;
  inset: 0px;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.02) 100%);
  background-size: 200% 100%;
  animation: gsearchShimmer 1.8s infinite linear;
}
@keyframes gsearchShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.gsearch-thumb-fallback {
  position: absolute;
  inset: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, 0.08) 0%, rgba(13, 14, 18, 0.95) 100%);
  color: #94a3b8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.gsearch-thumb-fallback svg {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.65;
}

.gsearch-row-title {
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1 1 0%;
  min-width: 0px;
  font-size: 0.92rem;
  font-weight: 500;
  overflow: hidden;
  color: #fff;
}
.gsearch-row-text {
  flex-direction: column;
  flex: 1 1 0%;
  gap: 0.15rem;
  min-width: 0px;
  display: flex;
}
.gsearch-row-text .gsearch-row-title {
  flex: 0 0 auto;
}
.gsearch-row-blurb {
  color: #64748b;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.74rem;
  overflow: hidden;
}
.gsearch-row-tier {
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  flex: 0 0 auto;
  padding: 0.15rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
}
.gsearch-row-tier-free {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.08);
}
.gsearch-seeall {
  color: #38bdf8;
  border-radius: 8px;
  padding: 0.4rem 0.6rem 0.4rem 5.8rem;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  display: flex;
  transition: color 0.15s ease;
}
.gsearch-seeall:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* Footer Hint */
.gsearch-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #64748b;
  background: rgba(255, 255, 255, 0.02);
  flex: 0 0 auto;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.72rem;
  display: flex;
}
.gsearch-foot > span {
  white-space: nowrap;
  align-items: center;
  gap: 0.35rem;
  display: inline-flex;
}
.gsearch-foot-end {
  margin-left: auto;
}
.gsearch-foot kbd {
  font-family: monospace;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 0.1rem 0.4rem;
  font-size: 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
@media (max-width: 767px) {
  .gsearch-backdrop {
    padding: 3.5rem 0.75rem 1rem;
  }
  .gsearch-foot {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gsearch-backdrop,
  .gsearch-panel,
  .gsearch-thumb-hl,
  .gsearch-thumb,
  .gsearch-empty,
  .gsearch-group,
  .gsearch-thumb-img,
  .gsearch-thumb-placeholder {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
