/* Command Palette */
.command-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.command-palette-panel {
  width: 90%;
  max-width: 560px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.command-palette-tabs {
  display: flex;
  border-bottom: 1px solid rgba(100, 116, 139, 0.3);
  padding: 0 4px;
}

.command-palette-tabs button {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.command-palette-tabs button:hover {
  color: #cbd5e1;
}

.command-palette-tabs button.active {
  color: #e2e8f0;
  border-bottom-color: #3b82f6;
}

.command-palette-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  color: #e2e8f0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(100, 116, 139, 0.2);
  outline: none;
  box-sizing: border-box;
}

.command-palette-input::placeholder {
  color: #64748b;
}

.command-palette-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

.command-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}

.command-palette-item:hover,
.command-palette-item--selected {
  background: rgba(71, 85, 105, 0.5);
}

.command-palette-item-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.command-palette-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.command-palette-item-label {
  font-size: 14px;
  color: #e2e8f0;
  font-weight: 500;
}

.command-palette-item-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.command-palette-item--selected .command-palette-item-label {
  color: #fff;
}

.command-palette-search-result {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}

.command-palette-search-result:hover,
.command-palette-search-result.command-palette-item--selected {
  background: rgba(71, 85, 105, 0.5);
}

.command-palette-search-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.command-palette-search-result-role {
  font-size: 12px;
}

.command-palette-search-result-time {
  font-size: 11px;
  color: #64748b;
}

.command-palette-search-result-snippet {
  font-size: 12px;
  color: #cbd5e1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.command-palette-search-count {
  padding: 6px 12px;
  font-size: 11px;
  color: #64748b;
}

.command-palette-empty {
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

/* Light theme */
[data-theme="light"] .command-palette-overlay {
  background: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .command-palette-panel {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(203, 213, 225, 0.6);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .command-palette-tabs {
  border-bottom-color: rgba(203, 213, 225, 0.6);
}

[data-theme="light"] .command-palette-tabs button {
  color: #64748b;
}

[data-theme="light"] .command-palette-tabs button:hover {
  color: #475569;
}

[data-theme="light"] .command-palette-tabs button.active {
  color: #1e293b;
  border-bottom-color: #007AFF;
}

[data-theme="light"] .command-palette-input {
  color: #1e293b;
  border-bottom-color: rgba(203, 213, 225, 0.4);
}

[data-theme="light"] .command-palette-input::placeholder {
  color: #94a3b8;
}

[data-theme="light"] .command-palette-item:hover,
[data-theme="light"] .command-palette-item--selected {
  background: rgba(241, 245, 249, 0.8);
}

[data-theme="light"] .command-palette-item-label {
  color: #1e293b;
}

[data-theme="light"] .command-palette-item-desc {
  color: #64748b;
}

[data-theme="light"] .command-palette-search-result:hover,
[data-theme="light"] .command-palette-search-result.command-palette-item--selected {
  background: rgba(241, 245, 249, 0.8);
}

[data-theme="light"] .command-palette-search-result-snippet {
  color: #475569;
}

[data-theme="light"] .command-palette-search-result-time {
  color: #94a3b8;
}

[data-theme="light"] .command-palette-search-count {
  color: #94a3b8;
}

[data-theme="light"] .command-palette-empty {
  color: #94a3b8;
}
