/**
 * #772 — Global Cmd+K command palette.
 * Visual styles match the existing dashboard glass-card aesthetic.
 */

.leapable-cmdk-dialog {
  position: fixed;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 92vw);
  max-height: 70vh;
  margin: 0;
  padding: 0;
  background: rgba(15, 18, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #f4f4f5;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 99999;
  flex-direction: column;
  overflow: hidden;
}

.leapable-cmdk-dialog:not([open]) {
  display: none;
}

.leapable-cmdk-dialog[open] {
  display: flex;
}

.leapable-cmdk-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.leapable-cmdk-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.leapable-cmdk-header i {
  color: #71717a;
}

.leapable-cmdk-header input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f4f4f5;
  font-size: 0.95rem;
  font-family: inherit;
}

.leapable-cmdk-header input::placeholder {
  color: #6b7280;
}

.leapable-cmdk-esc-hint {
  font-size: 0.65rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  padding: 1px 6px;
  color: #a1a1aa;
}

.leapable-cmdk-list {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  overflow-y: auto;
  max-height: calc(70vh - 110px);
}

.leapable-cmdk-section {
  padding: 0.4rem 1rem 0.2rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #71717a;
}

.leapable-cmdk-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0.5rem 1rem;
  cursor: pointer;
  user-select: none;
  border: 0;
  border-left: 2px solid transparent;
}

.leapable-cmdk-row.active,
.leapable-cmdk-row:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-left-color: #14b8a6;
  outline: none;
}

.leapable-cmdk-row-label {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.88rem;
  color: #f4f4f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leapable-cmdk-row-hint {
  flex: 1;
  text-align: right;
  font-size: 0.72rem;
  color: #71717a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leapable-cmdk-empty {
  padding: 1rem;
  text-align: center;
  color: #71717a;
  font-size: 0.85rem;
}

.leapable-cmdk-footer {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.7rem;
  color: #71717a;
}

.leapable-cmdk-footer kbd {
  font-family: ui-monospace, SFMono-Regular, monospace;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  padding: 1px 5px;
  color: #a1a1aa;
  margin-right: 2px;
}

/* First-run toast */
#leapable-cmdk-first-run-toast {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  background: rgba(15, 18, 24, 0.95);
  border: 1px solid rgba(20, 184, 166, 0.4);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: #f4f4f5;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 100000;
  max-width: 320px;
}

#leapable-cmdk-first-run-toast kbd {
  font-family: ui-monospace, SFMono-Regular, monospace;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  padding: 2px 6px;
  color: #14b8a6;
  font-size: 0.75rem;
}

#leapable-cmdk-first-run-toast button {
  align-items: center;
  background: rgba(20, 184, 166, 0.18);
  border: 1px solid rgba(20, 184, 166, 0.4);
  color: #2dd4bf;
  border-radius: 4px;
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  padding: 0.25rem 0.75rem;
  font-size: 16px;
  cursor: pointer;
}

#leapable-cmdk-first-run-toast button:hover {
  background: rgba(20, 184, 166, 0.28);
}
