/* Search Styles */
.search-item {
  display: flex;
  align-items: center;
  margin-left: 15px;
}

#search-toggle {
  background: none;
  border: none;
  color: var(--secondary-color);
  font-size: 1.2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#search-toggle::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
  z-index: -1;
}

#search-toggle:hover {
  color: white;
}

#search-toggle:hover::before {
  opacity: 1;
  transform: scale(1);
}

.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  backdrop-filter: blur(5px);
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-container {
  width: 90%;
  max-width: 800px;
  background-color: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  transition-delay: 0.1s;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.search-overlay.active .search-container {
  transform: translateY(0);
  opacity: 1;
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.search-header h2 {
  margin: 0;
  color: var(--secondary-color);
  font-size: 1.8rem;
  font-weight: 600;
}

#search-close {
  background: none;
  border: none;
  color: var(--secondary-color);
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#search-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.search-form-container {
  margin-bottom: 20px;
}

.search-form {
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 15px;
  font-size: 1.2rem;
  color: var(--primary-color);
}

#search-input {
  width: 100%;
  padding: 15px 50px 15px 45px;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  background: var(--neutral-gradient);
}

#search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.clear-search {
  position: absolute;
  right: 15px;
  background: none;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  display: none;
  transition: all 0.3s ease;
}

.clear-search.visible {
  display: block;
}

.clear-search:hover {
  color: var(--secondary-color);
}

.search-results-container {
  overflow-y: auto;
  flex: 1;
  padding-right: 5px;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.search-result-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.search-result-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.search-result-image {
  height: 160px;
  overflow: hidden;
  position: relative;
}

.search-result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
}

.search-result-card:hover .search-result-image img {
  transform: scale(1.05);
}

.search-result-content {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.search-result-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--secondary-color);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-excerpt {
  font-size: 0.9rem;
  color: #718096;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.search-result-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #a0aec0;
}

.search-result-category {
  background: var(--primary-gradient);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.search-result-date {
  display: flex;
  align-items: center;
}

.search-result-date i {
  margin-right: 4px;
}

.no-results, .search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  text-align: center;
  color: #718096;
}

.no-results i, .search-loading i {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Highlight search matches */
.highlight {
  background-color: rgba(245, 158, 11, 0.3);
  padding: 0 3px;
  border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-container {
    padding: 20px;
  }
  
  .search-header h2 {
    font-size: 1.5rem;
  }
  
  #search-input {
    padding: 12px 45px 12px 40px;
    font-size: 1rem;
  }
  
  .search-results {
    grid-template-columns: 1fr;
  }
} 