/* =====================
   SEARCH SYSTEM - ENHANCED
   ===================== */

:root {
  --search-box-expanded-width: 280px;
  --search-highlight-color: rgba(230, 200, 255, 0.23);
  --search-suggestion-max-height: 400px;
}

/* Search Section */
.search-section {
  padding: 6rem 0;
  background-color: var(--dark-color);
  min-height: 70vh;
  position: relative;
}

.search-header {
  text-align: center;
  margin-bottom: 3rem;
}

.search-meta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 1.1rem;
  color: #aaa;
  flex-wrap: wrap;
}

.search-meta span {
  padding: 0.5rem 1.2rem;
  background-color: var(--gray-color);
  border-radius: 2rem;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.search-meta span:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Search Filter */
.search-filter {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.filter-group label {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.8);
}

.filter-group select {
  background-color: var(--gray-color);
  color: white;
  border: 1px solid var(--light-gray);
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  min-width: 200px;
  cursor: pointer;
  transition: all 0.3s ease;
  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='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1rem;
}

.filter-group select:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

/* Search Box */
.search-box {
  position: relative;
    width: 230px; /* Fixed width when always visible */
    height: 40px;
}

.search-box input {
  position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    padding: 0 40px 0 15px;
    border: 2px solid var(--primary-color);
    outline: none;
    background-color: var(--gray-color);
    color: white;
    border-radius: 30px;
    opacity: 1; /* Always visible */
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: text;
}

.search-box .fa-search {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  transform: translateY(-50%);
  color: white;
  cursor: pointer;
  z-index: 3;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.search-box.expanded .fa-search {
  right: 0.7rem;
  color: var(--primary-color);
}

/* Search Results */
.search-results {
  position: relative;
  min-height: 200px;
}

.no-results {
  text-align: center;
  padding: 4rem 0;
}

.no-results i {
  font-size: 3.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

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

.no-results p {
  color: #aaa;
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Highlight */
.highlight {
  background-color: var(--search-highlight-color);
  padding: 0 0.2rem;
  border-radius: 3px;
  font-weight: bold;
}

/* Loading State */
.search-loading {
  position: relative;
  min-height: 200px;
}

.search-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Search Suggestions */
.search-suggestions {
  position: absolute;
  top: calc(100% + 0.5rem);
  width: 100%;
  background: var(--gray-color);
  border-radius: 0 0 0.8rem 0.8rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  max-height: var(--search-suggestion-max-height);
  overflow-y: auto;
  border: 1px solid var(--light-gray);
  border-top: none;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
  animation: fadeIn 0.2s ease-out;
}

.suggestion {
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--text-color);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.suggestion:hover {
  background: rgba(138, 43, 226, 0.1);
}

.suggestion i {
  margin-right: 0.8rem;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.suggestion .match {
  font-weight: bold;
  color: var(--primary-color);
}

.suggestion-footer {
  padding: 0.6rem 1.2rem;
  color: #aaa;
  font-size: 0.85rem;
  border-top: 1px solid var(--light-gray);
  display: flex;
  align-items: center;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-0.5rem); }
  to { opacity: 1; transform: translateY(0); }
}