/* Command Palette Styles - Vercel Theme */

.command-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  animation: commandDialogFadeIn 0.15s ease-out;
}

.command-dialog-content {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 16px 70px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 640px;
  max-height: 500px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  animation: commandDialogSlideIn 0.15s ease-out;
  position: relative;
}

.command-dialog-content::after {
  content: '';
  position: absolute;
  bottom: 32px;
  left: 8px;
  right: 8px;
  height: 20px;
  background: linear-gradient(transparent, #ffffff);
  pointer-events: none;
  z-index: 1;
}

.command-input {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  border: none;
  width: 100%;
  font-size: 17px;
  padding: 12px 16px;
  outline: none;
  background: transparent;
  color: #000;
}

.command-input::placeholder {
  color: #999;
  font-size: 13px;
}

.command-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
}

.command-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 14px;
  color: #999;
}

.command-group {
  padding: 0;
}

.command-group:not(:last-child) {
  border-bottom: 1px solid #e5e5e5;
}

.command-group [cmdk-group-heading] {
  padding: 5px 16px;
  font-size: 11px;
  font-weight: 500;
  color: #aaa;
  background: #fafafa;
  margin: 0 -8px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.command-item {
  cursor: pointer;
  height: 40px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: #666;
  user-select: none;
  transition: all 150ms ease;
  margin: 0 0 1px 0;
}

.command-item:hover {
  background: #f5f5f5;
  color: #000;
}

.command-item[data-selected="true"] {
  background: #f5f5f5;
  color: #000;
}

.command-item[data-disabled="true"] {
  color: #ccc;
  cursor: not-allowed;
}

.command-item:active {
  background: #ebebeb;
}

/* Override MUI Typography colors for selected state */
.command-item[data-selected="true"] .MuiTypography-root {
  color: #000;
}

.command-item[data-selected="true"] .MuiTypography-caption {
  color: #666;
  opacity: 0.8;
}

/* Icon styling for selected state */
.command-item[data-selected="true"] svg {
  color: #6B8A6A !important;
  opacity: 0.9 !important;
}


/* Custom scrollbar */
.command-list::-webkit-scrollbar {
  width: 6px;
}

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

.command-list::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 3px;
}

.command-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Animations */
@keyframes commandDialogFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Responsive design */
@media (max-width: 640px) {
  .command-dialog {
    padding: 20px;
    align-items: flex-start;
    padding-top: 10vh;
  }

  .command-dialog-content {
    max-width: none;
    width: 100%;
  }

  .command-input {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

/* Screen reader only content */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus styles for accessibility */
.command-input:focus-visible {
  outline: none;
}

.command-item:focus-visible {
  outline: 2px solid #007acc;
  outline-offset: -2px;
  background: #f0f8ff;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .command-dialog-content {
    border: 2px solid;
  }

  .command-item[data-selected="true"] {
    background: Highlight;
    color: HighlightText;
  }

  .command-item:hover {
    background: Highlight;
    color: HighlightText;
  }
}

/* Loading state */
.command-loading {
  padding: 32px 16px;
  text-align: center;
  font-size: 14px;
  color: #999;
}

.command-loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #e5e5e5;
  border-top: 2px solid #000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .command-dialog-content {
    background: rgba(17, 17, 17, 0.95);
    border-color: #333;
  }

  .command-dialog-content::after {
    background: linear-gradient(transparent, rgba(17, 17, 17, 0.95));
  }

  .command-input {
    color: #fff;
    border-bottom-color: #333;
  }

  .command-input::placeholder {
    color: #888;
    font-size: 13px;
  }

  .command-group [cmdk-group-heading] {
    color: #777;
    background: rgba(255, 255, 255, 0.02);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .command-group:not(:last-child) {
    border-bottom-color: #333;
  }

  .command-item {
    color: #999;
  }

  .command-item svg {
    color: #8AAB89 !important;
    opacity: 0.8 !important;
  }

  .command-item:hover,
  .command-item[data-selected="true"] {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
  }

  .command-item[data-selected="true"] .MuiTypography-root {
    color: #fff;
  }

  .command-item[data-selected="true"] .MuiTypography-caption {
    color: #999;
    opacity: 0.8;
  }

  .command-item[data-selected="true"] svg {
    color: #8AAB89 !important;
    opacity: 0.9 !important;
  }

  .command-item:active {
    background: rgba(255, 255, 255, 0.1);
  }

  .command-list::-webkit-scrollbar-thumb {
    background: #333;
  }

  .command-list::-webkit-scrollbar-thumb:hover {
    background: #555;
  }

}

/* Navigation hints footer */
.command-footer {
  border-top: 1px solid #e5e5e5;
  background: #fafafa;
  margin-top: 8px;
}

.command-footer-key {
  background-color: rgba(0, 0, 0, 0.06);
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 10px;
  color: #666;
}

@media (prefers-color-scheme: dark) {
  .command-footer {
    border-top: 1px solid #333;
    background: rgba(255, 255, 255, 0.02);
  }

  .command-footer-key {
    background-color: rgba(255, 255, 255, 0.08);
    color: #aaa;
  }
}