/* Base styles */
:root {
  --paper-white: #FDFBF6;
  --terminal-beige: #F2EFE3;
  --charcoal: #222222;
  --terminal-green: #A8FFBA;
  --dusty-rose: #FF9E9E;
  --heritage-navy: #26334D;
}

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

body {
  font-family: 'IBM Plex Mono', monospace;
  background-color: var(--terminal-beige);
  color: var(--charcoal);
  line-height: 1.6;
  margin: 0 auto;
  padding: 20px;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%2326334D' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
  max-width: 1200px;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: 'EB Garamond', serif;
  color: var(--heritage-navy);
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  text-align: center;
  letter-spacing: 1px;
}

h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid rgba(38, 51, 77, 0.2);
  padding-bottom: 0.5rem;
}

.subtitle {
  text-align: center;
  font-style: italic;
  margin-bottom: 2rem;
  color: var(--heritage-navy);
}

/* Header */
header {
  padding: 2rem 0;
  border-bottom: 2px solid var(--heritage-navy);
  margin-bottom: 2rem;
  background-color: var(--paper-white);
  border-radius: 5px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  width: 100%;
}

nav {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

nav a {
  margin: 0 1rem;
  color: var(--heritage-navy);
  text-decoration: none;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 3px;
  transition: all 0.3s ease;
}

nav a:hover {
  background-color: var(--terminal-green);
  color: var(--charcoal);
}

/* Main layout */
main {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 2rem;
  width: 100%;
}

/* Search bar */
.search-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  background-color: var(--paper-white);
  padding: 1.5rem;
  border-radius: 5px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  grid-column: 1 / -1;
  gap: 0.8rem;
  width: 100%;
}

.search-bars-wrapper {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.search-bar {
  position: relative;
  width: 100%;
  display: flex;
  align-items: stretch; /* Make all items stretch vertically */
  justify-content: space-between;
  gap: 0;
  margin: 0 auto;
}

/* Active Filters */
.active-filters-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 15px;
  min-height: 34px;
  flex: 1;
}

.refresh-container {
  display: flex;
  align-items: center;
  margin-left: 10px;
}

.refresh-cats-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background-color: var(--terminal-green);
  color: var(--charcoal);
  border: none;
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-cats-btn:hover {
  background-color: var(--dusty-rose);
  color: white;
  transform: translateY(-1px);
}

.animate-spin {
  animation: spin 1s linear infinite;
}

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

.clear-filters-btn {
  background-color: var(--dusty-rose);
  color: var(--charcoal);
  border: none;
  border-radius: 3px;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  height: 24px;
  display: flex;
  align-items: center;
}

.clear-filters-btn:hover {
  background-color: var(--heritage-navy);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.active-filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  height: 100%;
  align-items: center;
  margin: 0;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background-color: rgba(168, 255, 186, 0.3);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  height: 24px;
  transition: all 0.2s ease;
  color: var(--charcoal);
}

.active-filter-tag.active {
  background-color: var(--terminal-green) !important;
  border: 1px solid var(--heritage-navy) !important;
  font-weight: bold !important;
  color: black !important;
}

.active-filter-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

.filter-remove {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background-color: var(--heritage-navy);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  margin-left: 0.3rem;
  position: relative;
  top: -5px;
  right: -5px;
  transition: all 0.2s ease;
}

.filter-remove:hover {
  background-color: var(--dusty-rose);
  transform: scale(1.1);
}

.no-filters {
  font-style: italic;
  color: #888;
  font-size: 0.8rem;
}

.cat-name-container {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  margin: 0;
  gap: 10px;
}

.search-button {
  flex-grow: 1;
  width: 100%;
  height: 49px; /* Match the height of the cat name input */
  background-color: var(--paper-white);
  border: 2px solid var(--heritage-navy);
  padding: 0.8rem;
  font-family: 'EB Garamond', serif;
  font-size: 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0;
  border-radius: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0; /* Allows button to shrink below its content width */
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-button:hover {
  background-color: var(--terminal-green);
}

.search-button.loading {
  background-color: var(--terminal-beige);
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% { background-color: var(--terminal-beige); }
  50% { background-color: rgba(168, 255, 186, 0.5); }
  100% { background-color: var(--terminal-beige); }
}

.arrow-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  color: var(--heritage-navy);
  width: 40px;
  flex: 0 0 40px; /* Don't grow or shrink, stay fixed at 40px */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.arrow-btn:hover {
  color: var(--dusty-rose);
}

.arrow-btn:disabled {
  color: #ccc;
  cursor: not-allowed;
}

.invisible-btn {
  visibility: hidden;
  pointer-events: none;
}

.search-help {
  font-size: 0.8rem;
  color: #666;
  background-color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-top: 0.5rem;
}

/* Filters */
.filters {
  background-color: var(--paper-white);
  padding: 1.5rem;
  border-radius: 5px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.filters h2 {
  text-transform: uppercase;
  font-size: 1.2rem;
  letter-spacing: 1px;
}

.filter-category {
  margin-bottom: 1.5rem;
}

.filter-category h3 {
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(38, 51, 77, 0.2);
  padding-bottom: 0.3rem;
}

.checkbox-list, .radio-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.checkbox-option, .radio-option {
  display: flex;
  align-items: center;
}

.checkbox-option input[type="checkbox"], .radio-option input[type="radio"] {
  margin-right: 0.5rem;
  cursor: pointer;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid #ccc;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-option input[type="checkbox"] {
  border-radius: 3px;
}

.radio-option input[type="radio"] {
  border-radius: 50%;
}

.checkbox-option input[type="checkbox"]:checked, .radio-option input[type="radio"]:checked {
  background-color: var(--terminal-green);
  border-color: var(--heritage-navy);
}

.checkbox-option input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--heritage-navy);
  font-size: 12px;
}

.radio-option input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--heritage-navy);
}

.checkbox-option label, .radio-option label {
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.filter-tag {
  display: inline-block;
  background-color: rgba(168, 255, 186, 0.3);
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none; /* Prevent text selection on click */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.filter-tag:hover {
  background-color: var(--terminal-green);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-tag.active {
  background-color: var(--terminal-green) !important;
  border: 1px solid var(--heritage-navy) !important;
  font-weight: bold !important;
  color: black !important;
  position: relative;
}

.filter-tag.active::after {
  content: "✓";
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--heritage-navy);
  color: white;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.throne-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: white;
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 0.5rem;
  cursor: pointer;
}

.throne-select:focus {
  border-color: var(--terminal-green);
  outline: none;
}

button[type="submit"] {
  display: block;
  width: 100%;
  padding: 0.8rem;
  background-color: var(--terminal-green);
  border: none;
  border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

button[type="button"].filter-action-btn {
  display: block;
  width: 100%;
  padding: 0.8rem;
  background-color: var(--heritage-navy);
  color: white;
  border: none;
  border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

button[type="submit"]:hover, button[type="button"].filter-action-btn:hover {
  background-color: var(--dusty-rose);
  color: white;
}

/* Results */
.results {
  background-color: var(--paper-white);
  padding: 1.5rem;
  border-radius: 5px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.results-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.active-filters-container {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
  gap: 10px;
}

.active-filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.clear-filters-btn {
  background-color: var(--heritage-navy);
  color: white;
  border: none;
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-filters-btn:hover {
  background-color: var(--dusty-rose);
  color: white;
  transform: translateY(-1px);
}

.active-filter-tag {
  background-color: var(--terminal-green);
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.filter-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background-color: var(--heritage-navy);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  margin-left: 5px;
}

/* Removed duplicate cat-name-container style */

.cat-name-input {
  padding: 0.8rem;
  border: 2px solid var(--heritage-navy);
  border-radius: 0;
  font-family: 'IBM Plex Mono', monospace;
  flex: 1 1 auto;
  min-width: 0;
  background-color: var(--paper-white);
  transition: all 0.3s ease;
  margin: 0;
}

.cat-name-input:focus {
  border-color: var(--terminal-green);
  outline: none;
  box-shadow: 0 0 0 2px rgba(168, 255, 186, 0.3);
}

.cat-gender-select {
  padding: 0.8rem 1rem;
  border: 2px solid var(--terminal-green);
  border-radius: 20px;
  font-family: 'IBM Plex Mono', monospace;
  background-color: var(--paper-white);
  cursor: pointer;
  transition: all 0.3s ease;
  width: 120px;
  flex: 0 0 auto;
  margin: 0;
  box-sizing: border-box;
  background-position: right 10px center;
  background-size: 16px;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
}

.cat-gender-select:focus {
  border-color: var(--terminal-green);
  outline: none;
  box-shadow: 0 0 0 2px rgba(168, 255, 186, 0.3);
}

/* Show gender text on desktop */
.gender-text {
  display: inline;
}

/* Enhanced gender selector styling for desktop */
#cat-gender.cat-gender-select {
  background-position: right 15px center;
  text-align: center;
}

/* Gender selector tooltip styling */
.gender-select-container {
  position: relative;
  display: inline-block;
}

.gender-select-container::after {
  content: "?";
  position: absolute;
  top: -8px;
  right: -2px;
  background-color: var(--heritage-navy);
  color: white;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.gender-select-container .tooltip-text {
  visibility: hidden;
  width: 220px;
  background-color: var(--heritage-navy);
  color: white;
  text-align: center;
  padding: 8px 10px;
  border-radius: 6px;
  position: absolute;
  z-index: 100;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.8rem;
  font-weight: normal;
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.gender-select-container .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--heritage-navy) transparent transparent transparent;
}

.gender-select-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.cat-gender-select:hover {
  background-color: var(--terminal-green);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cat-name-input:hover {
  background-color: var(--terminal-green);
}

.results-header h2 {
  margin-bottom: 0;
  white-space: nowrap;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.name-card {
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  padding-bottom: 50px; /* Make room for the register paw button */
}

.name-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2326334d' fill-opacity='0.05'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.8;
  z-index: 0;
}

.name-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.meaning-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: var(--heritage-navy);
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  cursor: help;
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 5;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.meaning-icon:hover {
  background-color: var(--terminal-green);
  color: var(--charcoal);
  transform: scale(1.1);
}

.tooltip {
  position: absolute;
  visibility: hidden;
  opacity: 0;
  width: 220px;
  background-color: var(--paper-white);
  color: var(--charcoal);
  text-align: left;
  border-radius: 5px;
  padding: 10px;
  font-size: 0.8rem;
  line-height: 1.4;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--heritage-navy);
  z-index: 100;
  bottom: 25px;
  right: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: normal;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.meaning-icon:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

.name-card:hover {
  transform: translateY(-3px) rotate(0.5deg);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.name-card h3 {
  margin-top: 0;
  font-size: 1.4rem;
  position: relative;
  z-index: 1;
}

.register-paw {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background-color: var(--terminal-green);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  font-size: 18px;
  overflow: hidden;
}

/* Create a custom paw print */
.register-paw::before {
  content: "🐾";
  font-size: 14px; /* Smaller font size to make it appear as just two paw prints */
}

.register-paw:hover {
  transform: scale(1.1);
  background-color: var(--dusty-rose);
}

.register-paw .tooltip {
  visibility: hidden;
  width: 160px;
  background-color: var(--heritage-navy);
  color: white;
  text-align: center;
  padding: 6px 8px;
  border-radius: 6px;
  position: absolute;
  z-index: 100;
  bottom: 125%;
  left: 0;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.75rem;
  pointer-events: none;
}

.register-paw .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 15px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--heritage-navy) transparent transparent transparent;
}

.register-paw:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

.clickable-surname {
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 5;
  display: inline-block;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 3px;
}

.clickable-surname:hover {
  color: var(--terminal-green);
  text-decoration: underline;
  background-color: rgba(168, 255, 186, 0.2);
}

.clickable-surname::after {
  content: "👆";
  font-size: 12px;
  position: absolute;
  top: -8px;
  right: -8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.clickable-surname:hover::after {
  opacity: 1;
}

.copy-button {
  background-color: rgba(168, 255, 186, 0.7);
  border: none;
  border-radius: 50%;
  color: var(--heritage-navy);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 10;
}

.copy-button:hover {
  background-color: var(--terminal-green);
  color: var(--heritage-navy);
  transform: translateY(-50%) scale(1.1);
}

.copy-button:disabled {
  background-color: rgba(200, 200, 200, 0.5);
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}

.copy-button:disabled:hover {
  transform: translateY(-50%);
  background-color: rgba(200, 200, 200, 0.5);
}

.copy-button svg {
  width: 16px;
  height: 16px;
}

.search-button-container {
  position: relative;
  flex: 1 1 auto; /* Flex grow, flex shrink, flex basis */
  display: flex;
  align-items: stretch;
  min-width: 0; /* Needed for the flex item to shrink below content size */
  width: 100%;
}

.name-card p {
  margin: 0.5rem 0;
  position: relative;
  z-index: 1;
}

.name-card p em {
  font-style: normal;
  font-weight: bold;
  color: var(--heritage-navy);
}

.tag {
  display: inline-block;
  background-color: rgba(168, 255, 186, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.tag:hover {
  background-color: var(--terminal-green);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tag:after {
  content: "+";
  position: absolute;
  right: -2px;
  top: -2px;
  font-size: 10px;
  background-color: var(--heritage-navy);
  color: white;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tag:hover:after {
  opacity: 1;
}

/* Error Message */
.error-message {
  background-color: rgba(255, 158, 158, 0.2);
  border: 1px solid var(--dusty-rose);
  border-radius: 5px;
  padding: 1.5rem;
  text-align: center;
  max-width: 600px;
  margin: 2rem auto;
}

/* Emergency Mode Notice */
.emergency-note {
  background-color: rgba(255, 235, 158, 0.3);
  border: 1px solid #f0c050;
  border-radius: 5px;
  padding: 0.8rem;
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: #805000;
}

.more-surnames {
  background-color: rgba(168, 255, 186, 0.2);
  border: 1px solid var(--terminal-green);
  border-radius: 5px;
  padding: 0.8rem;
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--heritage-navy);
}

.error-message h3 {
  color: var(--heritage-navy);
  margin-bottom: 0.5rem;
}

.retry-button {
  background-color: var(--terminal-green);
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: bold;
  margin-top: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.retry-button:hover {
  background-color: var(--dusty-rose);
  color: white;
}

/* Footer */
footer {
  margin-top: 3rem;
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: #666;
}

/* Support and Links */
.support-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.support-button {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  background-color: var(--heritage-navy);
  color: white;
  border-radius: 20px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.3s ease;
  gap: 0.3rem;
}

.support-button:hover {
  background-color: var(--terminal-green);
  color: var(--charcoal);
  transform: translateY(-2px);
}

/* Cat photo modal */
.cat-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.cat-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.cat-frame {
  background-color: var(--paper-white);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 80vh;
}

.cat-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: repeating-linear-gradient(
    -45deg,
    var(--terminal-green),
    var(--terminal-green) 10px,
    var(--dusty-rose) 10px,
    var(--dusty-rose) 20px
  );
  border-radius: 10px 10px 0 0;
}

.cat-frame-inner {
  position: relative;
  border: 15px solid var(--heritage-navy);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
  background-color: white;
  margin-top: 20px;
}

.cat-frame-inner::after {
  content: '🐾';
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 24px;
  opacity: 0.5;
}

.cat-frame-inner img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  margin: 0 auto;
  object-fit: contain;
}

.cat-frame-footer {
  padding: 10px;
  background-color: var(--terminal-beige);
  border-radius: 5px;
  text-align: center;
}

.cat-frame-footer h3 {
  margin: 0 0 5px 0;
  font-family: 'EB Garamond', serif;
  color: var(--heritage-navy);
}

.cat-frame-footer p {
  margin: 0;
  font-style: italic;
  font-size: 0.9rem;
}

.cat-modal-close {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 40px;
  height: 40px;
  background-color: var(--heritage-navy);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  z-index: 1001;
}

.cat-modal-close:hover {
  background-color: var(--dusty-rose);
  transform: scale(1.1);
}

/* Register Cat Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* Make sure it's above everything */
}

/* When modal is active */
.modal-backdrop.active {
  display: flex;
}

.modal-content {
  background-color: var(--paper-white);
  width: 90%;
  max-width: 500px;
  border-radius: 5px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(38, 51, 77, 0.2);
  padding-bottom: 10px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--heritage-navy);
}

.selected-surname-info {
  background-color: rgba(168, 255, 186, 0.2);
  padding: 15px;
  border-radius: 5px;
  margin: 15px 0;
  border: 1px solid var(--terminal-green);
}

.register-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.quick-register-form {
  margin-top: 15px;
}

.quick-register-form .form-group {
  margin-bottom: 15px;
}

.quick-register-form label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.quick-register-form input, 
.quick-register-form select, 
.quick-register-form textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-family: 'IBM Plex Mono', monospace;
  box-sizing: border-box;
}

.quick-register-form select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 30px;
}

.quick-register-form input:focus, 
.quick-register-form select:focus, 
.quick-register-form textarea:focus {
  outline: none;
  border-color: var(--terminal-green);
  box-shadow: 0 0 0 2px rgba(168, 255, 186, 0.3);
}

.full-form-link {
  display: block;
  text-align: center;
  margin-top: 15px;
  color: var(--heritage-navy);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.full-form-link:hover {
  color: var(--dusty-rose);
  text-decoration: underline;
}

.register-button {
  background-color: var(--terminal-green);
  color: var(--charcoal);
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-weight: bold;
  transition: all 0.3s ease;
}

.register-button:hover {
  background-color: var(--dusty-rose);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cancel-button {
  background-color: #f0f0f0;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancel-button:hover {
  background-color: #e0e0e0;
}

/* Registration success toast */
.success-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--terminal-green);
  color: var(--charcoal);
  padding: 15px 25px;
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  z-index: 2000;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-weight: bold;
  text-align: center;
}

.success-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Cat thumbnail in cards */
.cat-thumbnail-container {
  margin: 10px 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.cat-thumbnail {
  width: 100px;
  height: 100px;
  border-radius: 5px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  border: 3px solid var(--heritage-navy);
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.cat-thumbnail::before {
  content: '🔍';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 5px;
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
}

.cat-thumbnail:hover {
  transform: scale(1.05);
  border-color: var(--terminal-green);
  cursor: pointer !important;
}

.cat-thumbnail:hover::before {
  opacity: 1;
}

.registered-cat {
  border: 2px solid var(--terminal-green);
  position: relative;
}

.registered-cat::before {
  content: "Registered";
  position: absolute;
  top: -10px;
  left: 10px;
  background-color: var(--terminal-green);
  color: var(--charcoal);
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: bold;
  z-index: 5;
}

.clickable-cat {
  position: relative;
  cursor: pointer !important;
}

.click-message {
  /* Hide the click message as requested */
  display: none;
}

.clickable-cat:hover .click-message {
  /* Keep hover state, but message still hidden */
  display: none;
}

/* We now use pill-shaped selectors on all platforms as default */

/* Responsive for mobile */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  main {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }

  .search-container {
    padding: 1rem;
  }

  .search-bars-wrapper {
    width: 100%;
  }

  .cat-name-container {
    flex-direction: row;
    gap: 5px;
    width: 100%;
  }

  .cat-name-input {
    flex: 1;
    min-width: 0;
  }

  .gender-select-container {
    flex: 1;
  }
  
  .cat-gender-select {
    width: 100%;
    min-width: 80px;
    padding: 0.6rem 1rem;
    text-align: center;
    background-color: rgba(168, 255, 186, 0.2);
  }
  
  /* Hide text in gender selector on mobile, but make icons larger */
  .gender-text {
    display: none;
  }
  
  /* Make gender icons larger on mobile */
  .cat-gender-select option {
    font-size: 1.2rem;
  }
  
  /* Adjust tooltip position for mobile */
  .gender-select-container .tooltip-text {
    width: 180px;
    font-size: 0.75rem;
    padding: 6px 8px;
    bottom: 110%;
  }
  
  /* Adjust question mark indicator position for mobile */
  .gender-select-container::after {
    top: -5px;
    right: 5px;
  }
  
  /* Adjust tooltip position for mobile */
  .register-paw .tooltip {
    width: 140px;
    font-size: 0.7rem;
  }

  .search-button {
    height: auto;
    padding: 0.5rem;
  }

  nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  nav a {
    margin: 0;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--heritage-navy);
    border-radius: 3px;
  }

  .support-links {
    margin: 1rem 0;
  }

  .checkbox-list, .radio-list {
    grid-template-columns: 1fr;
  }

  .filter-tag {
    font-size: 0.7rem;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .active-filters-container {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
  }
  
  .cat-frame-inner img {
    max-height: 50vh;
  }
}

@media (max-width: 480px) {
  .search-bar {
    flex-direction: column;
    align-items: center;
  }

  .arrow-btn {
    display: none;
  }

  .cat-card {
    min-width: 100%;
  }

  .tag-cloud {
    gap: 0.3rem;
  }

  .filter-tag {
    padding: 0.2rem 0.4rem;
  }
  
  .cat-modal-content {
    max-width: 95%;
  }
  
  .cat-frame {
    padding: 15px;
  }
  
  .cat-frame-inner {
    border-width: 10px;
  }
}