/* ═══════════════════════════════════════════════════════════════════
 * Omni Command Palette — core styles
 * Uses fumadocs CSS variables so it auto-adapts to every theme.
 * ═══════════════════════════════════════════════════════════════════ */

@keyframes omni-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes omni-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes omni-scale-in {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.98) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
  }
}
@keyframes omni-scale-out {
  from {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) scale(0.98) translateY(-6px);
  }
}

@keyframes omni-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.omni-spin {
  animation: omni-spin 1s linear infinite;
}

.omni-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  animation: omni-fade-in 150ms ease-out;
}

.omni-content {
  --omni-content-top: clamp(5rem, 16vh, 7rem);
  position: fixed;
  z-index: 51;
  top: var(--omni-content-top);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  width: min(720px, calc(100% - 1rem));
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--color-fd-border, #d4d4d4) 70%, transparent);
  background: var(--color-fd-popover, #fafafa);
  color: var(--color-fd-popover-foreground, var(--color-fd-foreground, #272727));
  font-family: var(--font-sans, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
      ui-sans-serif, sans-serif);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  outline: none;
  overscroll-behavior: contain;
  animation: omni-scale-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 639px) {
  .omni-content {
    --omni-content-top: 1rem;
    top: var(--omni-content-top);
    width: calc(100% - 1rem);
    max-height: calc(100vh - 2rem);
  }
}

/* Header */
.omni-header {
  border-bottom: 1px solid var(--color-fd-border, #262626);
}
.omni-search-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
}
.omni-search-icon {
  color: var(--color-fd-muted-foreground, #a3a3a3);
  flex-shrink: 0;
}
.omni-search-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}
.omni-search-input {
  width: 0;
  flex: 1;
  background: transparent;
  outline: none;
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: var(--color-fd-popover-foreground, var(--color-fd-foreground, #272727));
  border: none;
}
.omni-search-input::placeholder {
  color: var(--color-fd-muted-foreground, #a3a3a3);
}
.omni-kbd {
  border-radius: 0.375rem;
  border: 1px solid var(--color-fd-border, #d4d4d4);
  background: transparent;
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  color: var(--color-fd-muted-foreground, #a3a3a3);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
      "Liberation Mono", "Courier New", monospace);
  line-height: 1rem;
}
.omni-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 2.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--color-fd-border, #d4d4d4);
  padding: 0.375rem 0.5rem;
  color: var(--color-fd-muted-foreground, #a3a3a3);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
      "Liberation Mono", "Courier New", monospace);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  transition:
    background 120ms,
    color 120ms;
  cursor: pointer;
  background: none;
}
.omni-close-btn:hover {
  color: var(--color-fd-accent-foreground, var(--color-fd-foreground, #171717));
  background: var(--color-fd-accent, #e5e5e5);
}
.omni-close-btn svg {
  display: none;
}

/* Body / listbox */
.omni-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(540px, calc(100vh - var(--omni-content-top, 7rem) - 8rem));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.5rem;
}
.omni-body::-webkit-scrollbar {
  width: 6px;
}
.omni-body::-webkit-scrollbar-track {
  background: transparent;
}
.omni-body::-webkit-scrollbar-thumb {
  background: var(--color-fd-muted, #262626);
  border-radius: 3px;
}

/* Loading */
.omni-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.625rem;
  color: var(--color-fd-muted-foreground, #a3a3a3);
  font-size: 0.875rem;
}

/* Groups */
.omni-group {
  padding: 0;
}
.omni-group-label {
  display: none;
}
.omni-group-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Items */
.omni-item {
  position: relative;
  display: block;
  width: 100%;
  flex-shrink: 0;
  border-radius: 0.5rem;
  padding: 0.75rem 0.875rem;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.25rem;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--color-fd-foreground, #fafafa);
  transition: background 80ms;
}
.omni-item:hover,
.omni-item-active {
  background: var(--color-fd-accent, rgba(209, 209, 209, 0.5));
}
.omni-item-active {
  color: var(--color-fd-accent-foreground, #171717);
}
.omni-item-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.omni-item-icon {
  display: none;
}
.omni-item-active .omni-item-icon {
  color: var(--color-fd-accent-foreground, #fafafa);
}
.omni-item-text {
  min-width: 0;
}
.omni-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-fd-popover-foreground, var(--color-fd-foreground, #272727));
  font-weight: 500;
  line-height: 1.35;
}
.omni-item-subtitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--color-fd-muted-foreground, #a3a3a3);
  opacity: 1;
}
.omni-item-active .omni-item-subtitle {
  color: var(--color-fd-muted-foreground, #737373);
  opacity: 1;
}
.omni-item-description {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-top: 0.625rem;
  padding-left: 0.75rem;
  border-left: 1px solid color-mix(in srgb, var(--color-fd-border, #d4d4d4) 70%, transparent);
  color: color-mix(in srgb, var(--color-fd-popover-foreground, #272727) 82%, transparent);
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 400;
}
.omni-item-badge {
  display: none;
}
.omni-item-ext {
  display: none;
}
.omni-item-ext:hover {
  color: var(--color-fd-foreground, #fafafa);
  background: var(--color-fd-muted, #262626);
}
.omni-item-shortcuts {
  display: none;
  align-items: center;
  gap: 0.25rem;
  font-size: 10px;
  color: var(--color-fd-muted-foreground, #a3a3a3);
}
@media (min-width: 640px) {
  .omni-item-shortcuts {
    display: flex;
  }
}
.omni-kbd-sm {
  border-radius: 0.25rem;
  background: var(--color-fd-muted, #262626);
  padding: 0.125rem 0.25rem;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
      "Liberation Mono", "Courier New", monospace);
}
.omni-item-chevron {
  display: none;
}
/* Highlight */
.omni-highlight {
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--color-fd-primary, #ca8a04);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Empty states */
.omni-empty-group {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--color-fd-muted-foreground, #a3a3a3);
}
.omni-empty {
  padding: 1.5rem 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-fd-muted-foreground, #a3a3a3);
}
.omni-empty-icon {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--color-fd-muted, #262626);
}

/* Footer */
.omni-footer {
  border-top: 1px solid var(--color-fd-border, #262626);
  background: color-mix(in srgb, var(--color-fd-secondary, #f5f5f5) 50%, transparent);
}
.omni-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.75rem;
  color: var(--color-fd-muted-foreground, #a3a3a3);
}
.omni-footer-hints {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.omni-footer-hint {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}
.omni-footer-hint svg {
  box-sizing: border-box;
  width: 1.375rem;
  height: 1.375rem;
  padding: 0.25rem;
  border-radius: 0.375rem;
  border: 1px solid var(--color-fd-border, #d4d4d4);
  background: color-mix(in srgb, var(--color-fd-muted, #e5e5e5) 70%, transparent);
  color: var(--color-fd-muted-foreground, #737373);
  flex-shrink: 0;
}
.omni-footer-hint-desktop {
  display: none;
}
.omni-footer-filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  white-space: nowrap;
}
@media (min-width: 640px) {
  .omni-footer-hint-desktop {
    display: flex;
  }
}
.omni-filter-label {
  color: var(--color-fd-muted-foreground, #a3a3a3);
}
.omni-filter-value {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--color-fd-popover-foreground, var(--color-fd-foreground, #272727));
}
.omni-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  background: transparent;
  color: var(--color-fd-popover-foreground, var(--color-fd-foreground, #272727));
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.omni-filter-button:hover {
  color: var(--color-fd-accent-foreground, var(--color-fd-foreground, #171717));
}
.omni-filter-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  z-index: 1;
  width: 10rem;
  border: 1px solid var(--color-fd-border, #d4d4d4);
  border-radius: 0.5rem;
  background: var(--color-fd-popover, #fafafa);
  padding: 0.25rem;
  box-shadow: 0 16px 32px -20px rgba(0, 0, 0, 0.45);
}
.omni-filter-option {
  display: flex;
  width: 100%;
  align-items: center;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--color-fd-popover-foreground, var(--color-fd-foreground, #272727));
  cursor: pointer;
  font: inherit;
  padding: 0.5rem 0.625rem;
  text-align: left;
}
.omni-filter-option:hover,
.omni-filter-option-active {
  background: var(--color-fd-accent, rgba(209, 209, 209, 0.5));
}
