/* ============================================
   Hero AI Assistant — glass search bar
   ============================================ */
.hero-ai-assistant-wrap {
  pointer-events: none;
}

.hero-ai-assistant-wrap .hero-ai-assistant,
.hero-ai-floater {
  pointer-events: all;
}

.hero-ai-assistant {
  max-width: 780px;
  margin: 0 auto;
}

.hero-ai-assistant__tagline {
  margin: 0 0 10px 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.hero-ai-assistant__form {
  width: 100%;
}

.hero-ai-assistant__bar {
  position: relative;
  border-radius: 999px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(255, 255, 255, 0.25) 45%,
    rgba(56, 189, 248, 0.55) 100%
  );
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hero-ai-assistant__bar:focus-within {
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.35),
    0 0 0 4px rgba(56, 189, 248, 0.22);
  transform: translateY(-1px);
}

.hero-ai-assistant__bar-inner {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 56px;
  padding: 5px 6px 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.hero-ai-assistant__chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0c4da3 0%, #1d8fe8 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 79, 168, 0.35);
}

.hero-ai-assistant__chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  line-height: 1;
}

.hero-ai-assistant__chip-icon .bi {
  display: block;
  line-height: 1;
}

.hero-ai-assistant__chip-label {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-ai-assistant__beta {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero-ai-assistant__divider {
  flex-shrink: 0;
  width: 1px;
  height: 28px;
  margin: 0 12px 0 10px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(4, 23, 49, 0.12) 50%,
    transparent 100%
  );
}

.hero-ai-assistant__input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.hero-ai-assistant__typewriter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  min-width: 0;
  padding-right: 4px;
  color: #6b7789;
  font-size: 0.9375rem;
  font-family: var(--font-family-base);
  line-height: 1.4;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-ai-assistant__typewriter.is-hidden {
  visibility: hidden;
}

.hero-ai-assistant__typewriter-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-ai-assistant__typewriter-cursor {
  flex-shrink: 0;
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 1px;
  background: #041731;
  animation: heroAiCursorBlink 0.95s step-end infinite;
}

@keyframes heroAiCursorBlink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.hero-ai-assistant__input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #041731;
  font-size: 0.9375rem;
  font-family: var(--font-family-base);
  line-height: 1.4;
}

.hero-ai-assistant__input::placeholder {
  color: #6b7789;
}

.hero-ai-assistant__input-wrap:has(.hero-ai-assistant__typewriter:not(.is-hidden)) .hero-ai-assistant__input::placeholder {
  color: transparent;
}

.hero-ai-assistant__submit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 8px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #f09814 0%, #e8780a 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(240, 152, 20, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-ai-assistant__submit:hover,
.hero-ai-assistant__submit:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(240, 152, 20, 0.5);
}

.hero-ai-assistant__submit:active {
  transform: scale(0.97);
}

.hero-ai-assistant__submit .bi {
  font-size: 1.2rem;
  line-height: 1;
}

.hero-ai-assistant__submit.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

/* Floating assistant widget */
.hero-ai-floater {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.hero-ai-floater__bubble {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 12px;
  background: #fff;
  color: #041731;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(4, 23, 49, 0.16);
  white-space: nowrap;
}

.hero-ai-floater__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0c4da3 0%, #1d8fe8 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(13, 79, 168, 0.35);
  transition: transform 0.25s ease;
}

.hero-ai-floater:hover .hero-ai-floater__avatar {
  transform: scale(1.06);
}

.hero-ai-floater__avatar .bi {
  font-size: 1.35rem;
}

@media (max-width: 991px) {
  .hero-ai-assistant {
    max-width: 100%;
  }

  .hero-ai-assistant__tagline {
    text-align: center;
    margin-bottom: 8px;
  }
}

@media (max-width: 767px) {
  .hero-ai-assistant {
    margin: 0;
    max-width: 100%;
    width: 100%;
  }

  .hero-ai-assistant__form {
    width: 100%;
    max-width: 100%;
  }

  .hero-ai-assistant__tagline {
    font-size: 0.75rem;
    color: var(--color-text-secondary, #6b7280);
    text-shadow: none;
    text-align: left;
    margin: 0 0 8px 2px;
  }

  .hero-ai-assistant__bar {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow:
      0 4px 16px rgba(0, 0, 0, 0.08),
      0 0 0 1px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease;
  }

  .hero-ai-assistant__bar:focus-within {
    transform: none;
    box-shadow:
      0 8px 22px rgba(0, 0, 0, 0.1),
      0 0 0 1px rgba(56, 189, 248, 0.35),
      0 0 0 4px rgba(56, 189, 248, 0.12);
  }

  .hero-ai-assistant__chip-icon {
    animation: homeMobileSparkle 2.8s ease-in-out infinite;
  }

  .hero-ai-assistant__bar-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    padding: 4px 4px 4px 4px;
    box-sizing: border-box;
    overflow: hidden;
  }

  .hero-ai-assistant__chip {
    flex: 0 0 auto;
    padding: 6px 10px;
    gap: 4px;
    max-width: none;
  }

  .hero-ai-assistant__chip-label {
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .hero-ai-assistant__beta {
    display: none;
  }

  .hero-ai-assistant__divider {
    display: none;
  }

  .hero-ai-assistant__input-wrap {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .hero-ai-assistant__typewriter {
    font-size: 0.75rem !important;
    line-height: 1.3;
  }

  .hero-ai-assistant__typewriter-cursor {
    height: 0.95em;
  }

  /* Override home_style.css mobile input[type="text"] { width: 90% } */
  .hero-ai-assistant__form .hero-ai-assistant__input[type="text"] {
    flex: 1 1 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0.75rem !important;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Override home_style.css mobile button[type="submit"] { width: 100% } */
  .hero-ai-assistant__form button.hero-ai-assistant__submit[type="submit"] {
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(240, 152, 20, 0.35) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  }

  .hero-ai-assistant__form button.hero-ai-assistant__submit[type="submit"]:active {
    transform: scale(0.92) !important;
  }

  .hero-ai-assistant__submit .bi {
    font-size: 1rem;
  }

  .hero-ai-floater {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .hero-slider-wrapper .hero-ai-assistant-wrap {
    top: clamp(28px, 4vw, 52px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-ai-assistant__bar,
  .hero-ai-assistant__submit,
  .hero-ai-floater__avatar {
    transition: none;
  }

  .hero-slider-wrapper .hero-ai-assistant-wrap,
  .hero-ai-assistant__chip-icon,
  .hero-ai-assistant__typewriter-cursor {
    animation: none !important;
  }

  .hero-ai-assistant__form button.hero-ai-assistant__submit[type="submit"]:active {
    transform: none !important;
  }
}
