/* Global search styles */
.global-search {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.global-search:not([hidden]) {
  display: flex;
}

.search-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.search-modal {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.98), rgba(30, 30, 30, 0.98));
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  outline: none;
  font-family: inherit;
}

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

.search-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-close:hover {
  background: var(--accent, #e10600);
  transform: scale(1.1);
}

.search-hint {
  padding: 12px 20px;
  background: rgba(225, 6, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  color: var(--muted, #bdbdbd);
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.search-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted, #bdbdbd);
}

.search-empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

.search-empty p {
  margin: 0;
  font-size: 1.1rem;
}

.search-section {
  margin-bottom: 24px;
}

.search-section:last-child {
  margin-bottom: 0;
}

.search-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent, #e10600);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.search-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent, #e10600);
  transform: translateX(4px);
}

.search-item-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.search-item-content {
  flex: 1;
  min-width: 0;
}

.search-item-title {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 2px;
}

.search-item-meta {
  color: var(--muted, #bdbdbd);
  font-size: 0.85rem;
}

/* Custom scrollbar */
.search-results::-webkit-scrollbar {
  width: 8px;
}

.search-results::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
  .search-modal {
    width: 95%;
    max-height: 80vh;
  }

  .search-header {
    padding: 16px;
  }

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

  .search-hint {
    padding: 10px 16px;
    font-size: 0.8rem;
  }

  .search-results {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .global-search {
    padding-top: 5vh;
  }

  .search-modal {
    max-height: 85vh;
  }

  .search-empty {
    padding: 40px 16px;
  }

  .search-empty-icon {
    font-size: 2.5rem;
  }
}