/* 검색창 wrapper - 위치는 페이지에서 조절 */
.global-search-wrap {
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 50;
}

/* 검색창 스타일 (index 그대로) */
.global-search-input {
  width: min(520px, 100%);
  max-width: 100%;
  padding: 14px 20px;
  font-size: 18px;
  background: #11141c;
  border: 2px solid #2a2f3a;
  border-radius: 12px;
  transition: all 0.25s ease;
  color: #e5e7eb;
}
.global-search-input:focus {
  width: min(520px, 100%);
  background: #171c26;
  border-color: #4ea9ff;
  outline: none;
}

/* ============================
   🔥 검색 패널 전체 스크롤 적용
=============================== */
.global-search-panel {
  position: absolute;
  top: 60px;
  width: min(520px, calc(100vw - 32px));
  max-width: 100%;

  left: 50%;
  transform: translateX(-50%);

  background: #0f1218;
  border: 1px solid #2f3542;
  border-radius: 12px;
  padding: 14px;

  opacity: 0;
  pointer-events: none;

  transform: translate(-50%, -6px);
  transition: all 0.18s ease;

  /* 스크롤 */
  max-height: 420px;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .global-search-wrap {
    padding: 0 12px;
  }

  .global-search-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
  }

  .global-search-input:focus {
    width: 100%;
  }

  .global-search-panel {
    top: 56px;
    width: calc(100vw - 24px);
    padding: 12px;
  }
}

/* 나타나는 애니메이션 */
.global-search-panel.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* 스크롤바 디자인 */
.global-search-panel::-webkit-scrollbar {
  width: 6px;
}
.global-search-panel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
}
.global-search-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}

/* 제목 행 */
.title-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #8892a5;
  margin-bottom: 6px;
}

/* 리스트 */
.search-section div {
  padding: 5px 4px;
  border-radius: 6px;
  cursor: pointer;
}
.search-section div:hover {
  background: rgba(255,255,255,0.06);
}

/* 자동완성 항목 */
.search-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
}
.search-item:hover {
  background: rgba(255,255,255,0.06);
}

.search-item img {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.filter-dictionary {
  text-align: left;
}

.filter-head {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-field.full {
  grid-column: 1 / -1;
}

.filter-field label {
  font-size: 13px;
  color: #93a2bc;
  font-weight: 600;
}

.filter-field input {
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.7);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  padding: 10px 12px;
  outline: none;
  transition: 0.2s ease;
}

.filter-field input:focus {
  border-color: #4ea9ff;
  box-shadow: 0 0 0 3px rgba(78, 169, 255, 0.2);
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid rgba(78, 169, 255, 0.35);
  background: rgba(30, 41, 59, 0.5);
  color: #bfdbfe;
  font-size: 13px;
  padding: 6px 11px;
  border-radius: 999px;
  transition: all 0.18s ease;
}

.filter-chip:hover {
  border-color: rgba(125, 211, 252, 0.8);
  color: #e0f2fe;
  background: rgba(14, 116, 144, 0.35);
  transform: translateY(-1px);
}

.filter-chip.active {
  border-color: #7dd3fc;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.45), rgba(30, 64, 175, 0.4));
  color: #f0f9ff;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.18);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 640px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.search-item.is-active {
  background: rgba(78, 169, 255, 0.2);
  outline: 1px solid rgba(78, 169, 255, 0.5);
}

.search-empty,
.search-meta-empty {
  color: #8b98ad;
  font-size: 13px;
  padding: 8px 4px;
}

.search-keyword-btn {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
  padding: 5px 4px;
  border-radius: 6px;
}

.search-keyword-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.search-favorite-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-favorite-item-btn {
  flex: 1;
}

.search-favorite-remove-btn,
.search-favorite-btn {
  border: 0;
  background: transparent;
  color: #d5d9e2;
  cursor: pointer;
}

.search-favorite-remove-btn:hover,
.search-favorite-btn:hover {
  color: #ffffff;
}
