/* Advanced Search Styles */

.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-container {
  width: 100%;
  max-width: 700px;
  background: var(--card-bg, white);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.search-overlay.active .search-container {
  transform: translateY(0);
}

.search-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-icon {
  color: var(--text-muted-color, #666);
  font-size: 1.25rem;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.125rem;
  background: transparent;
  color: var(--text-color);
}

.search-input::placeholder {
  color: var(--text-muted-color, #999);
}

.search-close {
  background: transparent;
  border: none;
  color: var(--text-muted-color, #666);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.search-close:hover {
  background: var(--hover-bg, #f5f5f5);
  color: var(--text-color);
}

.search-results-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.search-stats {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted-color, #666);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-result-item {
  border-radius: 8px;
  transition: background 0.2s ease;
}

.search-result-item:hover {
  background: var(--hover-bg, #f5f5f5);
}

.search-result-link {
  display: block;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
}

.search-result-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--heading-color);
}

.search-result-title mark {
  background: #ffeb3b;
  color: #000;
  padding: 0 0.25rem;
  border-radius: 2px;
}

.search-result-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted-color, #666);
  margin-bottom: 0.5rem;
}

.search-result-meta i {
  margin-right: 0.25rem;
}

.search-result-excerpt {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.search-result-excerpt mark {
  background: #ffeb3b;
  color: #000;
  padding: 0 0.25rem;
  border-radius: 2px;
}

.search-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-result-tag {
  background: var(--tag-bg, #e3f2fd);
  color: var(--tag-color, #1976d2);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.search-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted-color, #666);
}

.search-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.search-empty p {
  font-size: 1rem;
}

.search-trigger {
  position: fixed;
  bottom: 5rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--btn-primary-bg, #2196F3);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 999;
}

.search-trigger:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
  .search-overlay {
    padding: 1rem;
  }

  .search-container {
    max-height: 90vh;
  }

  .search-header {
    padding: 1rem;
  }

  .search-input {
    font-size: 1rem;
  }

  .search-result-title {
    font-size: 1rem;
  }

  .search-trigger {
    bottom: 4rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .search-overlay {
    background: rgba(0, 0, 0, 0.9);
  }

  .search-result-title mark,
  .search-result-excerpt mark {
    background: #ffd54f;
    color: #000;
  }
}
