:host {
  font-family: var(--ai12z-bot-font-family, ui-sans-serif, system-ui, sans-serif);
}

.shortcuts-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  isolation: isolate;
  z-index: 20000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.shortcuts-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shortcuts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.shortcuts-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
}

.close-button {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #636b74;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-button:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.close-button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.shortcuts-body {
  overflow-y: auto;
  padding: 20px 24px;
  flex: 1;
}

.shortcuts-category {
  margin-bottom: 24px;
}

.shortcuts-category:last-child {
  margin-bottom: 0;
}

.shortcuts-category h3 {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px 0;
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background-color: #f9fafb;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.shortcut-item:hover {
  background-color: #f3f4f6;
}

.shortcut-description {
  font-size: 14px;
  color: #374151;
  flex: 1;
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 4px;
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #374151;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.key-separator {
  font-size: 12px;
  color: #9ca3af;
  margin: 0 2px;
}

.shortcuts-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
  border-radius: 0 0 12px 12px;
}

.shortcuts-hint {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

.key-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #374151;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  margin: 0 2px;
}

/* Scrollbar styling */
.shortcuts-body::-webkit-scrollbar {
  width: 8px;
}

.shortcuts-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.shortcuts-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.shortcuts-body::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Responsive design */
@media (max-width: 640px) {
  .shortcuts-content {
    width: 95%;
    max-height: 90vh;
  }

  .shortcuts-header {
    padding: 20px 16px 12px;
  }

  .shortcuts-header h2 {
    font-size: 18px;
  }

  .shortcuts-body {
    padding: 16px;
  }

  .shortcut-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .shortcuts-footer {
    padding: 12px 16px;
  }
}
