/* ═══════════════════════════════════════════════
   SIMO COMPANION – Mr. SIMO KI-Begleiter
   SIMO GmbH · simo-online.com
   ═══════════════════════════════════════════════ */

/* ── The Companion Container ── */
#simo-companion {
  position: fixed;
  bottom: 32px; right: 32px;
  z-index: 9999;
  display: flex; flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Speech bubble (proactive) ── */
.simo-bubble {
  background: #0c0c1e;
  border: 1px solid rgba(156,156,255,.12);
  border-radius: 18px 18px 6px 18px;
  padding: 14px 18px;
  max-width: 280px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #e4e4f4;
  box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(156,156,255,.08);
  backdrop-filter: blur(20px);
  position: relative;
  transform-origin: bottom right;
  animation: simo-bubbleIn .4s cubic-bezier(.34,1.56,.64,1);
  cursor: pointer;
}
@keyframes simo-bubbleIn {
  from { opacity: 0; transform: scale(.6) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.simo-bubble.hidden {
  animation: simo-bubbleOut .25s ease forwards;
}
@keyframes simo-bubbleOut {
  to { opacity: 0; transform: scale(.8) translateY(10px); pointer-events: none; }
}
.bubble-actions {
  display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.bubble-action {
  padding: 5px 12px;
  background: rgba(38,5,243,.15);
  border: 1px solid rgba(38,5,243,.3);
  border-radius: 12px;
  font-size: 11.5px; color: #9c9cff;
  cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.bubble-action:hover { background: rgba(38,5,243,.3); color: #fff; }
.bubble-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: rgba(228,228,244,.45);
  font-size: 16px; cursor: pointer; line-height: 1;
  transition: color .15s;
}
.bubble-close:hover { color: #e4e4f4; }

/* ── The Character Orb ── */
.simo-orb-wrapper {
  position: relative;
  width: 72px; height: 72px;
  cursor: pointer;
  flex-shrink: 0;
}
.simo-orb-wrapper:hover .simo-orb { transform: scale(1.08); }
.simo-orb-wrapper:hover .simo-orbit { animation-play-state: paused; opacity: 1; }

.simo-orbit {
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: #9c9cff;
  border-right-color: rgba(156,156,255,.3);
  animation: simo-orbitSpin 3s linear infinite;
  opacity: .6;
  transition: opacity .3s;
}
.simo-orbit.o2 {
  inset: -18px;
  border-top-color: transparent;
  border-bottom-color: #2605F3;
  border-left-color: rgba(38,5,243,.3);
  animation-duration: 5s;
  animation-direction: reverse;
  opacity: .4;
}
@keyframes simo-orbitSpin { to { transform: rotate(360deg); } }

.simo-orb {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #2605F3 0%, #9c9cff 60%, #c4b5fd 100%);
  box-shadow:
    0 0 0 2px rgba(156,156,255,.2),
    0 0 30px rgba(38,5,243,.6),
    0 0 60px rgba(38,5,243,.2),
    inset 0 1px 0 rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
  animation: simo-orbPulse 3s ease-in-out infinite;
  overflow: hidden;
}
@keyframes simo-orbPulse {
  0%,100% { box-shadow: 0 0 0 2px rgba(156,156,255,.2), 0 0 30px rgba(38,5,243,.6), 0 0 60px rgba(38,5,243,.2), inset 0 1px 0 rgba(255,255,255,.2); }
  50%     { box-shadow: 0 0 0 2px rgba(156,156,255,.4), 0 0 40px rgba(38,5,243,.8), 0 0 80px rgba(38,5,243,.3), inset 0 1px 0 rgba(255,255,255,.3); }
}

/* Face */
.simo-face {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 6px;
}
.simo-eyes { display: flex; gap: 10px; }
.simo-eye {
  width: 10px; height: 10px;
  background: #fff;
  border-radius: 50%;
  position: relative;
  transition: all .2s;
}
.simo-eye::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 5px; height: 5px;
  background: #1a0080;
  border-radius: 50%;
  transition: all .2s;
}
.simo-mouth {
  width: 16px; height: 5px;
  border-bottom: 2.5px solid rgba(255,255,255,.9);
  border-left: 2.5px solid rgba(255,255,255,.9);
  border-right: 2.5px solid rgba(255,255,255,.9);
  border-radius: 0 0 8px 8px;
  transition: all .3s;
}

/* Moods */
.simo-orb.mood-thinking .simo-eye { width: 10px; height: 4px; border-radius: 3px; }
.simo-orb.mood-thinking .simo-eye::after { top: 0; width: 5px; height: 3px; border-radius: 2px; }
.simo-orb.mood-thinking .simo-mouth { border-radius: 4px 4px 0 0; border-bottom: none; border-top: 2.5px solid rgba(255,255,255,.6); height: 3px; }
.simo-orb.mood-happy .simo-mouth { width: 20px; border-radius: 0 0 12px 12px; }
.simo-orb.mood-happy .simo-eye { transform: scaleY(0.7); }
.simo-orb.mood-talking { animation: simo-talkBob .3s ease-in-out infinite alternate; }
@keyframes simo-talkBob { from { transform: translateY(0); } to { transform: translateY(-1px) scale(1.01); } }
.simo-orb.mood-talking {
  box-shadow:
    0 0 0 2px rgba(156,156,255,.4),
    0 0 30px rgba(38,5,243,.9),
    0 0 80px rgba(38,5,243,.4),
    inset 0 1px 0 rgba(255,255,255,.3);
}

/* Notification badge */
.simo-notif {
  position: absolute; top: -4px; right: -4px;
  width: 20px; height: 20px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #1A1A1A;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  animation: simo-notifPop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes simo-notifPop { from { transform: scale(0); } to { transform: scale(1); } }

/* Wave animation */
@keyframes simo-orbWave {
  0%  { transform: rotate(0deg) translateX(4px) rotate(0deg); }
  100%{ transform: rotate(360deg) translateX(4px) rotate(-360deg); }
}
.simo-orb-wrapper.waving .simo-orb {
  animation: simo-orbWave .6s ease-in-out 2, simo-orbPulse 3s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════
   FULL CHAT PANEL
   ═══════════════════════════════════════════════ */

#simo-chat-panel {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 420px;
  max-width: calc(100vw - 48px);
  height: min(680px, calc(100vh - 64px));
  background: #0c0c1e;
  border: 1px solid rgba(156,156,255,.12);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(156,156,255,.06);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  transform-origin: bottom right;
  backdrop-filter: blur(30px);
}
#simo-chat-panel.panel-hidden {
  animation: simo-panelClose .2s ease forwards;
  pointer-events: none;
}
#simo-chat-panel.panel-open {
  animation: simo-panelOpen .35s cubic-bezier(.34,1.4,.64,1);
}
@keyframes simo-panelOpen {
  from { opacity: 0; transform: scale(.85) translateY(30px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes simo-panelClose {
  to { opacity: 0; transform: scale(.85) translateY(20px); }
}

/* Panel Header */
.panel-header {
  padding: 20px 20px 16px;
  background: linear-gradient(180deg, rgba(38,5,243,.12) 0%, transparent 100%);
  border-bottom: 1px solid rgba(156,156,255,.12);
  display: flex; align-items: center; gap: 14px;
  flex-shrink: 0;
}
.panel-avatar {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #2605F3, #9c9cff);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; position: relative;
  box-shadow: 0 0 20px rgba(38,5,243,.4);
}
.panel-avatar-face {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.panel-avatar-eyes { display: flex; gap: 6px; }
.panel-avatar-eye { width: 6px; height: 6px; background: #fff; border-radius: 50%; }
.panel-avatar-mouth {
  width: 10px; height: 3px;
  border-bottom: 2px solid rgba(255,255,255,.9);
  border-left: 2px solid rgba(255,255,255,.9);
  border-right: 2px solid rgba(255,255,255,.9);
  border-radius: 0 0 5px 5px;
}
.panel-status-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  background: #22d3a5;
  border-radius: 50%;
  border: 2px solid #0c0c1e;
}
.panel-info { flex: 1; }
.panel-info h3 {
  font-family: 'Syne', sans-serif;
  font-size: 15px; font-weight: 700; color: #e4e4f4;
  margin: 0;
}
.panel-powered-by {
  display: flex; align-items: center; gap: 4px;
  margin-top: 2px;
}
.panel-powered-by span {
  font-size: 10px; color: rgba(228,228,244,.45);
  font-style: italic; white-space: nowrap;
}
.panel-logo {
  height: 14px; width: auto; opacity: .55;
  display: inline-block;
}
.panel-info .status-line {
  font-size: 11.5px; color: #22d3a5;
  display: flex; align-items: center; gap: 5px;
}
.panel-info .status-line::before {
  content: ''; width: 5px; height: 5px;
  background: #22d3a5; border-radius: 50%;
  display: inline-block;
}
.panel-actions { display: flex; gap: 8px; align-items: center; }
.panel-btn {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(156,156,255,.12);
  border-radius: 10px;
  cursor: pointer; color: rgba(228,228,244,.45);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; font-size: 14px;
}
.panel-btn:hover { background: rgba(255,255,255,.1); color: #e4e4f4; }

/* Topic chips */
.topic-strip-wrap {
  position: relative; flex-shrink: 0;
  border-bottom: 1px solid rgba(156,156,255,.12);
}
.topic-strip-wrap::after {
  content: '';
  position: absolute; top: 0; right: 0; bottom: 1px;
  width: 40px;
  background: linear-gradient(to right, transparent, #0c0c1e);
  pointer-events: none;
  z-index: 1;
}
.topic-strip {
  padding: 12px 16px 12px 16px;
  display: flex; gap: 8px; overflow-x: auto; flex-shrink: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  scroll-padding-right: 40px;
}
.topic-strip::-webkit-scrollbar { display: none; }
.topic-strip.dragging { cursor: grabbing; user-select: none; }
.topic-chip {
  padding: 6px 14px;
  background: rgba(38,5,243,.08);
  border: 1px solid rgba(38,5,243,.2);
  border-radius: 20px;
  font-size: 11.5px; font-weight: 500;
  color: #9c9cff;
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
  font-family: inherit;
  flex-shrink: 0;
}
.topic-chip:hover, .topic-chip.active {
  background: rgba(38,5,243,.25);
  border-color: rgba(38,5,243,.5);
  color: #fff;
}

/* Messages */
.panel-messages {
  flex: 1; overflow-y: auto;
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.panel-messages::-webkit-scrollbar { width: 3px; }
.panel-messages::-webkit-scrollbar-track { background: transparent; }
.panel-messages::-webkit-scrollbar-thumb { background: rgba(156,156,255,.12); border-radius: 2px; }

.msg-row {
  display: flex; gap: 10px;
  align-items: flex-end;
  animation: simo-msgAppear .3s cubic-bezier(.34,1.3,.64,1);
}
.msg-row.user-row { flex-direction: row-reverse; }
@keyframes simo-msgAppear {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.msg-ava {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
}
.msg-row.simo-row .msg-ava {
  background: linear-gradient(135deg, #2605F3, #9c9cff);
  color: #fff;
  box-shadow: 0 0 12px rgba(38,5,243,.4);
}
.msg-row.user-row .msg-ava {
  background: rgba(255,255,255,.1);
  color: rgba(228,228,244,.45);
}

.msg-bubble {
  max-width: 80%;
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
}
.msg-row.simo-row .msg-bubble {
  background: #111128;
  border: 1px solid rgba(156,156,255,.12);
  color: #e4e4f4;
  border-bottom-left-radius: 5px;
}
.msg-row.user-row .msg-bubble {
  background: linear-gradient(135deg, #2605F3, rgba(38,5,243,.85));
  color: #fff;
  border-bottom-right-radius: 5px;
}

/* Markdown in bubbles */
.msg-bubble strong { font-weight: 600; color: #fff; }
.msg-bubble em { font-style: italic; }
.msg-bubble code {
  background: rgba(156,156,255,.12);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}
.msg-bubble pre {
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(156,156,255,.08);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 6px 0;
}
.msg-bubble pre code {
  background: none;
  padding: 0;
  font-size: 12px;
  color: #c4c4e4;
}
.msg-bubble ul, .msg-bubble ol {
  margin: 4px 0;
  padding-left: 18px;
}
.msg-bubble li {
  margin: 2px 0;
}
.msg-bubble a {
  color: #9c9cff;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s;
}
.msg-bubble a:hover {
  color: #fff;
}

/* Streaming cursor */
.stream-cursor {
  display: inline-block;
  width: 2px; height: 14px;
  background: #9c9cff;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: simo-cursorBlink .7s ease-in-out infinite;
}
@keyframes simo-cursorBlink { 0%,100%{opacity:1} 50%{opacity:0} }

/* Typing indicator */
.typing-row { display: flex; gap: 10px; align-items: flex-end; }
.typing-bubble {
  background: #111128;
  border: 1px solid rgba(156,156,255,.12);
  border-radius: 18px 18px 18px 5px;
  padding: 12px 16px;
  display: flex; gap: 5px; align-items: center;
}
.typing-dot {
  width: 7px; height: 7px;
  background: #9c9cff;
  border-radius: 50%;
  animation: simo-typingBounce .9s ease-in-out infinite;
  opacity: .6;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .30s; }
@keyframes simo-typingBounce {
  0%,80%,100% { transform: translateY(0); opacity:.6; }
  40%         { transform: translateY(-6px); opacity:1; }
}

/* Fact card */
.fact-card {
  margin: 4px 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(38,5,243,.12), rgba(156,156,255,.08));
  border: 1px solid rgba(156,156,255,.2);
  border-left: 3px solid #9c9cff;
  border-radius: 12px;
  font-size: 12.5px; color: rgba(228,228,244,.45);
  line-height: 1.55;
}
.fact-card .fact-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; color: #9c9cff;
  letter-spacing: .1em; text-transform: uppercase;
  display: block; margin-bottom: 5px;
}

/* CTA card */
.cta-inline {
  margin-top: 6px;
  padding: 12px 14px;
  background: rgba(38,5,243,.1);
  border: 1px solid rgba(38,5,243,.25);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.cta-inline p { font-size: 12.5px; color: rgba(228,228,244,.45); margin: 0; }
.cta-inline a {
  padding: 7px 14px;
  background: #2605F3;
  color: #fff; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: background .15s;
  flex-shrink: 0;
}
.cta-inline a:hover { background: #1a04c2; }

/* Quick replies */
.quick-area {
  padding: 10px 14px 6px;
  display: flex; flex-wrap: wrap; gap: 7px;
}
.quick-chip {
  padding: 7px 13px;
  background: rgba(156,156,255,.08);
  border: 1px solid rgba(156,156,255,.2);
  border-radius: 16px;
  font-size: 12px; color: #9c9cff;
  cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.quick-chip:hover {
  background: rgba(156,156,255,.2);
  border-color: rgba(156,156,255,.45);
  color: #fff; transform: translateY(-1px);
}

/* Input */
.panel-input-area {
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(156,156,255,.12);
  flex-shrink: 0;
}
.simo-input-wrap {
  display: flex; gap: 8px; align-items: flex-end;
  background: #111128;
  border: 1px solid rgba(156,156,255,.12);
  border-radius: 16px;
  padding: 10px 12px;
  transition: border-color .2s, box-shadow .2s;
}
.simo-input-wrap:focus-within {
  border-color: rgba(38,5,243,.5);
  box-shadow: 0 0 0 3px rgba(38,5,243,.1);
}
#simo-input {
  flex: 1; background: none; border: none; outline: none;
  color: #e4e4f4;
  font-family: inherit;
  font-size: 13.5px;
  resize: none; max-height: 100px;
  line-height: 1.5;
}
#simo-input::placeholder { color: rgba(228,228,244,.45); }
#simo-send {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, #2605F3, #9c9cff);
  border: none; border-radius: 11px;
  cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; box-shadow: 0 0 15px rgba(38,5,243,.4);
}
#simo-send:hover:not(:disabled) { transform: scale(1.08); box-shadow: 0 0 25px rgba(38,5,243,.6); }
#simo-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }
#simo-send svg { width: 15px; height: 15px; }

/* Stats bar */
.panel-stats {
  display: flex; justify-content: space-between;
  padding: 8px 16px 12px;
  flex-shrink: 0;
}
.pstat { text-align: center; }
.pstat-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; font-weight: 500;
  color: #9c9cff; display: block;
}
.pstat-lbl {
  font-size: 9px; color: rgba(228,228,244,.45);
  text-transform: uppercase; letter-spacing: .07em;
}

/* ── Payment UI ── */
.payment-bubble {
  text-align: center;
}
.payment-btn {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(135deg, #7b2cbf, #5a189a);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  box-shadow: 0 4px 15px rgba(183,148,246,.3);
}
.payment-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(183,148,246,.5);
}
.payment-skip {
  display: inline-block;
  padding: 8px 16px;
  background: none;
  border: none;
  color: rgba(228,228,244,.45);
  font-size: 12px;
  cursor: pointer;
  transition: color .15s;
  font-family: inherit;
}
.payment-skip:hover {
  color: #e4e4f4;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #simo-companion { bottom: 24px; right: 24px; }
  #simo-chat-panel { width: 380px; height: min(600px, calc(100vh - 48px)); }
  .simo-bubble { max-width: 240px; }
}

@media (max-width: 500px) {
  #simo-companion { bottom: 20px; right: 20px; }
  #simo-chat-panel { bottom: 0; right: 0; width: 100vw; max-width: 100vw; border-radius: 24px 24px 0 0; height: 75vh; }
}

@media (max-width: 360px) {
  #simo-chat-panel { height: 80vh; border-radius: 20px 20px 0 0; }
}
