/**
 * 全站即時搜尋（Command Palette）樣式表
 */

/* 導覽列搜尋觸發鈕 */
.global-search-trigger {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  transition: all 0.2s ease;
  cursor: pointer;
}

.global-search-trigger:hover,
.global-search-trigger:focus {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
  color: #f8fafc;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.global-search-kbd {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.65rem;
  padding: 1px 5px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

/* 搜尋彈窗主體 (Modal) */
.global-search-modal .modal-content {
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.global-search-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.global-search-input {
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 1.15rem;
  font-weight: 500;
  width: 100%;
  outline: none !important;
  box-shadow: none !important;
}

.global-search-input::placeholder {
  color: #64748b;
  font-size: 1.05rem;
}

/* 分類篩選標籤列 */
.global-search-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: auto;
}

.global-search-tab {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 0.8rem;
  padding: 0.2rem 0.65rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.global-search-tab:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.global-search-tab.active {
  background: #3b82f6;
  color: #ffffff;
  font-weight: 600;
}

/* 搜尋結果列表 */
.global-search-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 0.5rem;
}

.global-search-results::-webkit-scrollbar {
  width: 6px;
}

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

.global-search-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #64748b;
  padding: 0.5rem 0.75rem 0.25rem;
  text-transform: uppercase;
}

.global-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #f8fafc;
  transition: background 0.15s ease, transform 0.1s ease;
  cursor: pointer;
}

.global-search-item:hover,
.global-search-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: #ffffff;
}

.global-search-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.global-search-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  object-fit: contain;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.global-search-item-info {
  min-width: 0;
}

.global-search-item-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search-item-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.global-search-item-action {
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.global-search-item:hover .global-search-item-action,
.global-search-item.active .global-search-item-action {
  color: #38bdf8;
}

/* 空狀態與載入中 */
.global-search-empty,
.global-search-loading {
  padding: 3rem 1.5rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* 底部提示列 */
.global-search-footer {
  padding: 0.6rem 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748b;
}

.global-search-hints {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.global-search-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
