/* Directory Page Styles */

.directory-container {
  min-height: 100vh;
  padding: 2rem 0;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
}

/* Header Section */
.directory-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.directory-header h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 700;
}

.directory-subtitle {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.directory-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  background: var(--gray-1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  border: 1px solid var(--accent-color-30);
}

/* Search and Filter Section */
.search-filter-section {
  background: var(--gray-1);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--accent-color-10);
}

.search-container {
  margin-bottom: 2rem;
}

.search-input-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 1rem 3rem 1rem 1rem;
  border: 2px solid var(--accent-color-30);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--anchor-color);
  box-shadow: 0 0 0 3px var(--anchor-color-50);
}

.clear-search-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.clear-search-btn:hover {
  opacity: 1;
  background: var(--accent-color-10);
}

/* Filter Section */
.filter-container {
  border-top: 1px solid var(--accent-color-10);
  padding-top: 2rem;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.filter-header h3 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.2rem;
}

.clear-filters-btn {
  background: none;
  border: 1px solid var(--accent-color-30);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.clear-filters-btn:hover {
  background: var(--accent-color-10);
  border-color: var(--anchor-color);
}

/* Tags Container */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tag-filter {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: var(--gray-700);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-filter:hover {
  background: var(--accent-color-10);
  border-color: var(--anchor-color);
  transform: translateY(-1px);
}

.tag-filter.active {
  background: var(--anchor-color);
  color: var(--gray-1);
  border-color: var(--anchor-color);
}

.tag-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.tag-filter.active .tag-count {
  background: rgba(255, 255, 255, 0.3);
}

/* Selected Tags */
.selected-tags {
  display: none;
  padding: 1rem;
  background: var(--accent-color-5);
  border-radius: 8px;
  border: 1px solid var(--accent-color-10);
}

.selected-tags.show {
  display: block;
}

.selected-tags-label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.selected-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.selected-tag {
  background: var(--anchor-color);
  color: var(--gray-1);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.remove-tag {
  background: none;
  border: none;
  color: var(--gray-1);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

/* Results Section */
.results-section {
  margin-top: 2rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-header h2 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.5rem;
}

.sort-options {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-options label {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.9rem;
}

.sort-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent-color-30);
  border-radius: 6px;
  background: var(--gray-1);
  color: var(--primary-color);
  cursor: pointer;
}

/* Loading Indicator */
.loading-indicator {
  text-align: center;
  padding: 3rem;
  color: var(--primary-color);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--accent-color-30);
  border-top: 4px solid var(--anchor-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Sites Grid */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.site-card {
  background: var(--gray-1);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--accent-color-10);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.site-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--anchor-color);
}

.site-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.site-icon {
  flex-shrink: 0;
}

.site-icon img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.site-icon-fallback {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-1);
  font-weight: bold;
  font-size: 24px;
  text-transform: uppercase;
}

.site-title-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.site-title {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.featured-badge {
  background: var(--success-green);
  color: var(--gray-1);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.site-description {
  margin-bottom: 1rem;
}

.site-description p {
  margin: 0;
  color: var(--primary-color);
  line-height: 1.5;
  font-size: 0.95rem;
}

.site-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.site-tag {
  background: var(--accent-color-10);
  color: var(--primary-color);
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--accent-color-30);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.site-tag:hover {
  background: var(--accent-color-30);
  transform: translateY(-1px);
}

/* Tooltip styles */
.site-tag[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-color);
  color: var(--gray-1);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: tooltipFadeIn 0.2s ease-in-out;
}



@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.site-actions {
  text-align: center;
  margin-top: auto;
  padding-top: 1rem;
}

.visit-site-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--anchor-color);
  color: var(--gray-1);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.visit-site-btn:hover {
  background: var(--primary-color);
  transform: translateY(-1px);
  color: var(--gray-1);
  text-decoration: none;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--primary-color);
}

.no-results-icon {
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.no-results h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.no-results p {
  margin-bottom: 2rem;
  opacity: 0.7;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .directory-header h1 {
    font-size: 2rem;
  }

  .directory-stats {
    gap: 1rem;
  }

  .search-filter-section {
    padding: 1.5rem;
  }

  .filter-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

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

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

  .site-card {
    padding: 1rem;
  }

  .site-stats {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .directory-container {
    padding: 1rem 0;
  }

  .directory-header {
    padding: 1rem 0;
    margin-bottom: 2rem;
  }

  .directory-header h1 {
    font-size: 1.75rem;
  }

  .search-filter-section {
    padding: 1rem;
  }

  .site-card-header {
    flex-direction: column;
    text-align: center;
  }

  .site-icon {
    align-self: center;
  }
}