/* =========================================================
   PHYSIODOC — RECHERCHE INSTANTANÉE DES FORMATIONS
   ========================================================= */

:root {
  --pd-search-width: min(550px, calc(100vw - 40px));
  --pd-search-bg: rgba(67, 67, 64, 0.62);
  --pd-search-border: rgba(255, 255, 255, 0.18);
  --pd-search-line: rgba(255, 255, 255, 0.42);
  --pd-search-text: #fff;
  --pd-search-muted: rgba(255, 255, 255, 0.45);
  --pd-search-radius: 42px;
}

.pd-chain__item.is-search {
  position: relative;
  z-index: 20;
  overflow: visible !important;
  cursor: pointer;
}

.pd-chain__item.is-search > svg {
  position: relative;
  z-index: 4;
  pointer-events: none;
}

.pd-live-search {
  --pd-search-open-width: var(--pd-search-width);

  position: absolute;
  z-index: 3;
  top: -23px;
  right: 0;
  width: var(--pd-chain-height, 64px);
  max-width: var(--pd-search-open-width);
  max-height: var(--pd-chain-height, 64px);
  overflow: hidden;
  color: var(--pd-search-text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  border: 1px solid transparent;
  border-radius: calc(var(--pd-chain-height, 64px) / 2);
  background: transparent;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transform-origin: top right;
  transition:
    width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.16s ease,
    border-color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.3s ease,
    visibility 0s linear 0.34s;
}

.pd-live-search.is-open {
  width: var(--pd-search-open-width);
  max-height: 360px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  border-color: var(--pd-search-border);
  background: var(--pd-search-bg);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(17px);
  backdrop-filter: blur(17px);
  transition:
    width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.12s ease,
    border-color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.3s ease,
    visibility 0s;
}

.pd-live-search__panel {
  position: relative;
  width: var(--pd-search-open-width);
  padding: 0 34px 30px;
}

.pd-live-search__form {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--pd-chain-height, 64px);
  padding-right: 62px;
  border-bottom: 2px solid var(--pd-search-line);
}

.pd-live-search__input {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--pd-search-text);
  background: transparent;
  box-shadow: none;
  font: inherit;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

.pd-live-search__input::-webkit-search-cancel-button {
  display: none;
}

.pd-live-search__input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.pd-live-search__results {
  display: block;
}

.pd-live-search__result {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 13px 10px 11px;
  border-bottom: 1px solid var(--pd-search-line);
  color: var(--pd-search-text);
  font-size: 14px;
  line-height: 1 !important;
  text-decoration: none;
  transition: padding-left 0.22s ease, background-color 0.22s ease;
}

.pd-live-search__result:last-child {
  border-bottom: 0;
}

.pd-live-search__result:hover,
.pd-live-search__result:focus,
.pd-live-search__result.is-active {
  padding-left: 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.07);
}

.pd-live-search__type {
  flex: none;
  font-weight: 600;
}

.pd-live-search__title {
  color: var(--pd-search-muted);
}

.pd-live-search__message {
  display: none;
  padding-top: 18px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

.pd-live-search__message.is-visible {
  display: block;
}

.pd-chain__item.is-search:has(.pd-live-search.is-loading) > svg {
  animation: pd-search-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes pd-search-pulse {
  to { opacity: 0.42; }
}

@media (max-width: 767px) {
  :root {
    --pd-search-width: calc(100vw - 24px);
    --pd-search-radius: 28px;
  }

  .pd-live-search {
    position: fixed;
    top: 76px;
    right: 12px;
    width: var(--pd-chain-height, 64px);
  }

  .pd-live-search.is-open {
    width: calc(100vw - 24px);
  }

  .pd-live-search__panel {
    padding: 20px 22px 24px;
  }

  .pd-live-search__form {
    padding-right: 48px;
  }

  .pd-live-search__input {
    height: 48px;
    font-size: 22px;
  }

  .pd-live-search__result {
    flex-direction: column;
    gap: 3px;
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pd-live-search,
  .pd-live-search__result {
    transition-duration: 0.01ms !important;
  }
}

