/*
 * saxliko.ge homepage: "AI ძებნა" (assets/js/copilot.js). On the dark hero: a glass field inside
 * a slowly turning gradient ring; while the AI reads, the ring spins faster.
 */
@property --cp-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.copilot { position: relative; max-width: 1080px; margin: 0 0 14px; }
.copilot__ring {
  position: relative; padding: 2px; border-radius: 22px;
  background: conic-gradient(from var(--cp-angle), #5B8CFF, #A78BFA, #F472B6, #FDB022, #34D399, #5B8CFF);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 18px 50px -18px rgba(91, 140, 255, .75), 0 0 46px -12px rgba(167, 139, 250, .6);
  animation: cp-spin 8s linear infinite;
}
.copilot__ring::before {   /* the glow behind */
  content: ""; position: absolute; inset: -6px; z-index: -1; border-radius: 28px;
  background: inherit; filter: blur(18px); opacity: .45;
}
@keyframes cp-spin { to { --cp-angle: 360deg; } }
.copilot.is-busy .copilot__ring { animation-duration: 1.4s; }

.copilot__box { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 8px 8px 14px; border-radius: 20px; background: rgba(9, 18, 38, .88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.copilot__ai { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; background: linear-gradient(135deg, rgba(91, 140, 255, .25), rgba(244, 114, 182, .25)); border: 1px solid rgba(255, 255, 255, .14); color: #fff; font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.copilot__ai svg { width: 15px; height: 15px; fill: #FDE68A; }
.copilot__input { flex: 1; min-width: 0; height: 48px; padding: 0 4px; border: 0; background: transparent; color: #fff; font: inherit; font-size: 1.02rem; outline: none; }
.copilot__input::placeholder { color: rgba(255, 255, 255, .55); }
.copilot__input:read-only { opacity: .8; }
.copilot__go {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 15px;
  background: linear-gradient(135deg, #6D8BFF 0%, #A855F7 55%, #EC4899 100%); color: #fff; font: inherit; font-size: .95rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(168, 85, 247, .9), inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform .15s, box-shadow .15s, filter .15s;
}
.copilot__go:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 14px 30px -10px rgba(168, 85, 247, 1); }
.copilot__go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.copilot__go svg { width: 19px; height: 19px; }
.copilot.is-busy .copilot__go svg { animation: cp-twinkle .9s ease-in-out infinite; }
@keyframes cp-twinkle { 50% { transform: scale(.75) rotate(25deg); opacity: .6; } }
.copilot.is-shake .copilot__ring { animation: cp-spin 8s linear infinite, cp-shake .35s; }
@keyframes cp-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.copilot__examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; font-size: .8rem; color: rgba(255, 255, 255, .7); }
.copilot__example { padding: 5px 11px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .9); font: inherit; font-size: .8rem; cursor: pointer; transition: background-color .15s, border-color .15s; }
.copilot__example:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); }

/* What the AI understood: chips appear one by one, then the search opens */
.copilot__panel { margin-top: 12px; padding: 14px 16px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 18px; background: rgba(9, 18, 38, .78); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; }
.copilot__panel[hidden] { display: none; }
.copilot__think { display: flex; align-items: center; gap: 10px; margin: 0; font-size: .9rem; color: rgba(255, 255, 255, .85); }
.copilot__dots { display: inline-flex; gap: 4px; }
.copilot__dots i { width: 7px; height: 7px; border-radius: 50%; background: #A78BFA; animation: cp-dot 1s ease-in-out infinite; }
.copilot__dots i:nth-child(2) { animation-delay: .15s; background: #F472B6; }
.copilot__dots i:nth-child(3) { animation-delay: .3s; background: #FDB022; }
@keyframes cp-dot { 50% { transform: translateY(-5px); opacity: .5; } }
.copilot__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; font-size: .84rem; font-weight: 700; color: rgba(255, 255, 255, .78); }
.copilot__src { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: .7rem; font-weight: 700; }
.copilot__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.copilot__chip { padding: 6px 12px; border-radius: 999px; background: linear-gradient(135deg, rgba(91, 140, 255, .35), rgba(168, 85, 247, .35)); border: 1px solid rgba(255, 255, 255, .2); font-size: .86rem; font-weight: 700; opacity: 0; transform: translateY(6px) scale(.96); animation: cp-chip .35s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 70ms); }
.copilot__chip--off { background: rgba(255, 255, 255, .06); border-style: dashed; color: rgba(255, 255, 255, .7); font-weight: 600; }
@keyframes cp-chip { to { opacity: 1; transform: none; } }
.copilot__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: .8rem; color: rgba(255, 255, 255, .7); }
.copilot__now { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 12px; background: #fff; color: #0E1A2B; font-weight: 800; text-decoration: none; }
.copilot__bar { flex: 1 1 120px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.copilot__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #A78BFA, #F472B6); animation: cp-go var(--go, 1.4s) linear forwards; }
@keyframes cp-go { to { width: 100%; } }

.copilot__or { display: flex; align-items: center; gap: 12px; max-width: 1080px; margin: 0 0 12px; font-size: .78rem; font-weight: 600; color: rgba(255, 255, 255, .6); }
.copilot__or::before, .copilot__or::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .14); }

@media (max-width: 560px) {
  .copilot__box { flex-wrap: wrap; padding: 10px; }
  .copilot__ai { order: 0; }
  .copilot__input { order: 1; flex: 1 1 calc(100% - 70px); height: 44px; font-size: 1rem; }
  .copilot__go { order: 2; flex: 1 1 100%; justify-content: center; }
  .copilot__example:nth-of-type(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .copilot__ring, .copilot.is-busy .copilot__ring, .copilot__dots i, .copilot.is-busy .copilot__go svg { animation: none; }
  .copilot__chip { animation: none; opacity: 1; transform: none; }
}
