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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  background-color: #f5f5f5;
  color: #333;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  flex-direction: column;
}

.title-container {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-content: center;
}

.logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.header-text h1 {
  margin-bottom: 10px;
}

.header-text .description {
  margin: 0;
}

h1 {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 10px;
}

.description {
  font-size: 1.1rem;
  color: #666;
  max-width: 800px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

.search-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.taxon-select,
.limit-select {
  padding: 10px 15px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  width: 200px;
  background-color: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 1em;
}

.taxon-select:hover,
.limit-select:hover {
  border-color: #3498db;
}

.taxon-select:focus,
.limit-select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.status-bar {
  max-width: 600px;
  margin: 0 auto 20px;
  padding: 15px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.status-text {
  font-size: 1.1rem;
  color: #2c3e50;
  margin-bottom: 10px;
  font-weight: 500;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background-color: #eee;
  border-radius: 5px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background-color: #27ae60;
  width: 0%;
  transition: width 0.3s ease;
}

input {
  padding: 10px 15px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  width: 220px;
}

input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

button {
  padding: 10px 20px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #2980b9;
}

.loading {
  text-align: center;
  font-size: 1.2rem;
  color: #666;
  display: none;
  margin-top: 20px;
}

/* Grid styles for different taxons */
.species-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  padding: 20px 0;
}

.species-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  position: relative;
}

.species-card:hover {
  transform: translateY(-5px);
}

.species-link {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 12px;
}

.species-link:hover {
  text-decoration: none;
  color: inherit;
}

.species-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 7px 7px 0 0px;
}

.species-card h3 {
  margin-bottom: 5px;
  color: #2c3e50;
  font-size: 1.2rem;
}

.species-card .scientific-name {
  color: #666;
  font-style: italic;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.species-card .observations {
  color: #666;
  font-size: 0.9rem;
}
/* 
.species-info {
  padding: 10px;
  padding-top: 0;
} */

.observed {
  border: 3px solid #27ae60;
}

.observed::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  background: #27ae60;
  color: white;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.species-status {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-label {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  color: white;
}

.status-threatened {
  background-color: #d12f19;
}

.status-introduced {
  background-color: #f39c12;
}

.status-endemic {
  background-color: #84a92f;
}

@media (max-width: 1200px) {
  .species-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .species-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .species-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .description {
    padding: 0 20px;
  }

  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  .title-container {
    gap: 10px;
  }

  .logo {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .species-grid {
    grid-template-columns: 1fr;
  }

  .search-container {
    flex-direction: column;
    align-items: center;
  }

  input,
  .taxon-select {
    width: 100%;
    max-width: 300px;
  }
}

.advanced-options-section {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  max-width: none;
}

.advanced-options-checkbox {
  display: inline-block;
  position: relative;
  top: 5px;
}

#advancedOptionsButton {
  background-color: #eee;
  color: #2c3e50;
  border: 1px solid #ddd;
  margin-left: 5px;
  transition: background 0.2s;
}
#advancedOptionsButton:hover {
  background-color: #e1e4e8;
}

.advanced-options-section label {
  margin-left: 3px;
  position: relative;
  top: -2px;
}

input[type="checkbox"] {
  accent-color: #27ae60;
  width: 18px;
  height: 18px;
  margin-left: 15px;
}

.taxon-id-override-input {
  padding: 10px 15px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  width: 220px;
  background-color: white;
  margin-right: 10px;
  position: relative;
}

.taxon-search-container {
  position: relative;
  display: inline-block;
}

.taxon-autocomplete {
  position: absolute;
  top: 43px;
  right: 10px;
  background: white;
  border: 2px solid #ddd;
  border-top: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  width: 220px;
  border-radius: 5px;
}

.taxon-autocomplete.active {
  display: block;
}

.taxon-suggestion {
  padding: 3px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: left;
}

.taxon-suggestion:hover {
  background-color: #f5f5f5;
}

.taxon-suggestion .taxon-name {
  font-weight: 500;
  color: #2c3e50;
}

.taxon-suggestion .taxon-rank {
  font-size: 0.9rem;
  color: #666;
}

.checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  background: #fdfdfd;
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  font-size: 1.05rem;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.location-name {
  font-weight: 500;
  color: #2c3e50;
  margin-right: 15px;
  font-weight: 600;
}

.place-search-container {
  position: relative;
  width: 220px;
}

.place-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #ddd;
  border-top: none;
  border-radius: 0 0 5px 5px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.place-autocomplete.active {
  display: block;
}

.place-suggestion {
  padding: 5px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.place-suggestion:hover {
  background-color: #f5f5f5;
}

.place-suggestion .place-name {
  font-weight: 500;
  color: #2c3e50;
}

.place-suggestion .place-details {
  font-size: 0.9rem;
  color: #666;
  margin-top: 2px;
  align-items: center;
  margin: 10px 0 20px 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  max-width: none;
}

.place-type {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.project-suggestion {
  border-left: 3px solid #17a2b8;
}

.project-suggestion .place-name {
  color: #17a2b8;
}

.project-description {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 3px;
  line-height: 1.3;
  font-style: italic;
}

/* Username autocomplete styles */
.username-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #ddd;
  border-top: none;
  border-radius: 0 0 5px 5px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.username-autocomplete.active {
  display: block;
}

.username-suggestion {
  padding: 5px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.username-suggestion:hover {
  background-color: #f5f5f5;
}

.username-suggestion .username-name {
  font-weight: 500;
  color: #2c3e50;
}

.username-suggestion .username-info {
  font-size: 0.9rem;
  color: #666;
  margin-top: 2px;
}

.username-search-container {
  position: relative;
  width: 220px;
}

.language-select-container {
  margin-top: 15px;
}

.language-select-container label {
  font-weight: 500;
  color: #2c3e50;
  white-space: nowrap;
}

.language-select {
  padding: 10px 15px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 0.8em;
  min-width: 120px;
}

.language-select:hover {
  border-color: #3498db;
}

.language-select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.advanced-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: center;
  align-items: center;
}

.search-button-advanced {
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 12px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
  font-weight: 500;
}

.search-button-advanced:hover {
  background-color: #2980b9;
}

.download-button {
  background-color: #95a5a6;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px 15px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.3s;
  opacity: 0.8;
}

.download-button:hover:not(:disabled) {
  background-color: #7f8c8d;
  opacity: 1;
}

.download-button:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
  opacity: 0.5;
}
