/* Category Search and Tag Styles */

/* Search Box Styles */
.search-box {
  position: relative;
  display: flex;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  overflow: hidden;
}

.search-box input {
  flex: 1;
  padding: 15px 20px;
  border: 1px solid #e9ecef;
  border-right: none;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s ease;
  border-radius: 8px 0 0 8px;
}

.search-box input:focus {
  border-color: #007bff;
}

.search-box input.highlight {
  animation: highlight 1s ease;
}

.search-box button {
  padding: 0 25px;
  background-color: #007bff;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border-radius: 0 8px 8px 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box button:hover {
  background-color: #0069d9;
}

.search-box button:disabled {
  background-color: #6c757d;
  cursor: wait;
}

.search-box button i {
  font-size: 14px;
}

/* Search Suggestions */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e9ecef;
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 100;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.suggestion-item:hover {
  background-color: #f0f7ff;
}

.suggestion-item:not(:last-child) {
  border-bottom: 1px solid #f1f1f1;
}

/* Popular Searches / Tag Cloud */
.popular-searches {
  margin-top: 25px;
}

.popular-searches h3 {
  font-size: 1.1rem;
  color: #343a40;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.popular-searches h3::before {
  content: '\f02c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-right: 8px;
  color: #007bff;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 50px;
}

.tags-loading {
  display: flex;
  align-items: center;
  color: #6c757d;
  font-size: 0.9rem;
}

.tags-loading i {
  margin-right: 8px;
  color: #007bff;
}

.tag {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  background-color: #f0f7ff;
  color: #0056b3;
  border-radius: 20px;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #b8daff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-weight: 500;
}

.tag:hover {
  background-color: #007bff;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0, 123, 255, 0.2);
}

.tag:hover .tag-count {
  background-color: rgba(255, 255, 255, 0.3);
}

.tag:active {
  transform: translateY(0);
}

.tag-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 123, 255, 0.1);
  font-size: 0.75rem;
  border-radius: 10px;
  padding: 2px 8px;
  margin-left: 8px;
  min-width: 24px;
  height: 20px;
  transition: background-color 0.2s ease;
  font-weight: 600;
}

/* Search Results */
.search-results-container {
  margin-top: 40px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  padding: 25px;
  animation: fadeIn 0.5s ease;
}

.results-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e9ecef;
}

.results-header h2 {
  font-size: 1.5rem;
  color: #343a40;
  margin-bottom: 5px;
}

.results-header p {
  color: #6c757d;
  font-size: 0.9rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.result-card {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-color: #b8daff;
}

.result-icon {
  width: 60px;
  height: 60px;
  background-color: #007bff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.result-icon i {
  color: white;
  font-size: 24px;
}

.result-card h3 {
  font-size: 1.2rem;
  color: #343a40;
  margin-bottom: 5px;
  text-align: center;
}

.result-card p {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.result-link {
  padding: 8px 20px;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
  margin-top: auto;
}

.result-link:hover {
  background-color: #0069d9;
}

/* No Results Message */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.no-results i {
  font-size: 3rem;
  color: #6c757d;
  margin-bottom: 15px;
}

.no-results h3 {
  font-size: 1.2rem;
  color: #343a40;
  margin-bottom: 10px;
}

.no-results p {
  color: #6c757d;
}

/* Sample data notice */
.sample-data-notice {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  width: 100%;
}

.sample-data-notice i {
  margin-right: 8px;
  font-size: 1rem;
}

.no-tags-message {
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 4px;
  color: #6c757d;
  text-align: center;
  width: 100%;
}

/* Animations */
@keyframes highlight {
  0% { background-color: #fff; }
  30% { background-color: #ffecb5; }
  100% { background-color: #fff; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive styles */
@media (max-width: 768px) {
  .search-box {
    flex-direction: column;
  }
  
  .search-box input {
    border-right: 1px solid #e9ecef;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
  }
  
  .search-box button {
    border-radius: 0 0 8px 8px;
    padding: 12px;
    width: 100%;
    justify-content: center;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .result-card {
    max-width: none;
  }
} 