/* ==========================================================================
   Holo — Mascote Interativo | Estilos e Animações
   ========================================================================== */

/* ─── Container ─── */
.holo-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 130px;
  height: 130px;
  z-index: 9999;
  cursor: pointer;
  overflow: visible;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 4px 12px rgba(79, 70, 229, 0.25));
}

.holo-container:hover {
  transform: scale(1.12);
  filter: drop-shadow(0 8px 20px rgba(79, 70, 229, 0.35));
}

.holo-container:active {
  transform: scale(0.95);
}

.holo-svg {
  width: 100%;
  height: 100%;
}

/* ─── Pálpebras ─── */
.holo-eyelids {
  transition: opacity 0.15s ease;
}

/* ─── Pupilas (transição suave ao seguir cursor) ─── */
.holo-pupil {
  transition: transform 0.08s ease-out;
}

/* ─── Balão de fala (HTML, posicionado acima do SVG) ─── */
.holo-speech-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  background: white;
  color: #1e1b4b;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.5rem 0.875rem;
  border-radius: 14px;
  max-width: 220px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(30, 27, 75, 0.15), 0 1px 4px rgba(0,0,0,0.05);
  pointer-events: none;
  z-index: 10;
  animation: holo-bubble-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Triângulo (rabicho do balão) */
.holo-speech-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid white;
}

@keyframes holo-bubble-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(6px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}


/* ==========================================================================
   ANIMAÇÕES POR EXPRESSÃO
   ========================================================================== */

/* ─── Idle: flutuação suave ─── */
@keyframes holo-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.holo-svg[data-expression="idle"] {
  animation: holo-float 4s ease-in-out infinite;
}

.holo-svg[data-expression="idle"] .holo-eyelids {
  opacity: 0;
}

/* ─── Eyes Closed: pálpebras visíveis ─── */
.holo-svg[data-expression="eyes-closed"] .holo-eyelids {
  opacity: 1;
}

.holo-svg[data-expression="eyes-closed"] .holo-pupil {
  opacity: 0;
}

/* ─── Happy: balanço animado ─── */
@keyframes holo-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-4deg); }
  75%      { transform: rotate(4deg); }
}

.holo-svg[data-expression="happy"] {
  animation: holo-wiggle 0.5s ease-in-out 3;
}

.holo-svg[data-expression="happy"] .holo-eyelids {
  opacity: 0;
}

/* ─── Thinking: leve inclinação ─── */
@keyframes holo-tilt {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(2deg); }
}

.holo-svg[data-expression="thinking"] {
  animation: holo-tilt 1.5s ease-in-out infinite;
}

.holo-svg[data-expression="thinking"] .holo-eyelids {
  opacity: 0;
}

/* ─── Surprised ─── */
.holo-svg[data-expression="surprised"] {
  animation: holo-float 3s ease-in-out infinite;
}

.holo-svg[data-expression="surprised"] .holo-eyelids {
  opacity: 0;
}

/* ─── Sad ─── */
@keyframes holo-sad-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

.holo-svg[data-expression="sad"] {
  animation: holo-sad-float 5s ease-in-out infinite;
}

.holo-svg[data-expression="sad"] .holo-eyelids {
  opacity: 0;
}


/* ==========================================================================
   CONTROLE DE BOCAS POR EXPRESSÃO
   ========================================================================== */

/* Idle: sorriso suave */
.holo-svg[data-expression="idle"] .holo-mouth-idle,
.holo-svg[data-expression="eyes-closed"] .holo-mouth-idle {
  display: block;
}

/* Happy: sorriso grande */
.holo-svg[data-expression="happy"] .holo-mouth-idle      { display: none; }
.holo-svg[data-expression="happy"] .holo-mouth-happy     { display: block; }
.holo-svg[data-expression="happy"] .holo-mouth-thinking  { display: none; }
.holo-svg[data-expression="happy"] .holo-mouth-surprised { display: none; }
.holo-svg[data-expression="happy"] .holo-mouth-sad       { display: none; }

/* Thinking: boca torta */
.holo-svg[data-expression="thinking"] .holo-mouth-idle      { display: none; }
.holo-svg[data-expression="thinking"] .holo-mouth-happy     { display: none; }
.holo-svg[data-expression="thinking"] .holo-mouth-thinking  { display: block; }
.holo-svg[data-expression="thinking"] .holo-mouth-surprised { display: none; }
.holo-svg[data-expression="thinking"] .holo-mouth-sad       { display: none; }

/* Surprised: boca "O" */
.holo-svg[data-expression="surprised"] .holo-mouth-idle      { display: none; }
.holo-svg[data-expression="surprised"] .holo-mouth-happy     { display: none; }
.holo-svg[data-expression="surprised"] .holo-mouth-thinking  { display: none; }
.holo-svg[data-expression="surprised"] .holo-mouth-surprised { display: block; }
.holo-svg[data-expression="surprised"] .holo-mouth-sad       { display: none; }

/* Sad: boca triste */
.holo-svg[data-expression="sad"] .holo-mouth-idle      { display: none; }
.holo-svg[data-expression="sad"] .holo-mouth-happy     { display: none; }
.holo-svg[data-expression="sad"] .holo-mouth-thinking  { display: none; }
.holo-svg[data-expression="sad"] .holo-mouth-surprised { display: none; }
.holo-svg[data-expression="sad"] .holo-mouth-sad       { display: block; }

/* Eyes-closed: boca neutra */
.holo-svg[data-expression="eyes-closed"] .holo-mouth-idle      { display: block; }
.holo-svg[data-expression="eyes-closed"] .holo-mouth-happy     { display: none; }
.holo-svg[data-expression="eyes-closed"] .holo-mouth-thinking  { display: none; }
.holo-svg[data-expression="eyes-closed"] .holo-mouth-surprised { display: none; }
.holo-svg[data-expression="eyes-closed"] .holo-mouth-sad       { display: none; }


/* ==========================================================================
   DARK MODE
   ========================================================================== */

[data-bs-theme="dark"] .holo-container {
  filter: drop-shadow(0 4px 12px rgba(79, 70, 229, 0.4));
}
[data-bs-theme="dark"] .holo-container:hover {
  filter: drop-shadow(0 8px 20px rgba(79, 70, 229, 0.5));
}

[data-bs-theme="dark"] .holo-speech-bubble {
  background: #1e293b;
  color: #f1f5f9;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] .holo-speech-bubble::after {
  border-top-color: #1e293b;
}


/* ==========================================================================
   RESPONSIVO
   ========================================================================== */

@media (max-width: 768px) {
  .holo-container {
    width: 90px;
    height: 90px;
    bottom: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .holo-container {
    width: 70px;
    height: 70px;
    bottom: 12px;
    right: 12px;
  }
}
