/* main_live.css — stable CSS for render_desktop/1 in main_live.ex
   Loaded once via <link> in root.html.heex; never re-sent on re-renders.
   DYNAMIC CSS that depends on Elixir socket assigns stays inline in main_live.ex.
*/

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes pulse {
  0%   { opacity: 0.5; transform: scale(0.9); }
  100% { opacity: 1;   transform: scale(1.1); }
}
@keyframes glow-pulse {
  0%   { box-shadow: 0 0  5px rgba(16,185,129,0.3); }
  100% { box-shadow: 0 0 20px rgba(16,185,129,0.6); }
}
@keyframes node-pulse {
  0%, 100% { transform: scale(1);   filter: drop-shadow(0 0  4px rgba(222,49,34,0.4)); }
  50%       { transform: scale(1.1); filter: drop-shadow(0 0 12px rgba(255,140,66,0.8)); }
}
@keyframes link-pulse {
  0%, 100% { stroke-opacity: 0.6; }
  50%       { stroke-opacity: 1; stroke-width: 2.5px; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0  5px rgba(16,185,129,0.5); }
  50%       { box-shadow: 0 0 15px rgba(16,185,129,0.8); }
}
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes atom-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@keyframes pipeline-stream {
  0%   { background-position:  100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes input-beam {
  0%   { box-shadow: inset 0 0 0 0 rgba(222,49,34,0); }
  50%  { box-shadow: inset 0 0 0 1px rgba(222,49,34,0.3), 0 0 12px rgba(222,49,34,0.1); }
  100% { box-shadow: inset 0 0 0 0 rgba(222,49,34,0), 0 0 6px rgba(222,49,34,0.08); }
}
@keyframes pii-flash {
  0%   { background: transparent; color: inherit; }
  20%  { background: rgba(16,185,129,0.35); color: #fff; transform: scale(1.05); }
  60%  { background: rgba(16,185,129,0.2);  color: #10B981; }
  100% { background: rgba(16,185,129,0.15); color: #10B981; transform: scale(1); }
}

/* ── Chat bubble classes ────────────────────────────────────── */
.bubble {
  max-width: 85%; padding: 18px; border-radius: 15px; font-size: 13px;
  line-height: 1.6; margin-bottom: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.user.prompt    { align-self: flex-end;  background: #000;    color: #fff; border-bottom-right-radius: 2px; }
.user.tokenised { align-self: flex-end;  background: #fdfdfd; color: #777; border: 1px dashed #ddd; border-bottom-right-radius: 2px; }
.ai.raw         { align-self: flex-start; background: #fff;   color: #777; border: 1px dashed #ddd; border-bottom-left-radius: 2px; }
.ai.response    { align-self: flex-start; background: #f9f9f9; color: #111; border: 1px solid #eee; border-bottom-left-radius: 2px; }
/* Legacy class aliases */
.user.original  { align-self: flex-end;  background: #000;    color: #fff; border-bottom-right-radius: 2px; }
.user.encrypted { align-self: flex-end;  background: #fdfdfd; color: #777; border: 1px dashed #ddd; border-bottom-right-radius: 2px; }
.ai.decrypted   { align-self: flex-start; background: #f9f9f9; color: #111; border: 1px solid #eee; border-bottom-left-radius: 2px; }
.meta { font-size: 9px; font-weight: 900; margin-bottom: 6px; opacity: 0.5; letter-spacing: 1px; }

/* ── Stat / HUD labels ──────────────────────────────────────── */
.stat-label { color: #888; text-transform: uppercase; margin-right: 8px; }
.stat-value { color: #DE3122; font-weight: 900; font-size: 12px; }
#titan-hud { box-sizing: border-box; }
.stat-unit  { color: #555; margin-left: 2px; }
.glow       { text-shadow: 0 0 10px rgba(222, 49, 34, 0.5); }

/* ── Popover ────────────────────────────────────────────────── */
.popover {
  position: absolute; top: 10px; left: 10px; right: 10px;
  background: #fff; border: 1px solid #ddd; padding: 25px;
  z-index: 50; box-shadow: 0 15px 50px rgba(0,0,0,0.15); border-radius: 8px;
}
.popover-title { font-weight: 900; font-size: 11px; margin-bottom: 15px; color: #000; letter-spacing: 1px; }

/* ── Toggle / select / key / func controls ──────────────────── */
.toggle-btn      { padding: 12px; font-size: 10px; font-weight: bold; border-radius: 5px; cursor: pointer; transition: all 0.15s; }
.toggle-active   { background: #DE3122; color: #fff; border: 1px solid #DE3122; }
.toggle-inactive { background: #f4f4f4; color: #666; border: 1px solid #ddd; }
.toggle-inactive:hover { background: #e8e8e8; border-color: #bbb; color: #333; }
.select-input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 12px; background: #fff; }
.key-input    { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 12px; font-family: monospace; }
.func-pill    { padding: 8px 16px; border-radius: 20px; font-size: 10px; font-weight: bold; cursor: pointer; border: 1px solid #ddd; margin-right: 5px; }
.func-active  { background: #000; color: #fff; border-color: #000; }

/* ── Processing pipeline progress bar ───────────────────────── */
.pipeline-stage {
  display: flex; align-items: center; gap: 4px; padding: 4px 10px;
  border-radius: 12px; font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; transition: all 0.3s;
}
.stage-idle     { background: #333; color: #666; }
.stage-complete { background: #10B981; color: #fff; }
.stage-waiting  { background: #F59E0B; color: #fff; animation: pulse-glow 1.5s infinite; }

/* .stage-active: single authoritative definition (shimmer + glow) */
.stage-active {
  background: linear-gradient(90deg, #10B981 0%, #3B82F6 50%, #10B981 100%) !important;
  background-size: 200% 100%;
  animation: pipeline-stream 1.2s linear infinite, pulse-glow 1s infinite;
}

/* ── Phase 7A: Input bar cursor beam ────────────────────────── */
.semurg-input-form:focus-within {
  border-color: #DE3122 !important;
  background: #fff !important;
  animation: input-beam 0.3s ease-out forwards;
}

/* ── Phase 7B: PII tokenisation flash ───────────────────────── */
.pii-tag {
  color: #10B981; font-weight: bold;
  background: rgba(16, 185, 129, 0.15); padding: 2px 4px;
  border-radius: 4px; border: 1px solid rgba(16, 185, 129, 0.3);
  font-family: monospace;
  animation: pii-flash 0.5s ease-out;
}

/* ── Phase 7C: Domain badge colour transition ───────────────── */
.domain-badge { transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease; }

/* ── Phase 7E: Session history domain colour bars ───────────── */
.session-bar { transition: opacity 0.3s ease, transform 0.2s ease; }
.session-bar:hover { opacity: 1 !important; transform: translateX(2px); }

/* ── Phase 7F: Code block rendering ────────────────────────── */
.code-block-wrapper {
  position: relative; background: #F0F0EE; border: 1px solid #E5E5E3;
  border-radius: 6px; margin: 8px 0; overflow: hidden;
}
.code-block-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 10px; background: #E5E5E3; font-size: 10px; font-weight: 700;
  color: #666; letter-spacing: 0.5px; font-family: 'JetBrains Mono', monospace;
}
.code-block-copy {
  cursor: pointer; padding: 2px 8px; border-radius: 4px; border: 1px solid #ccc;
  background: #fff; font-size: 9px; font-weight: 700; color: #888; transition: all 0.15s;
}
.code-block-copy:hover { background: #DE3122; color: #fff; border-color: #DE3122; }
.code-block-body {
  padding: 12px 14px; font-family: 'JetBrains Mono', monospace; font-size: 12px;
  line-height: 1.6; overflow-x: auto; white-space: pre; color: #111;
}

/* ── Tablet rail: 60px icon-only, expand on hover ───────────── */
.tablet-rail {
  width: 60px !important;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.22,1,0.36,1);
  z-index: 10;
}
.tablet-rail:hover {
  width: 260px !important;
  position: absolute;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
  box-shadow: 4px 0 24px rgba(0,0,0,0.35);
}
.tablet-rail .nav-label          { opacity: 0; transition: opacity 0.15s; white-space: nowrap; }
.tablet-rail:hover .nav-label   { opacity: 1; }

/* ── Tablet nav: hide less critical items ───────────────────── */
.tablet-nav .semurg-nav-left     { gap: 0; }
.tablet-nav .semurg-progress-bar { display: none; }

/* ── GenUI keyframes and component classes ──────────────────── */
@keyframes genui-materialize {
  0%   { opacity: 0; transform: translateY(14px) scale(0.97); filter: blur(6px); }
  55%  { filter: blur(0px); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes genui-slide-left {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes genui-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes genui-bar-grow  { from { width: 0%; } }
@keyframes genui-bar-fill  { from { width: 0%; } }
@keyframes genui-pulse-beacon {
  0%, 100% { box-shadow: 0 0  0  0 rgba(222,49,34,0); }
  50%       { box-shadow: 0 0 22px 6px rgba(222,49,34,0.22); }
}
@keyframes genui-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes genui-dot-pulse {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
  40%           { transform: scale(1.2); opacity: 1; }
}

/* Glass card */
.gc {
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  background: rgba(22,22,28,0.82);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  transition: transform 0.22s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.22s cubic-bezier(0.22,1,0.36,1),
              border-color 0.22s;
}
.gc:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(222,49,34,0.35);
  border-color: rgba(222,49,34,0.4) !important;
}

/* Metric card value shimmer */
.metric-shimmer {
  background: linear-gradient(90deg, currentColor 25%, rgba(255,255,255,0.6) 50%, currentColor 75%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: genui-shimmer 2.8s linear infinite;
}

/* Domain chip */
.domain-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 20px;
  font-size: 9px; font-weight: 900; letter-spacing: 1.6px;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  animation: genui-fade-up 0.5s ease both;
}

/* GenUI separator */
.genui-sep {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(222,49,34,0.35) 40%, rgba(222,49,34,0.35) 60%, transparent);
  margin: 18px 0;
}

/* GenUI tag pill */
.genui-tag {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 6px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  color: #555;
}
