/* SHELA UI/UX v2 (3.8.2026) — ziv chat: glasen header, moderen composer,
   glass sidebar, dihajoce ozadje. Aditivno cez v1, nic funkcionalnega se ne rusi. */

/* ---------- zivo ozadje (canvas iz shela-alive-bg.js) ---------- */
#shela-alive-bg {
  position: fixed;
  inset: 0;
  z-index: 45; /* nad vsebino, pod talk/brain overlayi in modali */
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.95;
}

/* ---------- header: na debeli glas ---------- */
#shela-header-v2 {
  background: linear-gradient(180deg, rgba(16, 12, 24, 0.92), rgba(13, 10, 20, 0.78)) !important;
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border-bottom: 0 !important;
}
#shela-header-v2::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(154, 107, 255, 0.55), rgba(255, 171, 74, 0.35) 45%, rgba(154, 107, 255, 0.12) 80%, transparent);
  pointer-events: none;
}
#shela-header-v2 .hv2-name {
  font-size: 1.32rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
  background: linear-gradient(92deg, #ffffff, #cbb2ff 55%, #ffc478);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
#shela-header-v2 .hv2-dot {
  box-shadow: 0 0 8px #34d399, 0 0 20px rgba(52, 211, 153, 0.55);
}
#shela-header-v2 .hv2-icon-btn svg,
#shela-header-v2 .shela-brain-view-btn svg { width: 22px; height: 22px; }
#shela-header-v2 .shela-talk-btn svg { width: 28px; height: 28px; }
#shela-header-v2 .hv2-icon-btn:hover,
#shela-header-v2 .shela-brain-view-btn:hover {
  box-shadow: 0 0 16px rgba(154, 107, 255, 0.3);
}
#shela-header-v2 .hv2-tokens {
  font-weight: 700;
  letter-spacing: 0.04em;
}
#shela-header-v2 .hv2-menu:hover { box-shadow: 0 0 14px rgba(154, 107, 255, 0.22); }

/* ---------- composer: globlji glass, gradientna obroba, sijaj ---------- */
div[class*="rounded-2xl"]:has(textarea[placeholder^="Ask anything"]) {
  border-radius: 22px !important;
  background: linear-gradient(180deg, rgba(28, 21, 42, 0.88), rgba(17, 13, 27, 0.94)) !important;
  border: 1px solid rgba(154, 107, 255, 0.24) !important;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 32px rgba(154, 107, 255, 0.07) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
div[class*="rounded-2xl"]:has(textarea[placeholder^="Ask anything"]):focus-within {
  border-color: rgba(196, 166, 255, 0.55) !important;
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 46px rgba(154, 107, 255, 0.22) !important;
}
div[class*="rounded-2xl"]:has(textarea[placeholder^="Ask anything"]) button {
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
  border-radius: 12px;
}
div[class*="rounded-2xl"]:has(textarea[placeholder^="Ask anything"]) button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(154, 107, 255, 0.25);
}

/* ---------- pozdrav: gradientni naslov ---------- */
#root h2.text-2xl.font-bold.tracking-tight {
  font-size: clamp(1.7rem, 3.2vw, 2.15rem);
  background: linear-gradient(92deg, #f8f4ff, #cbb2ff 58%, #ffc478);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.015em;
}

/* ---------- sidebar: glass, mehke kartice, ziv New Chat ---------- */
aside[class*="bg-sidebar"] {
  background: linear-gradient(180deg, rgba(16, 13, 24, 0.94), rgba(11, 9, 17, 0.97)) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(154, 107, 255, 0.10) !important;
}
aside [role="button"], aside a, aside li > div {
  border-radius: 10px;
  transition: background 0.15s ease, transform 0.15s ease;
}
aside [role="button"]:hover, aside a:hover {
  background: rgba(196, 166, 255, 0.08) !important;
  transform: translateX(2px);
}
aside button[class*="hulk"] {
  background: linear-gradient(135deg, #8a5cff, #b98cff) !important;
  border: 0 !important;
  border-radius: 12px !important;
  font-weight: 650 !important;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 22px rgba(138, 92, 255, 0.35);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
aside button[class*="hulk"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(138, 92, 255, 0.5);
}
aside input[type="text"], aside input[type="search"] {
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(154, 107, 255, 0.14) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
aside input[type="text"]:focus, aside input[type="search"]:focus {
  border-color: rgba(196, 166, 255, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(154, 107, 255, 0.12);
  outline: none;
}

/* ---------- kartice predlogov na praznem zaslonu: dvig ob hovru ---------- */
#root button[class*="border"][class*="rounded"]:has(svg) {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
#root button[class*="border"][class*="rounded"]:has(svg):hover {
  transform: translateY(-2px);
  border-color: rgba(196, 166, 255, 0.35) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 18px rgba(154, 107, 255, 0.10);
}

/* ================== v3: CEL CHAT DIHA + mozgani + moderen composer ================== */

/* svet za UI vidno diha — pocasen vdih/izdih celotnega sijaja */
@keyframes shela-world-breath {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
#shela-alive-bg { animation: shela-world-breath 7s ease-in-out infinite; }

/* mozgani: barve se pretakajo (hue flow) + dihajo + zivi sijaj */
@keyframes shela-brain-flow {
  0%   { filter: hue-rotate(0deg) saturate(1.15) brightness(1) drop-shadow(0 0 24px rgba(154, 107, 255, 0.55)); transform: scale(1); }
  33%  { filter: hue-rotate(38deg) saturate(1.4) brightness(1.08) drop-shadow(0 0 40px rgba(127, 212, 224, 0.5)); transform: scale(1.045); }
  66%  { filter: hue-rotate(-28deg) saturate(1.35) brightness(1.05) drop-shadow(0 0 36px rgba(224, 143, 176, 0.5)); transform: scale(1.02); }
  100% { filter: hue-rotate(0deg) saturate(1.15) brightness(1) drop-shadow(0 0 24px rgba(154, 107, 255, 0.55)); transform: scale(1); }
}
img[src*="shela-brain"] {
  animation: shela-brain-flow 11s ease-in-out infinite;
  will-change: filter, transform;
}

/* composer sijaj diha, tudi ko mirujes */
@keyframes shela-composer-breath {
  0%, 100% { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 26px rgba(154, 107, 255, 0.06); }
  50%      { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 44px rgba(154, 107, 255, 0.16); }
}
div[class*="rounded-2xl"]:has(textarea[placeholder^="Ask anything"]):not(:focus-within) {
  animation: shela-composer-breath 6s ease-in-out infinite;
}

/* New Chat tudi tli */
@keyframes shela-cta-breath {
  0%, 100% { box-shadow: 0 6px 22px rgba(138, 92, 255, 0.3); }
  50%      { box-shadow: 0 6px 30px rgba(138, 92, 255, 0.55); }
}
aside button[class*="hulk"] { animation: shela-cta-breath 5.5s ease-in-out infinite; }

/* ---------- composer: EN cist pill, brez dvojne obrobe ---------- */
textarea[placeholder^="Ask anything"] {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 10px 12px !important;
}
div[class*="rounded-2xl"]:has(textarea[placeholder^="Ask anything"]) {
  padding: 10px 12px !important;
}
div[class*="rounded-2xl"]:has(textarea[placeholder^="Ask anything"]) svg {
  transition: color 0.2s ease, filter 0.2s ease;
}
div[class*="rounded-2xl"]:has(textarea[placeholder^="Ask anything"]) button:hover svg {
  filter: drop-shadow(0 0 8px rgba(127, 212, 224, 0.7));
}

/* ---------- sredina: globlje glass kartice ---------- */
#root button[class*="border"][class*="rounded"]:has(svg) {
  background: rgba(22, 17, 36, 0.5) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px !important;
  border-color: rgba(154, 107, 255, 0.14) !important;
}

@media (prefers-reduced-motion: reduce) {
  #shela-alive-bg, img[src*="shela-brain"],
  div[class*="rounded-2xl"]:has(textarea[placeholder^="Ask anything"]):not(:focus-within),
  aside button[class*="hulk"] { animation: none !important; }
}

/* ---------- filmsko zrno cez vse (INKI world-engine podpis) ---------- */
#shela-alive-grain {
  position: fixed;
  inset: 0;
  z-index: 46;
  pointer-events: none;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.055 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- sheen na wordmarku — barva tece skozi napis ---------- */
@keyframes shela-sheen { to { background-position: 220% 0; } }
#shela-header-v2 .hv2-name {
  background: linear-gradient(115deg, #ffffff 5%, #cbb2ff 35%, #7fd4e0 55%, #ffc478 75%, #ffffff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shela-sheen 8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  #shela-header-v2 .hv2-name { animation: none; }
}

/* ---------- iridescentni pridih na composerju (teal ob violet) ---------- */
div[class*="rounded-2xl"]:has(textarea[placeholder^="Ask anything"]):focus-within {
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 46px rgba(154, 107, 255, 0.2),
    -18px 0 40px -18px rgba(127, 212, 224, 0.25),
    18px 0 40px -18px rgba(224, 143, 176, 0.22) !important;
}

/* ---------- MOBIL: pravi app frame — nic vec scrolanja cele strani ---------- */
@media (max-width: 760px) {
  html, body {
    height: 100dvh !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    position: fixed;
    inset: 0;
    width: 100%;
  }
  #root { height: 100dvh !important; }
  #shela-header-v2 .hv2-name { font-size: 1.16rem !important; }
  #shela-alive-bg { opacity: 0.85; }
  #shela-alive-grain { opacity: 0.22; }
}

/* reduced motion: brez transformov */
@media (prefers-reduced-motion: reduce) {
  aside [role="button"]:hover, aside a:hover,
  #root button[class*="border"][class*="rounded"]:has(svg):hover,
  div[class*="rounded-2xl"]:has(textarea[placeholder^="Ask anything"]) button:hover,
  aside button[class*="hulk"]:hover { transform: none; }
}

/* ── PWA/standalone na iPhonu — POPRAVEK 11.8.2026 ──────────────────────
   Osnovni .shela-header-v2 (glass) ze odmakne pill z top:calc(inset+10px).
   Vceraj sem tu POMOTOMA dodal se padding-top:inset -> inset se je stel
   DVAKRAT: pill je padel prenizko, ikone potisnjene, spodnja ::after crta
   pa je sla cez ikone. Zdaj: NE podvajaj inseta; pill le rahlo dvignem
   (+4px namesto +10px) po zelji ("malo visje"). Vsebino pod pill odmaknem
   na scroll containerju, ne prek #root paddinga. */
html .shela-header-v2 { top: calc(env(safe-area-inset-top, 0px) + 4px) !important; }
/* prvi mehurcek v chatu ne sme biti skrit za lebdecim pill headerjem */
@media (max-width: 767px) {
  #root [class*="overflow-y-auto"] { padding-top: calc(env(safe-area-inset-top, 0px) + 62px) !important; }
}
