/* ================================
   SEARCH RESULTS
   Live-Suche mit Dropdown-Ergebnissen
   ================================ */

/* Search Container */
.search-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 15px;
  pointer-events: auto;
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 1400;
}

.search-results.active {
  display: block;
  animation: slideDown 0.3s ease;
}

/* Search Result Item */
.search-result-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
  cursor: pointer;
}

.search-result-item:hover {
  background: var(--notification-hover-bg);
}

.search-result-item:last-child {
  border-bottom: none;
}

/* Result Avatar */
.result-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

/* Result Info */
.result-info {
  flex: 1;
  min-width: 0;
}

.result-username {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: 2px;
}

.result-username:hover {
  color: var(--primary-blue);
}

.result-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Follow Button */
.follow-button {
  padding: 6px 12px;
  border: 2px solid #007bff;
  border-radius: 20px;
  background: #007bff;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  white-space: nowrap;
}

.follow-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.follow-button.following {
  background: transparent;
  color: #007bff;
}

.follow-button.following:hover {
  background: #ffebee;
  border-color: #dc3545;
  color: #dc3545;
}

/* Slide Down Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* No Results Message */
.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Loading State */
.search-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}

.search-loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  .search-container {
    display: none;
  }
}

@media (max-width: 480px) {
  .search-results {
    max-height: 300px;
    border-radius: 8px;
  }
  
  .search-result-item {
    padding: 10px 12px;
  }
  
  .result-avatar {
    width: 35px;
    height: 35px;
  }
}

/* === DARK MODE === */
body.dark-mode .search-results {
  background: #1e293b;
  border: 1px solid #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .search-result-item {
  border-bottom-color: #334155;
}

body.dark-mode .search-result-item:hover {
  background: #334155;
}

body.dark-mode .result-avatar {
  border-color: #475569;
}

body.dark-mode .result-username {
  color: #e2e8f0;
}

body.dark-mode .result-username:hover {
  color: #1E88E5;
}

body.dark-mode .result-bio {
  color: #94a3b8;
}

body.dark-mode .follow-button {
  border-color: #1E88E5;
  background: #1E88E5;
}

body.dark-mode .follow-button:hover {
  box-shadow: 0 2px 4px rgba(30, 136, 229, 0.4);
}

body.dark-mode .follow-button.following {
  background: transparent;
  color: #1E88E5;
}

body.dark-mode .follow-button.following:hover {
  background: rgba(220, 53, 69, 0.1);
  border-color: #dc3545;
  color: #dc3545;
}

body.dark-mode .search-no-results,
body.dark-mode .search-loading {
  color: #94a3b8;
}
