/* ==========================================================================
   CLASSIC MAP SEARCH COMPONENT (CYBER INTEGRATED)
   Строка поиска на карте с кнопкой в утверждённом кибер-корпусе Главной
   Поддержка 4 языков: RU, EN, VI, ZH
   ========================================================================== */

:root {
  --classic-search-cyan: #00f0ff;
  --classic-search-cyan-dim: rgba(0, 240, 255, 0.45);
  --classic-search-cyan-glow: 0 0 16px rgba(0, 240, 255, 0.6);
  --classic-search-bg-dark: rgba(9, 24, 36, 0.96);
}

/* Раскрывающаяся строка поиска (расположена прямо под верхней панелью) */
.classic-search-bar {
  position: fixed;
  top: calc(var(--safe-top, 0px) + 58px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 1001;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  display: flex;
  align-items: center;
  width: clamp(280px, calc(100vw - 28px), 420px);
  height: 44px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(16, 42, 60, 0.98) 0%, rgba(9, 24, 36, 0.99) 100%);
  border: 1.5px solid var(--classic-search-cyan);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 240, 255, 0.5), inset 0 0 10px rgba(0, 240, 255, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0 10px 0 14px;
  gap: 8px;
  box-sizing: border-box;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.25, 0.64, 1), visibility 0.22s ease;
  user-select: none;
  -webkit-user-select: none;
}

.classic-search-bar.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Иконка лупы внутри строки (кнопка действия) */
.classic-search-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--classic-search-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  outline: none;
  transition: transform 0.18s ease;
}

.classic-search-action-btn:hover {
  transform: scale(1.1);
}

.classic-search-action-btn:active {
  transform: scale(0.92);
}

.classic-search-icon-svg {
  width: 20px;
  height: 20px;
  stroke: var(--classic-search-cyan);
  filter: drop-shadow(0 0 4px var(--classic-search-cyan));
  display: block;
  pointer-events: none;
}

/* Текстовое поле ввода */
.classic-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0.2px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  user-select: text;
  -webkit-user-select: text;
}

.classic-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

/* Кнопка быстрой очистки текста */
.classic-search-clear-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  outline: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.classic-search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.classic-search-clear-btn:active {
  transform: scale(0.92);
}

.classic-search-clear-btn.is-hidden {
  display: none !important;
}

/* Разделитель */
.classic-search-divider {
  width: 1px;
  height: 20px;
  background: rgba(0, 240, 255, 0.35);
  flex-shrink: 0;
}

/* Кнопка закрытия строки */
.classic-search-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  outline: none;
  transition: color 0.18s ease, transform 0.18s ease;
}

.classic-search-close-btn:hover {
  color: var(--classic-search-cyan);
  transform: scale(1.1);
}

.classic-search-close-btn:active {
  transform: scale(0.92);
}

/* Подсветка активной кнопки поиска в верхней панели */
.top-control--search.is-active .top-control__visual {
  border-color: #00f0ff !important;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.85), inset 0 0 8px rgba(0, 240, 255, 0.4) !important;
  transform: scale(1.04);
}

/* Мобильная адаптивность */
@media (max-width: 480px) {
  .classic-search-bar {
    top: calc(var(--safe-top, 0px) + 52px);
    width: calc(100vw - 16px);
    height: 40px;
    padding: 0 8px 0 12px;
    gap: 6px;
  }
  .classic-search-input {
    font-size: 13.5px;
  }
  .classic-search-action-btn,
  .classic-search-close-btn {
    width: 24px;
    height: 24px;
  }
  .classic-search-icon-svg {
    width: 18px;
    height: 18px;
  }
}
