/* =================================
   XENYRA – SEARCH OVERLAY
   AI 2030 search interface
   ================================= */

.xen-search-overlay{
  position:fixed;
  inset:0;
  z-index:9500;
  display:none;
  align-items:flex-start;
  justify-content:center;
  padding:96px 24px 24px;
  background:
    radial-gradient(circle at 18% 10%, rgba(0,229,255,.16), transparent 32%),
    radial-gradient(circle at 82% 12%, rgba(176,38,255,.14), transparent 34%),
    rgba(5,7,13,.38);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}

.xen-search-overlay.is-open{
  display:flex;
}

.xen-search-panel{
  width:min(960px, 100%);
  border-radius:34px;
  background:rgba(255,255,255,.88);
  border:1px solid rgba(255,255,255,.78);
  box-shadow:
    0 34px 100px rgba(8,17,31,.24),
    inset 0 1px 0 rgba(255,255,255,.88);
  overflow:hidden;
  transform:translateY(-12px) scale(.98);
  opacity:0;
  animation:xenSearchIn .22s ease forwards;
}

@keyframes xenSearchIn{
  to{
    transform:translateY(0) scale(1);
    opacity:1;
  }
}


/* =================================
   SEARCH HEADER
   ================================= */

.xen-search-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:24px 28px 18px;
}

.xen-search-title{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.xen-search-title h3{
  margin:0;
  color:#123624;
  font-size:22px;
  font-weight:850;
  letter-spacing:-.03em;
}

.xen-search-ai{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.xen-search-ai .xenyra-combo{
  transform:scale(.92);
  transform-origin:left center;
  cursor:pointer;
  pointer-events:auto;
}

.xen-search-ai .xenyra-combo .xenyra-orb,
.xen-search-ai .xenyra-combo .xenyra-tag,
.xen-search-ai .xenyra-combo .xenyra-logo{
  pointer-events:none;
}

/* Search overlay top Xenyra AI uses same visual behaviour as global button */
.xen-search-ai .xenyra-combo:hover .xenyra-orb{
  transform:translateY(-1px) scale(1.06);
  filter:brightness(1.04);
  box-shadow:
    0 18px 42px rgba(0,0,0,.46),
    0 0 24px rgba(29,124,255,.22),
    0 0 0 1px rgba(255,255,255,.62);
}

.xen-search-ai .xenyra-combo:hover .xenyra-tag{
  background:#165c34;
  color:#ffffff;
  transform:translateY(-1px);
  box-shadow:0 14px 34px rgba(0,0,0,.36);
}

.xen-search-ai .xenyra-combo:hover .xenyra-logo{
  animation:xenyra-spin .62s ease-out both !important;
}

.xen-search-close{
  all:unset;
  width:46px;
  height:46px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  background:#ffffff;
  color:#123624;
  border:1px solid rgba(17,24,39,.08);
  box-shadow:0 14px 34px rgba(17,24,39,.12);
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    color .16s ease,
    background .16s ease;
}

.xen-search-close svg{
  width:22px;
  height:22px;
}

.xen-search-close:hover{
  transform:translateY(-1px) scale(1.03);
  color:#1267d8;
  background:#eefbf4;
  box-shadow:0 20px 44px rgba(17,24,39,.16);
}


/* =================================
   SEARCH BODY
   ================================= */

.xen-search-body{
  padding:0 28px 26px;
}

.xen-search-box{
  display:grid;
  grid-template-columns:auto 1fr auto auto auto;
  align-items:center;
  gap:10px;
  padding:14px 16px 14px 18px;
  border-radius:28px;
  background:#ffffff;
  border:2px solid rgba(18,103,216,.14);
  box-shadow:
    0 18px 54px rgba(17,24,39,.10),
    0 0 0 7px rgba(29,124,255,.035);
  transition:
    border-color .16s ease,
    box-shadow .16s ease;
}

.xen-search-box:focus-within{
  border-color:rgba(0,229,255,.40);
  box-shadow:
    0 22px 70px rgba(17,24,39,.14),
    0 0 0 8px rgba(0,229,255,.08);
}

.xen-search-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#5b6475;
}

.xen-search-icon svg{
  width:21px;
  height:21px;
}

.xen-search-input{
  width:100%;
  min-width:0;
  border:0;
  outline:0;
  background:transparent;
  color:#08111f;
  font-size:22px;
  font-weight:750;
  letter-spacing:-.02em;
}

.xen-search-input::placeholder{
  color:rgba(17,24,39,.48);
}


/* =================================
   SEARCH ACTION ICONS
   Clean small controls
   ================================= */

.xen-search-clear,
.xen-search-mic,
.xen-search-submit{
  all:unset;
  width:38px;
  height:38px;
  min-width:38px;
  min-height:38px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-sizing:border-box;
  transition:
    background .16s ease,
    border-color .16s ease,
    transform .16s ease,
    color .16s ease,
    box-shadow .16s ease,
    opacity .16s ease;
}

.xen-search-clear svg,
.xen-search-mic svg,
.xen-search-submit svg{
  width:19px;
  height:19px;
  display:block;
}


/* X clear button – invisible until input has text */
.xen-search-clear{
  display:none;
  background:transparent;
  border:1px solid transparent;
  color:#526071;
  opacity:.72;
}

.xen-search-clear.is-visible{
  display:inline-flex;
}

.xen-search-clear:hover{
  background:rgba(236,253,245,.92);
  border-color:rgba(20,83,45,.14);
  color:#1267d8;
  opacity:1;
  transform:translateY(-1px);
  box-shadow:0 10px 28px rgba(17,24,39,.08);
}


/* Microphone – clean by default, soft circle only on hover */
.xen-search-mic{
  background:transparent;
  border:1px solid transparent;
  color:#14532d;
}

.xen-search-mic:hover{
  background:rgba(236,253,245,.92);
  border-color:rgba(20,83,45,.14);
  color:#1267d8;
  transform:translateY(-1px);
  box-shadow:0 10px 28px rgba(17,24,39,.08);
}


/* Submit arrow – clean by default */
.xen-search-submit{
  background:transparent;
  border:1px solid transparent;
  color:#123624;
}

.xen-search-submit:hover{
  background:rgba(236,253,245,.82);
  border-color:rgba(20,83,45,.14);
  color:#1267d8;
  transform:translateY(-1px);
  box-shadow:0 10px 28px rgba(17,24,39,.08);
}


/* =================================
   SUGGESTIONS
   ================================= */

.xen-search-suggestions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:18px;
  color:#5b6475;
  font-size:15px;
  font-weight:750;
}

.xen-search-suggestions span{
  margin-right:2px;
}

.xen-search-chip{
  all:unset;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:30px;
  padding:0 13px;
  border-radius:999px;
  cursor:pointer;
  background:rgba(255,255,255,.74);
  border:1px solid rgba(20,83,45,.12);
  color:#526071;
  font-size:14px;
  font-weight:750;
  box-shadow:0 8px 24px rgba(17,24,39,.05);
  transition:
    transform .16s ease,
    background .16s ease,
    color .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

.xen-search-chip:hover{
  transform:translateY(-1px);
  background:#eefbf4;
  color:#14532d;
  border-color:rgba(20,83,45,.22);
  box-shadow:0 12px 28px rgba(17,24,39,.08);
}


/* =================================
   SEARCH STATUS / THINKING
   ================================= */

.xen-search-status{
  margin-top:16px;
  min-height:22px;
  color:#526071;
  font-size:14px;
  font-weight:700;
}

.xen-search-status.is-thinking::before{
  content:"";
  display:inline-block;
  width:8px;
  height:8px;
  margin-right:8px;
  border-radius:999px;
  background:linear-gradient(90deg,#00e5ff,#1d7cff,#b026ff);
  box-shadow:0 0 18px rgba(29,124,255,.55);
  animation:xenThinkingPulse .9s ease-in-out infinite;
}

@keyframes xenThinkingPulse{
  0%,100%{
    transform:scale(.8);
    opacity:.55;
  }

  50%{
    transform:scale(1.25);
    opacity:1;
  }
}


/* =================================
   SEARCH FALLBACK TO XENYRA AI
   Uses global Xenyra AI button system in mini size
   ================================= */

.xen-search-fallback{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  color:#526071;
  font-size:14px;
  font-weight:750;
}

/* Same button system as header, only scaled smaller */
.xen-search-ask-ai{
  transform:scale(.82);
  transform-origin:left center;
}

/* Keep fallback button scaled while global hover animates inner parts */
.xen-search-ask-ai:hover{
  transform:scale(.82);
}

/* Mini orb only for search fallback */
.xen-search-mini-orb{
  width:28px !important;
  height:28px !important;
  min-width:28px !important;
  min-height:28px !important;
}

/* Mini X logo only for search fallback */
.xen-search-mini-orb .xenyra-logo{
  width:19px !important;
  height:19px !important;
}

/* Mini tag only for search fallback */
.xen-search-mini-tag{
  min-height:24px !important;
  padding:2px 10px 3px !important;
  font-size:10px !important;
  letter-spacing:.12em !important;
}


/* =================================
   BODY LOCK WHEN SEARCH IS OPEN
   ================================= */

body.xen-search-open{
  overflow:hidden;
}


/* =================================
   MOBILE
   ================================= */

@media (max-width:720px){
  .xen-search-overlay{
    padding:76px 14px 18px;
  }

  .xen-search-panel{
    border-radius:26px;
  }

  .xen-search-head{
    padding:20px 18px 14px;
  }

  .xen-search-title{
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
  }

  .xen-search-title h3{
    font-size:20px;
  }

  .xen-search-body{
    padding:0 18px 20px;
  }

  .xen-search-box{
    grid-template-columns:auto 1fr auto auto;
    gap:7px;
    padding:12px 12px 12px 14px;
    border-radius:24px;
  }

  .xen-search-input{
    font-size:17px;
  }

  .xen-search-clear,
  .xen-search-mic,
  .xen-search-submit{
    width:34px;
    height:34px;
    min-width:34px;
    min-height:34px;
  }

  .xen-search-clear svg,
  .xen-search-mic svg,
  .xen-search-submit svg{
    width:17px;
    height:17px;
  }

  .xen-search-mic{
    display:none;
  }

  .xen-search-suggestions{
    gap:8px;
    font-size:14px;
  }

  .xen-search-chip{
    min-height:28px;
    padding:0 11px;
    font-size:13px;
  }
}

@media (max-width:460px){
  .xen-search-head{
    gap:12px;
  }

  .xen-search-ai .xenyra-combo{
    transform:scale(.84);
  }

  .xen-search-close{
    width:42px;
    height:42px;
  }

  .xen-search-box{
    grid-template-columns:auto 1fr auto auto;
  }
}