* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --aa-selected-color-rgb: 209, 213, 219 !important;
  --aa-primary-color-rgb: 217, 3, 104 !important;
}
a {
  text-decoration: none;
}
html,
body {
  font-family: 'Open Sans', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
    sans-serif;
}
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0.5rem;
  gap: 1.5rem;
  max-width: 640px;
  margin: auto;
}
header {
  width: 100%;
  text-align: right;
  font-size: 14px;
}
header a {
  color: black;
  text-decoration: underline;
}
main {
  width: 100%;
}

li {
  font-weight: 500;
  color: #9ca3af;
}
h1 {
  font-weight: 600;
}
b {
  font-weight: 500;
  color: black;
}
.aa-Form {
  border-radius: 0 !important;
}

.aa-InputWrapperPrefix > * {
  display: none !important;
}
.aa-InputWrapperPrefix {
  width: 0.75rem;
}
.aa-Panel {
  border-radius: 0.5rem !important;
  font-size: 14px !important;
}
h2 {
  font-size: medium;
  font-weight: normal;
  text-align: center;
}
#typesense,
#typesense > * {
  color: rgb(var(--aa-primary-color-rgb));
}

#typesense {
  font-weight: 500;
}
#typesense b {
  font-weight: 700;
}
input {
  font-weight: 500 !important;
  font-size: 14px !important;
}

/* Guiding text */
.guiding-text {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 13px;
  color: #6b7280;
  text-align: left;
}

.guide-link {
  color: rgb(var(--aa-primary-color-rgb));
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}

.guide-link:hover {
  color: rgb(var(--aa-primary-color-rgb));
  text-decoration: underline;
}

.click-to-add-text {
  color: rgb(var(--aa-primary-color-rgb));
}

/* Tags container - Tag Box */
.tags-container {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background-color: #f9fafb;
  min-height: 3rem;
}

.tags-container::before {
  content: 'search tags';
  position: absolute;
  top: -0.625rem;
  left: 0.75rem;
  background-color: white;
  padding: 0 0.5rem;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tag styling */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  background-color: rgb(var(--aa-selected-color-rgb));
  border-radius: 0.375rem;
  font-size: 13px;
  line-height: 1.5;
}

.tag-value-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.tag-value {
  font-weight: 500;
  color: #1f2937;
}

.tag-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  appearance: none;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background-color: white;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s;
}

.tag-checkbox-exclude::after {
  content: '!';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #9ca3af;
  opacity: 0.5;
  pointer-events: none;
  transition: all 0.2s;
  font-weight: bold;
}

.tag-checkbox-exclude:checked {
  background-color: #ef4444;
  border-color: #ef4444;
}

.tag-checkbox-exclude:checked::after {
  color: white;
  opacity: 1;
}

.tag-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: rgb(var(--aa-primary-color-rgb));
  padding: 0.125rem 0.25rem;
  background-color: rgba(var(--aa-primary-color-rgb), 0.1);
  border-radius: 0.25rem;
}

.tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #6b7280;
  padding: 0;
  margin-left: 0.125rem;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.tag-remove:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #1f2937;
}

.tag-andor-switch {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0;
  margin-left: 0.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  line-height: 1.2;
  display: inline-flex;
  overflow: hidden;
}

.tag-andor-switch:hover {
  border-color: #9ca3af;
}

.tag-andor-option {
  padding: 0.125rem 0.375rem;
  color: #6b7280;
  transition: all 0.2s;
}

.tag-andor-option.active {
  background-color: rgb(var(--aa-primary-color-rgb));
  color: white;
}

/* Suggestion item styling */
.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.suggestion-value {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

/* Field badge in suggestions */
.field-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.field-city {
  background-color: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.field-street {
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.field-region {
  background-color: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
}

.field-postcode {
  background-color: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.field-number {
  background-color: rgba(236, 72, 153, 0.1);
  color: #db2777;
}

/* Game field badges */
.field-title {
  background-color: rgba(217, 3, 104, 0.1);
  color: rgb(var(--aa-primary-color-rgb));
}

.field-developer {
  background-color: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.field-publisher {
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.field-genres {
  background-color: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
}

.field-supportedOperatingSystems {
  background-color: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.field-amount {
  background-color: rgba(236, 72, 153, 0.1);
  color: #db2777;
}

.field-releaseDate {
  background-color: rgba(107, 114, 128, 0.1);
  color: #4b5563;
}

/* Game result styling */
.game-title {
  font-weight: 600;
  font-size: 16px;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.game-details {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
}

.game-field {
  font-weight: 600;
  color: #374151;
}

/* Results container */
.results-container {
  margin-top: 2rem;
  width: 100%;
}

#results-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.result-item {
  padding: 0.75rem 1rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  font-size: 14px;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}

.result-item:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

.loading, .no-results, .error {
  padding: 2rem;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

.error {
  color: #dc2626;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.page-btn {
  padding: 0.5rem 0.75rem;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 2.5rem;
  text-align: center;
}

.page-btn:hover:not(.active) {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.page-btn.active {
  background-color: rgb(var(--aa-primary-color-rgb));
  color: white;
  border-color: rgb(var(--aa-primary-color-rgb));
}

.page-ellipsis {
  padding: 0.5rem 0.25rem;
  color: #6b7280;
}

.results-info {
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  margin-top: 0.5rem;
}
