.a-doc-search {
  width: 100%;
}

.a-doc-search__form {
  width: 100%;
}

.a-doc-search__wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 600px;
}

.a-doc-search__icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: var(--color-greyscale-5);
  pointer-events: none;
  z-index: 1;
}

.a-doc-search__input {
  width: 100%;
  height: 48px;
  padding: 12px 120px 12px 48px;
  border: 1px solid var(--color-greyscale-7);
  border-radius: 8px;
  background: var(--color-greyscale-10);
  font-size: 14px;
  line-height: 20px;
  color: var(--color-greyscale-1);
  transition: all 0.2s ease;
}

.a-doc-search__input::placeholder {
  color: var(--color-greyscale-5);
}

.a-doc-search__input:hover {
  border-color: var(--color-greyscale-6);
}

.a-doc-search__input:focus {
  outline: none;
  border-color: var(--color-main-1);
  box-shadow: 0 0 0 3px rgba(var(--color-main-1-rgb, 147, 51, 234), 0.1);
  background: white;
}

.a-doc-search__shortcut {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--color-greyscale-7);
  border-radius: 4px;
  background: var(--color-greyscale-9);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-greyscale-4);
  pointer-events: none;
  font-family: system-ui, -apple-system, sans-serif;
}

.a-doc-search__shortcut-key {
  font-size: 14px;
  line-height: 1;
}

.a-doc-search__shortcut-text {
  line-height: 1;
}

/* Hide shortcut on small screens */
@media (max-width: 768px) {
  .a-doc-search__shortcut {
    display: none;
  }

  .a-doc-search__input {
    padding-right: 16px;
  }

  .a-doc-search__wrapper {
    max-width: 100%;
  }
}

/* Focus state without shortcut */
.a-doc-search__input:focus ~ .a-doc-search__shortcut {
  opacity: 0.5;
}

/* Search results loading state */
.a-doc-search--loading .a-doc-search__icon {
  animation: spin 1s linear infinite;
}

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

/* Windows/Linux: Show Ctrl instead of Cmd */
@media (min-width: 769px) {
  .a-doc-search__shortcut-key {
    content: "⌘";
  }

  /* This would need JS to detect OS and change the icon */
}
