/* Tektyum · AI chat support widget (ice system, self-contained: no en.css dependency
   so it also works on /proiecte/). z: 60 · under gate 70 / preloader 300 / wipe 900. */

.tk-chat, .tk-chat * { margin: 0; padding: 0; box-sizing: border-box; }
.tk-chat {
  --c-ink: #030509;
  --c-text: #EAF4FA;
  --c-dim: #8FA1AC;
  --c-faint: #5e6b74;
  --c-lilac: #c9d8e2;
  --c-hot: #bfe0f5;
  --c-hairline: rgba(210, 235, 248, 0.12);
  --c-hairline-2: rgba(210, 235, 248, 0.22);
  --c-glow: rgba(185, 225, 248, 0.5);
  --c-ease: cubic-bezier(0.16, 1, 0.3, 1);
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  font-family: "Geist", system-ui, -apple-system, sans-serif;
  pointer-events: none; /* children re-enable */
}

/* ---------- launcher orb ---------- */
.tk-launch {
  pointer-events: auto;
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(4, 7, 12, 0.78);
  backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid var(--c-hairline-2);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s var(--c-ease), border-color 0.3s var(--c-ease);
  animation: tk-in 0.8s var(--c-ease) 1.1s backwards;
}
@keyframes tk-in { from { transform: translateY(26px); opacity: 0; } }
.tk-launch:hover { transform: scale(1.08); border-color: rgba(210, 235, 248, 0.5); }
.tk-launch:active { transform: scale(0.94); }
.tk-launch:focus-visible { outline: 2px solid var(--c-hot); outline-offset: 4px; }

/* traveling ice ring: same signature as the pill / card trace */
.tk-ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); pointer-events: none; overflow: visible; }
.tk-ring circle {
  fill: none; stroke: rgba(191, 224, 245, 0.55); stroke-width: 1.2;
  stroke-dasharray: 20 80; opacity: 0.4;
  filter: drop-shadow(0 0 5px rgba(185, 225, 248, 0.5));
  transition: opacity 0.4s var(--c-ease), filter 0.4s var(--c-ease);
}
.tk-launch:hover .tk-ring circle, .tk-chat.is-open .tk-ring circle {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(185, 225, 248, 0.9)) drop-shadow(0 0 22px rgba(185, 225, 248, 0.35));
}

/* bubble glyph <-> close cross */
.tk-ic { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity 0.3s var(--c-ease), transform 0.4s var(--c-ease); }
.tk-ic svg { display: block; }
.tk-ic--x { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.tk-chat.is-open .tk-ic--bubble { opacity: 0; transform: rotate(90deg) scale(0.5); }
.tk-chat.is-open .tk-ic--x { opacity: 1; transform: rotate(0deg) scale(1); }

/* online dot */
.tk-dot {
  position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--c-hot); border: 2px solid #05070d;
  box-shadow: 0 0 9px rgba(185, 225, 248, 0.9);
  animation: tk-pulse 2.6s ease-in-out infinite;
}
@keyframes tk-pulse { 50% { box-shadow: 0 0 3px rgba(185, 225, 248, 0.4); } }

/* ---------- teaser bubble (once per session) ---------- */
.tk-tease {
  pointer-events: auto;
  position: absolute; right: 68px; bottom: 8px; white-space: nowrap;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px 12px 4px 12px;
  background: rgba(4, 7, 12, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--c-hairline-2); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  color: var(--c-text); font-size: 0.86rem; cursor: pointer;
  opacity: 0; transform: translateY(8px); visibility: hidden;
  transition: opacity 0.5s var(--c-ease), transform 0.5s var(--c-ease), visibility 0s linear 0.5s;
}
.tk-tease.show { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.tk-tease b { font-weight: 600; color: #fff; }
.tk-tease .tk-tease-x {
  display: grid; place-items: center; width: 18px; height: 18px; border: 0; background: none;
  color: var(--c-faint); cursor: pointer; font-size: 0.9rem; line-height: 1; border-radius: 50%;
  font-family: inherit; transition: color 0.25s var(--c-ease);
}
.tk-tease .tk-tease-x:hover { color: var(--c-text); }

/* ---------- panel ---------- */
.tk-panel {
  pointer-events: auto;
  position: absolute; right: 0; bottom: 70px;
  width: min(384px, calc(100vw - 40px));
  height: min(600px, calc(100dvh - 118px));
  display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden;
  background: rgba(4, 7, 12, 0.9);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid var(--c-hairline-2);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.65);
  transform-origin: 100% 100%;
  opacity: 0; transform: translateY(16px) scale(0.96); filter: blur(6px); visibility: hidden;
  transition: opacity 0.45s var(--c-ease), transform 0.55s cubic-bezier(0.26, 1.2, 0.4, 1),
    filter 0.45s var(--c-ease), visibility 0s linear 0.45s;
}
.tk-chat.is-open .tk-panel { opacity: 1; transform: none; filter: none; visibility: visible; transition-delay: 0s; }

/* holo scan sweep on open (WAAPI drives transform) */
.tk-scan {
  position: absolute; top: -6%; bottom: -6%; left: -2px; width: 2px; z-index: 5; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(234, 244, 250, 0.95) 25%, rgba(234, 244, 250, 0.95) 75%, transparent);
  filter: drop-shadow(0 0 10px rgba(185, 225, 248, 0.9)) drop-shadow(0 0 26px rgba(185, 225, 248, 0.4));
  opacity: 0; will-change: transform, opacity;
}

/* header */
.tk-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--c-hairline);
  background: linear-gradient(180deg, rgba(9, 14, 22, 0.55), rgba(4, 7, 12, 0));
  flex-shrink: 0;
}
.tk-ava {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid var(--c-hairline-2); background: rgba(3, 5, 9, 0.6);
}
.tk-ava svg { width: 15px; height: 22px; filter: drop-shadow(0 0 7px rgba(185, 225, 248, 0.4)); }
.tk-head-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tk-head-t strong {
  font-family: "Geist Mono", ui-monospace, monospace; font-weight: 500;
  font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--c-lilac);
}
.tk-head-t small { font-size: 0.76rem; color: var(--c-dim); display: flex; align-items: center; gap: 7px; }
.tk-head-t small::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c-hot);
  box-shadow: 0 0 8px rgba(185, 225, 248, 0.8); flex-shrink: 0;
}

/* messages */
.tk-msgs {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: rgba(210, 235, 248, 0.25) transparent;
}
.tk-m {
  max-width: 84%; padding: 10px 14px; border-radius: 14px;
  font-size: 0.9rem; line-height: 1.55; overflow-wrap: break-word;
}
.tk-m--ai {
  align-self: flex-start; color: #d9e7f0; border-top-left-radius: 4px;
  background: linear-gradient(180deg, rgba(9, 14, 22, 0.85), rgba(5, 8, 13, 0.7));
  border: 1px solid var(--c-hairline);
}
.tk-m--ai strong { color: #fff; font-weight: 600; }
.tk-m--ai a { color: var(--c-text); border-bottom: 1px solid rgba(210, 235, 248, 0.4); text-decoration: none; transition: color 0.25s var(--c-ease), border-color 0.25s var(--c-ease); }
.tk-m--ai a:hover { color: #fff; border-color: #fff; }
.tk-m--ai ul { list-style: none; margin: 6px 0 2px; display: grid; gap: 5px; }
.tk-m--ai li { position: relative; padding-left: 16px; }
.tk-m--ai li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 1.5px; background: var(--c-hot); transform: rotate(45deg); }
.tk-m--me {
  align-self: flex-end; border-top-right-radius: 4px;
  background: linear-gradient(#f2f8fc, #c9d8e2); color: #04121c; font-weight: 500;
}
.tk-m.tk-new { animation: tk-msg 0.5s var(--c-ease) backwards; }
@keyframes tk-msg { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } }

/* typing indicator */
.tk-typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px; }
.tk-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-hot); opacity: 0.35; animation: tk-ty 1.1s ease-in-out infinite; }
.tk-typing i:nth-child(2) { animation-delay: 0.18s; }
.tk-typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes tk-ty { 40% { opacity: 1; transform: translateY(-3px); } }

/* quick chips */
.tk-chips { display: flex; flex-wrap: wrap; gap: 7px; align-self: flex-start; max-width: 95%; animation: tk-msg 0.5s var(--c-ease) 0.1s backwards; }
.tk-chip {
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 0.68rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--c-lilac);
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--c-hairline-2);
  background: transparent; cursor: pointer;
  transition: border-color 0.3s var(--c-ease), background 0.3s var(--c-ease), color 0.3s var(--c-ease);
}
.tk-chip:hover, .tk-chip:focus-visible { border-color: rgba(210, 235, 248, 0.55); background: rgba(191, 224, 245, 0.07); color: #fff; outline: none; }

/* input row */
.tk-form { flex-shrink: 0; border-top: 1px solid var(--c-hairline); padding: 12px 12px 8px; display: flex; gap: 9px; align-items: center; }
.tk-input {
  flex: 1; min-width: 0; padding: 11px 16px; border-radius: 999px;
  background: rgba(3, 5, 9, 0.6); border: 1px solid var(--c-hairline-2);
  color: var(--c-text); font-family: inherit; font-size: 0.92rem;
  transition: border-color 0.25s var(--c-ease), background 0.25s var(--c-ease);
}
.tk-input::placeholder { color: var(--c-faint); }
.tk-input:focus { outline: none; border-color: rgba(191, 224, 245, 0.55); background: rgba(3, 5, 9, 0.85); }
.tk-send {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  display: grid; place-items: center; border: 1px solid rgba(210, 235, 248, 0.42);
  background: linear-gradient(#f2f8fc, #c9d8e2); color: #04121c;
  transition: transform 0.3s var(--c-ease), opacity 0.3s var(--c-ease), box-shadow 0.3s var(--c-ease);
}
.tk-send:hover, .tk-send:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(185, 225, 248, 0.25); outline: none; }
.tk-send:active { transform: scale(0.92); }
.tk-send[disabled] { opacity: 0.4; pointer-events: none; }
.tk-send svg { display: block; }
.tk-hint {
  flex-shrink: 0; text-align: center; padding: 0 14px 9px;
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--c-faint);
}

/* ---------- mobile ---------- */
@media (max-width: 480px) {
  .tk-chat { right: 14px; bottom: 14px; }
  .tk-panel {
    position: fixed; right: 12px; left: 12px; bottom: 82px; width: auto;
    height: min(560px, calc(100dvh - 100px));
  }
  .tk-tease { font-size: 0.82rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tk-launch { animation: none; }
  .tk-dot { animation: none; }
  .tk-ring circle { stroke-dasharray: none; opacity: 0.25; }
  .tk-panel { transition: opacity 0.15s linear, visibility 0s linear 0.15s; transform: none; filter: none; }
  .tk-chat.is-open .tk-panel { transition-delay: 0s; }
  .tk-scan { display: none; }
  .tk-m.tk-new, .tk-chips { animation: none; }
  .tk-typing i { animation: none; opacity: 0.7; }
}
