/* =============================================================================
   ORLINX 2.0 - Mascote Holográfico Orlin (Lince Tecnológico & Agente IA Autônomo)
   Arquivo: public/assets/orlin/orlin.css
   ============================================================================= */

/* -----------------------------------------------------------------------------
   CONTAINER HOST PRINCIPAL HOLOGRÁFICO
   ----------------------------------------------------------------------------- */
#orlin-interactive-host {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  user-select: none;
  max-width: 420px;
  max-height: 420px;
}

.hologram-core-container {
  max-width: 420px;
  max-height: 420px;
  z-index: 10;
}

/* -----------------------------------------------------------------------------
   KEYFRAMES HOLOGRÁFICOS OFICIAIS
   1. orlinFloat (3.5s ease-in-out infinite)
   2. orlinBreathe (4s ease-in-out infinite)
   3. orlinOrbitSpin (1.2s linear infinite)
   4. Modulação sonora e reflexos no piso
   ----------------------------------------------------------------------------- */

@keyframes orlinFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes orlinBreathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes orlinOrbitSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes holoFloorPulse {
  0%, 100% {
    opacity: 0.55;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
    filter: blur(7px);
  }
}

@keyframes holoRingPulse {
  0%, 100% {
    opacity: 0.75;
    transform: scale(1);
    box-shadow: 0 0 16px rgba(201, 161, 74, 0.8), inset 0 0 10px rgba(0, 87, 255, 0.6);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 26px rgba(201, 161, 74, 1), inset 0 0 16px rgba(0, 87, 255, 0.85);
  }
}

@keyframes orlinEyePulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(0.9);
    box-shadow: 0 0 6px #C9A14A;
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 12px #FFD56B, 0 0 20px rgba(201, 161, 74, 0.9);
  }
}

@keyframes acousticExpand {
  0% {
    transform: scale(0.65);
    opacity: 0.95;
    border-color: #0057FF;
  }
  100% {
    transform: scale(1.75);
    opacity: 0;
    border-color: rgba(201, 161, 74, 0);
  }
}

@keyframes particleRise {
  0% {
    bottom: 0px;
    opacity: 1;
    transform: scale(1);
  }
  100% {
    bottom: 70px;
    opacity: 0;
    transform: scale(0.2);
  }
}

@keyframes soundModulation {
  0% {
    box-shadow: 0 0 18px rgba(201, 161, 74, 0.7), 0 0 30px rgba(0, 87, 255, 0.5);
    border-color: #C9A14A;
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 35px rgba(201, 161, 74, 0.95), 0 0 55px rgba(0, 87, 255, 0.85);
    border-color: #FFD56B;
    transform: scale(1.08);
  }
}

/* -----------------------------------------------------------------------------
   ESTRUTURA DO MASCOTE HOLOGRÁFICO (BUSTO + BASE)
   ----------------------------------------------------------------------------- */
.orlin-holo-busto-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: orlinFloat 3.5s ease-in-out infinite;
}

.orlin-holo-busto {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 9999px;
  overflow: hidden;
  animation: orlinBreathe 4s ease-in-out infinite;
  background: radial-gradient(circle at 35% 30%, rgba(20, 48, 90, 0.85), #071224 85%);
  border: 2px solid rgba(201, 161, 74, 0.65);
  box-shadow: 
    0 0 20px rgba(201, 161, 74, 0.4),
    0 0 35px rgba(0, 87, 255, 0.35),
    inset 0 0 15px rgba(201, 161, 74, 0.25);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.orlin-holo-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(201, 161, 74, 0.3));
  transition: filter 0.3s ease;
}

/* Olhar & Sensores Reativos */
.orlin-reactive-eyes {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
}

.orlin-eye {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #FFD56B;
  box-shadow: 0 0 8px #C9A14A, 0 0 14px #FFD56B;
  animation: orlinEyePulse 2.8s ease-in-out infinite;
}

.orlin-ear-sensors {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 4;
}

.orlin-ear-sensor {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: #0057FF;
  box-shadow: 0 0 8px #0057FF;
  opacity: 0.75;
}

/* Base Holográfica: Anel Elíptico Dourado e Azul + Reflexo Radial */
.orlin-holo-platform {
  position: relative;
  width: 96px;
  height: 32px;
  margin-top: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orlin-holo-floor-reflection {
  position: absolute;
  bottom: -4px;
  width: 96px;
  height: 24px;
  background: radial-gradient(ellipse at center, rgba(201, 161, 74, 0.45) 0%, rgba(0, 87, 255, 0.3) 50%, transparent 80%);
  filter: blur(5px);
  border-radius: 50%;
  animation: holoFloorPulse 3s ease-in-out infinite;
}

.orlin-holo-ring.ring-outer {
  position: absolute;
  width: 84px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #C9A14A;
  box-shadow: 0 0 16px rgba(201, 161, 74, 0.8), inset 0 0 10px rgba(0, 87, 255, 0.6);
  animation: holoRingPulse 2.8s ease-in-out infinite;
}

.orlin-holo-ring.ring-inner {
  position: absolute;
  width: 64px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid #0057FF;
  box-shadow: 0 0 14px rgba(0, 87, 255, 0.85);
  animation: holoRingPulse 2.8s ease-in-out infinite reverse;
}

.orlin-holo-core-glow {
  position: absolute;
  width: 38px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(201, 161, 74, 0.5) 60%, transparent 100%);
  filter: blur(2px);
}

/* -----------------------------------------------------------------------------
   EFEITOS VISUAIS PARA OS 4 ESTADOS REATIVOS (HOST)
   1. .state-idle
   2. .state-listening
   3. .state-thinking
   4. .state-speaking
   ----------------------------------------------------------------------------- */

/* Containers de Efeitos (Ocultos por padrão) */
.orlin-orbit-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 96px;
  height: 96px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.orlin-orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px dashed rgba(201, 161, 74, 0.8);
}

.orlin-orbit-ring.ring-1 {
  border-color: #C9A14A;
  border-top-color: transparent;
  animation: orlinOrbitSpin 1.2s linear infinite;
}

.orlin-orbit-ring.ring-2 {
  inset: 6px;
  border: 1.5px dashed #0057FF;
  border-bottom-color: transparent;
  animation: orlinOrbitSpin 1.6s linear infinite reverse;
}

.orlin-acoustic-container {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.orlin-acoustic-wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #0057FF;
  box-shadow: 0 0 15px #0057FF;
}

.orlin-acoustic-wave.wave-1 {
  animation: acousticExpand 1.4s ease-out infinite;
}
.orlin-acoustic-wave.wave-2 {
  animation: acousticExpand 1.4s ease-out infinite 0.7s;
}

.orlin-particles-container {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 70px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.orlin-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #C9A14A;
  box-shadow: 0 0 8px #C9A14A;
  animation: particleRise 1.8s ease-out infinite;
}

.orlin-particle.p-1 { left: 20%; animation-delay: 0s; }
.orlin-particle.p-2 { left: 40%; animation-delay: 0.4s; background: #0057FF; box-shadow: 0 0 8px #0057FF; }
.orlin-particle.p-3 { left: 60%; animation-delay: 0.9s; }
.orlin-particle.p-4 { left: 80%; animation-delay: 1.3s; background: #FFD56B; box-shadow: 0 0 8px #FFD56B; }

/* 1. STATE-IDLE (Ocioso: levitação suave, brilho âmbar) */
#orlin-interactive-host.state-idle .orlin-holo-busto {
  box-shadow: 0 0 20px rgba(201, 161, 74, 0.4), 0 0 35px rgba(0, 87, 255, 0.35);
}

/* 2. STATE-LISTENING (Ouvindo microfone: glow azul intenso, ondas acústicas) */
#orlin-interactive-host.state-listening .orlin-holo-busto {
  border-color: #0057FF;
  box-shadow: 0 0 32px rgba(0, 87, 255, 0.9), 0 0 55px rgba(0, 87, 255, 0.75);
}
#orlin-interactive-host.state-listening .orlin-acoustic-container {
  opacity: 1;
}
#orlin-interactive-host.state-listening .orlin-eye {
  background: #60a5fa;
  box-shadow: 0 0 12px #0057FF, 0 0 20px #60a5fa;
}
#orlin-interactive-host.state-listening .orlin-ear-sensor {
  background: #38bdf8;
  box-shadow: 0 0 12px #38bdf8;
}

/* 3. STATE-THINKING (Processando: anéis orbitais girando em alta rotação) */
#orlin-interactive-host.state-thinking .orlin-orbit-container {
  opacity: 1;
}
#orlin-interactive-host.state-thinking .orlin-holo-busto {
  border-color: #C9A14A;
  box-shadow: 0 0 30px rgba(201, 161, 74, 0.9), 0 0 50px rgba(0, 87, 255, 0.8);
}
#orlin-interactive-host.state-thinking .orlin-holo-ring.ring-outer {
  border-color: #FFD56B;
  box-shadow: 0 0 26px rgba(201, 161, 74, 1);
}

/* 4. STATE-SPEAKING (Falando: modulação de onda sonora + partículas luminosas) */
#orlin-interactive-host.state-speaking .orlin-holo-busto {
  animation: soundModulation 0.6s infinite alternate ease-in-out;
}
#orlin-interactive-host.state-speaking .orlin-particles-container {
  opacity: 1;
}
#orlin-interactive-host.state-speaking .orlin-eye {
  animation: orlinEyePulse 1s ease-in-out infinite;
}

/* -----------------------------------------------------------------------------
   BALÃO DE DIÁLOGO HOLOGRÁFICO DINÂMICO (#orlin-speech-bubble)
   Glassmorphism Dark Navy + Borda Dourada #C9A14A
   ----------------------------------------------------------------------------- */
.orlin-holo-bubble {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  padding: 14px 16px;
  background: rgba(10, 22, 40, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #C9A14A;
  border-radius: 18px;
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.85),
    0 0 25px rgba(201, 161, 74, 0.35),
    inset 0 0 20px rgba(0, 87, 255, 0.2);
  color: #F5F0E6;
  z-index: 9999;
  animation: orlinBubbleEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.orlin-holo-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  right: 32px;
  width: 14px;
  height: 14px;
  background: rgba(10, 22, 40, 0.95);
  border-right: 1px solid #C9A14A;
  border-bottom: 1px solid #C9A14A;
  transform: rotate(45deg);
}

@keyframes orlinBubbleEnter {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.orlin-holo-bubble.fade-out {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
}

/* Compatibilidade com classes anteriores */
.orlin-state-idle {
  animation: orlinFloat 3.8s ease-in-out infinite;
}
.orlin-state-listening {
  animation: acousticExpand 1.5s infinite ease-out;
}
.orlin-state-speaking {
  animation: soundModulation 0.6s infinite alternate ease-in-out;
}
.orlin-state-thinking {
  animation: orlinOrbitSpin 1.2s linear infinite;
}
