/* Autocomplete dropdown for shortcuts */
.shortcut-autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  top: 110%;
  background: rgba(255,255,255,0.16);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  z-index: 9999;
  max-height: 220px;
  overflow-y: auto;
  font-family: var(--font-body);
  font-size: 1rem;
  margin-top: 0.25rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* subtle border and shadow for separation */
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
  /* Force hardware acceleration for backdrop-filter */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.shortcut-ac-item {
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  transition: background 0.15s;
}
.shortcut-ac-item.selected,
.shortcut-ac-item:hover {
  background: var(--bg-card-hover);
}
.shortcut-ac-key {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  color: var(--text-secondary);
  font-size: 1.05em;
}
.shortcut-ac-name {
  color: var(--text-primary);
  font-size: 0.98em;
}
/* Modern Search UI Styles */

:root {
  --primary: #ffffff;
  --primary-light: #e5e5e5;
  --primary-dark: #a3a3a3;
  --accent: #d4d4d4;
  
  --bg-dark: #0a0a0a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  
  --text-primary: #fafafa;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);
  
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 60px rgba(255, 255, 255, 0.05);
  
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* Subtle background gradient */
.background-gradient {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
  z-index: -2;
}

/* Animated grid lines */
.background-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* Scanning line effect */
.background-gradient::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.03),
    transparent
  );
  animation: scan 8s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% { transform: translateY(-200px); }
  50% { transform: translateY(100vh); }
}

/* Floating orbs */
.floating-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  animation: float 20s ease-in-out infinite;
  opacity: 0.8;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.04);
  top: -150px;
  left: -150px;
  animation: float 25s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.03);
  bottom: -100px;
  right: -100px;
  animation: float 30s ease-in-out infinite reverse;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.025);
  top: 50%;
  left: 50%;
  animation: pulse-orb 10s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -40px) scale(1.1); }
  50% { transform: translate(-30px, 30px) scale(0.9); }
  75% { transform: translate(-40px, -30px) scale(1.05); }
}

@keyframes pulse-orb {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.8; }
}

/* Container */
.container {
  width: 100%;
  max-width: 600px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Logo */
.logo-text {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.125rem;
  font-weight: 500;
  margin-top: -0.5rem;
}

/* Search form */
.search-form {
  width: 100%;
  margin-top: 1rem;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 0.375rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-glow);
  z-index: 10001;
}

.search-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 
    var(--shadow-glow),
    0 0 0 4px rgba(99, 102, 241, 0.15);
}

.search-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.9rem 3.25rem 0.9rem 3.25rem; /* left/right reserve space for icon & button */
  font-size: 1.125rem;
  color: var(--text-primary);
  font-family: var(--font-body);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--text-primary);
  border: none;
  border-radius: 0.625rem;
  color: var(--bg-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
}

.search-button:hover {
  opacity: 0.9;
}

.search-button:active {
  opacity: 0.8;
}

.search-button svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Quick tries */
.quick-tries {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.quick-label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.quick-tag {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.quick-tag:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Cheatsheet */
.cheatsheet {
  width: 100%;
  margin-top: 1.5rem;
}

.cheatsheet-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cheatsheet-toggle:hover {
  border-color: var(--primary);
  color: var(--text-secondary);
}

.cheatsheet-toggle .chevron {
  width: 1rem;
  height: 1rem;
  transition: transform 0.3s ease;
}

.cheatsheet.expanded .cheatsheet-toggle .chevron {
  transform: rotate(180deg);
}

/* Make cheatsheet scrollable when expanded */
.cheatsheet-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}

.cheatsheet.expanded .cheatsheet-content {
  grid-template-rows: 1fr;
  margin-top: 1rem;
}

.cheatsheet-inner {
  overflow: hidden;
  max-height: 0; /* collapsed */
  padding: 0 0.5rem; /* keep horizontal spacing but no vertical padding when collapsed */
  pointer-events: none;
  transition: max-height 0.28s ease, padding 0.28s ease;
  outline: none;
  box-shadow: none;
}

.cheatsheet.expanded .cheatsheet-inner {
  overflow-y: auto;
  max-height: 50vh; /* expand to allow scrolling */
  padding: 0.75rem 0.5rem; /* restore vertical padding when open */
  pointer-events: auto;
}

/* Add a visible scrollbar for cheatsheet */
.cheatsheet-inner::-webkit-scrollbar {
  width: 8px;
}
.cheatsheet-inner::-webkit-scrollbar-thumb {
  background: var(--bg-card-hover);
  border-radius: 4px;
}
.cheatsheet-inner {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-card-hover) transparent;
}

.cheatsheet-inner {
  overflow: hidden;
}

.cheatsheet-hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 1rem;
}

.cheatsheet-hint code {
  background: var(--bg-card);
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  color: var(--text-primary);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.shortcut-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.shortcut-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.shortcut-key {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.shortcut-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Footer */
.footer {
  position: fixed;
  bottom: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.375rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  margin: 0 0.125rem;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 1.5rem;
  }
  
  .logo-text {
    font-size: 2.5rem;
  }
  
  .search-input {
    font-size: 1rem;
    padding: 0.875rem;
  }
  
  .shortcut-grid {
    grid-template-columns: 1fr;
  }
  
  .footer {
    display: none;
  }
}
