/* panel/sophos.css — Sophos, o personagem do painel (Projeto Hikma, fase 1)
 *
 * Camada ADITIVA: nada aqui altera o mascote antigo (.login-turtle) nem o
 * layout existente. O boneco é um SVG fixo (.sophos) + balão (.sophos-bubble)
 * + orelha fixa (.sophos-ear) + controles de personalização (.sophos-controls).
 *
 * Estados (classe .sophos-<estado>): walk | run | think | work | ask | happy |
 * sad | away | sleep. Roupas (classe .outfit-<nome>): tech | suit | gov |
 * casual | hoodie.
 *
 * prefers-reduced-motion: desliga TODAS as animações (o JS já para o passeio).
 */

.sophos-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ── Boneco ─────────────────────────────────────────────────────────────── */
.sophos {
  position: fixed;
  left: 0;
  top: 0;
  width: 96px;
  height: 96px;
  pointer-events: auto;
  cursor: pointer;
  transition-property: left, top;
  transition-timing-function: cubic-bezier(.33, .9, .4, 1);
  transition-duration: 1200ms;
  will-change: left, top;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45));
}
.sophos-svg { width: 100%; height: 100%; overflow: visible; }

.sophos-body { fill: #1f2b3a; stroke: #4fd1c5; stroke-width: 2; }
.sophos-head { fill: #24384d; stroke: #6ee7f9; stroke-width: 2; }
.sophos-eye  { fill: #d7fbff; }
.sophos-mouth { fill: none; stroke: #9ff3ff; stroke-width: 2.4; stroke-linecap: round; }
.sophos-ear-dot { fill: #4fd1c5; opacity: .85; }
.sophos-chest { fill: rgba(79, 209, 197, .16); stroke: rgba(79, 209, 197, .55); stroke-width: 1; }
.sophos-brand { fill: #9ff3ff; font-size: 8px; font-family: ui-monospace, monospace; }
.sophos-leg  { fill: #16202c; stroke: #4fd1c5; stroke-width: 1.5; }
.sophos-face { opacity: .96; }

/* glow/scanline futurista */
.sophos-scanline {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(110, 231, 249, .22), transparent 55%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: sophos-scan 3.6s linear infinite;
}
@keyframes sophos-scan {
  0%   { transform: translateY(-18%); opacity: .10; }
  50%  { transform: translateY(18%);  opacity: .30; }
  100% { transform: translateY(-18%); opacity: .10; }
}

/* ── Estados ────────────────────────────────────────────────────────────── */
.sophos-walk .sophos-svg   { animation: sophos-bob 1.1s ease-in-out infinite; }
.sophos-run .sophos-svg    { animation: sophos-bob .42s ease-in-out infinite; }
.sophos-think .sophos-head { animation: sophos-tilt 1.6s ease-in-out infinite; }
.sophos-work .sophos-body  { animation: sophos-pulse 1.1s ease-in-out infinite; }
.sophos-ask .sophos-ear-dot { animation: sophos-blink 1s ease-in-out infinite; }
.sophos-happy .sophos-svg  { animation: sophos-hop .55s ease-out 3; }
.sophos-sad .sophos-svg    { animation: sophos-slump 2.4s ease-in-out infinite; }
.sophos-away .sophos-svg   { opacity: 0; }
.sophos-sleep .sophos-svg  { animation: sophos-breathe 3.2s ease-in-out infinite; opacity: .8; }

@keyframes sophos-bob    { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes sophos-tilt   { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-7deg); } }
@keyframes sophos-pulse  { 0%,100% { opacity: 1; } 50% { opacity: .72; } }
@keyframes sophos-blink  { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes sophos-hop    { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-12px); } }
@keyframes sophos-slump  { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(3px) rotate(3deg); } }
@keyframes sophos-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(.97); } }

/* ── Roupas ─────────────────────────────────────────────────────────────── */
.sophos.outfit-tech .sophos-body   { fill: #16202c; stroke: #4fd1c5; }
.sophos.outfit-suit .sophos-body   { fill: #101826; stroke: #8fa6c4; }
.sophos.outfit-gov .sophos-body    { fill: #14301f; stroke: #86efac; }
.sophos.outfit-casual .sophos-body { fill: #2b2233; stroke: #c4b5fd; }
.sophos.outfit-hoodie .sophos-body { fill: #2a1f14; stroke: #fbbf24; }
.sophos.outfit-suit .sophos-head   { fill: #16202c; }
.sophos.outfit-gov .sophos-head    { fill: #17351f; }
.sophos.outfit-casual .sophos-head { fill: #33283d; }
.sophos.outfit-hoodie .sophos-head { fill: #33260f; }

/* ── Balão de fala ──────────────────────────────────────────────────────── */
.sophos-bubble {
  position: fixed;
  max-width: 260px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(12, 20, 30, .94);
  color: #d7fbff;
  border: 1px solid rgba(110, 231, 249, .45);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  z-index: 61;
}

/* ── Orelha fixa ────────────────────────────────────────────────────────── */
.sophos-ear {
  position: fixed;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 249, .4);
  background: rgba(12, 20, 30, .82);
  color: #d7fbff;
  font-size: 14px;
  cursor: pointer;
  z-index: 62;
  transition: left 600ms ease, top 600ms ease;
}
.sophos-ear:hover { border-color: #6ee7f9; }
.sophos-ear-msg { font-size: 12px; max-width: 220px; }

/* ── Controles de personalização ────────────────────────────────────────── */
.sophos-controls {
  position: fixed;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(12, 20, 30, .86);
  border: 1px solid rgba(110, 231, 249, .28);
  pointer-events: auto;
  z-index: 62;
  font-size: 12px;
  color: #d7fbff;
}
.sophos-drop {
  padding: 6px 10px;
  border: 1px dashed rgba(110, 231, 249, .55);
  border-radius: 8px;
  cursor: copy;
}
.sophos-file { display: none; }
.sophos-btn,
.sophos-select,
.sophos-input {
  background: rgba(255, 255, 255, .06);
  color: #d7fbff;
  border: 1px solid rgba(110, 231, 249, .3);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}
.sophos-input { width: 90px; cursor: text; }

/* ── Acessibilidade: sem movimento ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sophos,
  .sophos-svg,
  .sophos-scanline,
  .sophos-ear,
  .sophos .sophos-head,
  .sophos .sophos-body,
  .sophos .sophos-ear-dot {
    animation: none !important;
    transition: none !important;
  }
}
