﻿/* ==========================================================================
   MYCLOUD.UNO — MICLO FLOATING COMPANION WIDGET
   ========================================================================== */

#miclo-companion {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  width: 72px;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: grab;
  filter: drop-shadow(0 10px 20px rgba(79, 70, 229, 0.22));
  transition: transform 0.15s ease-out, filter 0.2s ease;
}

#miclo-companion:active,
#miclo-companion.is-dragging {
  cursor: grabbing;
  transform: scale(1.08) rotate(3deg);
  filter: drop-shadow(0 16px 28px rgba(79, 70, 229, 0.35));
  animation: none !important;
}

/* Animación suave de levitación cuando está inactivo */
#miclo-companion.floating {
  animation: micloFloat 3.6s ease-in-out infinite;
}

@keyframes micloFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(-1.5deg);
  }
}

/* Imagen del personaje */
.miclo-avatar {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

/* Globo de diálogo / Speech Bubble */
.miclo-speech-bubble {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  background: #111827;
  color: #ffffff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.miclo-speech-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 28px;
  border-width: 6px;
  border-style: solid;
  border-color: #111827 transparent transparent transparent;
}

/* Mostrar globo al hover o al hacer click */
#miclo-companion:hover .miclo-speech-bubble,
#miclo-companion.bubble-visible .miclo-speech-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Indicador de luz sutil en la bombilla */
.miclo-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.8) 0%, rgba(254, 240, 138, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: bulbPulse 2s ease-in-out infinite alternate;
}

@keyframes bulbPulse {
  0% {
    opacity: 0.4;
    transform: translateX(-50%) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1.3);
  }
}

/* Responsive para pantallas pequeñas */
@media (max-width: 768px) {
  #miclo-companion {
    width: 60px;
    bottom: 20px;
    right: 20px;
  }
  .miclo-speech-bubble {
    font-size: 11px;
    padding: 6px 10px;
  }
}
