/* ===================================
   GLOBAL SEARCH (Ctrl+K)
   Spotlight-style search modal
   =================================== */

.global-search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.global-search-modal.active {
  display: flex;
}

.global-search-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.global-search-container {
  position: relative;
  width: 90%;
  max-width: 640px;
  background: var(--dark-secondary);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideDown 0.3s ease;
  overflow: hidden;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.global-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.global-search-header .fa-search {
  color: var(--text-muted);
  font-size: 1.25rem;
}

.global-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 500;
}

.global-search-input::placeholder {
  color: var(--text-muted);
}

.global-search-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

kbd {
  display: inline-block;
  padding: 3px 8px;
  background: var(--dark-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.global-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.search-hint,
.search-loading,
.search-empty,
.search-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.search-hint i,
.search-loading i,
.search-empty i,
.search-error i {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.search-hint p,
.search-loading p,
.search-empty p,
.search-error p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.search-loading i {
  color: var(--primary-color);
  animation: spin 1s linear infinite;
}

.search-error i {
  color: var(--danger-color);
}

.search-category {
  margin-bottom: 20px;
}

.search-category-title {
  padding: 8px 24px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.search-result-item:hover,
.search-result-item.selected {
  background: var(--dark-tertiary);
  border-left-color: var(--primary-color);
}

.result-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 10px;
  color: white;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.result-content {
  flex: 1;
  min-width: 0;
}

.result-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-action {
  color: var(--text-muted);
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.search-result-item:hover .result-action,
.search-result-item.selected .result-action {
  opacity: 1;
}

.global-search-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--dark-bg);
}

.search-shortcuts {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-shortcuts span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .global-search-modal {
    padding-top: 5vh;
  }

  .global-search-container {
    width: 95%;
    max-height: 80vh;
  }

  .global-search-header {
    padding: 16px;
  }

  .global-search-input {
    font-size: 1rem;
  }

  .global-search-hint {
    display: none;
  }

  .search-result-item {
    padding: 12px 16px;
  }

  .result-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .search-shortcuts {
    flex-direction: column;
    gap: 8px;
  }
}
