/**
 * Command Palette Styles - Premium Raycast/Linear inspired
 */

/* ============================================
   OVERLAY & CONTAINER
   ============================================ */

.command-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  animation: fadeIn var(--transition-base);
}

.command-palette {
  width: 100%;
  max-width: 640px;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 60vh;
}

/* ============================================
   SEARCH INPUT
   ============================================ */

.command-palette-search {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.command-palette-search-icon {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.command-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  font-family: var(--font-family-sans);
}

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

.command-palette-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  padding: 0 var(--space-2);
  font-size: var(--font-size-xs);
  font-family: var(--font-family-mono);
  color: var(--color-text-secondary);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  flex-shrink: 0;
}

/* ============================================
   RESULTS
   ============================================ */

.command-palette-results {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
  max-height: 400px;
}

.command-palette-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  gap: var(--space-3);
}

.command-palette-category {
  padding: var(--space-3) var(--space-4);
  padding-top: var(--space-4);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.command-palette-category:first-child {
  padding-top: var(--space-3);
}

.command-palette-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.command-palette-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary-500);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.command-palette-item:hover,
.command-palette-item.selected {
  background: var(--color-surface-700);
}

.command-palette-item.selected::before {
  opacity: 1;
}

.command-palette-item-icon {
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.command-palette-item.selected .command-palette-item-icon {
  color: var(--color-primary-500);
}

.command-palette-item-content {
  flex: 1;
  min-width: 0;
}

.command-palette-item-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.command-palette-item-title mark {
  background: var(--color-primary-500);
  color: white;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: var(--font-weight-semibold);
}

.command-palette-item-description {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   FOOTER
   ============================================ */

.command-palette-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
}

.command-palette-hints {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.command-palette-hint {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.command-palette-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1);
  font-size: 11px;
  font-family: var(--font-family-mono);
  color: var(--color-text-secondary);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

/* ============================================
   SCROLLBAR
   ============================================ */

.command-palette-results::-webkit-scrollbar {
  width: 6px;
}

.command-palette-results::-webkit-scrollbar-track {
  background: transparent;
}

.command-palette-results::-webkit-scrollbar-thumb {
  background: var(--color-surface-600);
  border-radius: 3px;
}

.command-palette-results::-webkit-scrollbar-thumb:hover {
  background: var(--color-surface-500);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .command-palette-overlay {
    padding: var(--space-4);
    align-items: center;
  }

  .command-palette {
    max-width: 100%;
  }

  .command-palette-hints {
    display: none;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes commandPaletteSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.command-palette {
  animation: commandPaletteSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   DARK MODE ADJUSTMENTS (future)
   ============================================ */

@media (prefers-color-scheme: light) {
  /* Light mode overrides can go here */
}
