/* =========================================================
   ROBOT ASISTENTE - CON CUERPO COMPLETO Y PATAS
   ========================================================= */

.robot-assistant {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 10000;
  cursor: grab;
  user-select: none;
}

.robot-avatar {
  width: 105px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.2));
  padding: 0;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
}

.robot-avatar:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 30px rgba(0, 255, 136, 0.4));
}

/* =========================================================
   CABEZA (SIN CÍRCULO)
   ========================================================= */

.robot-face {
  position: relative;
  width: 68px;
  height: 83px;
  border-radius: 60px 60px 70px 70px;
  background: radial-gradient(circle at top, #1ef0c7, #07182b 55%, #020712 100%);
  box-shadow: 0 0 20px rgba(39, 243, 197, 0.6);
  overflow: hidden;
  border: 1px solid rgba(39, 243, 197, 0.5);
}

.robot-face-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 1px, transparent 1px);
  background-size: 10px 10px;
  mix-blend-mode: soft-light;
  opacity: 0.9;
}

.robot-brain-circuit {
  position: absolute;
  inset: 10% 8% 40% 8%;
  border-radius: 60px;
  background:
    radial-gradient(circle at 20% 20%, #3cf7ff, transparent 60%),
    radial-gradient(circle at 80% 40%, #27f3c5, transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.85;
}

.robot-brain-circuit::before,
.robot-brain-circuit::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.7);
}

.robot-brain-circuit::before {
  inset: 12% 18% 40% 18%;
  border-color: rgba(0, 0, 0, 0.8);
}

.robot-brain-circuit::after {
  inset: 30% 10% 20% 10%;
  border-color: rgba(0, 0, 0, 0.6);
}

.robot-eye {
  position: absolute;
  top: 52%;
  width: 24px;
  height: 11px;
  border-radius: 999px;
  background: radial-gradient(circle at center, #ffffff, #3cf7ff 55%, #07182b 100%);
  box-shadow: 0 0 12px rgba(60, 247, 255, 0.9);
  transition: box-shadow 0.2s, transform 0.1s;
}

.robot-eye.left { left: 20%; }
.robot-eye.right { right: 20%; }

.robot-mouth {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 45px;
  height: 15px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.7);
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.4), transparent 70%);
  overflow: hidden;
}

.robot-mouth::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(39, 243, 197, 0.1),
    rgba(39, 243, 197, 0.7),
    rgba(39, 243, 197, 0.1)
  );
  opacity: 0.7;
}

/* =========================================================
   CUERPO
   ========================================================= */

.robot-body {
  position: relative;
  width: 60px;
  height: 90px;
  margin: -10px auto 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.robot-torso {
  width: 60px;
  height: 80px;
  display: block;
  filter: drop-shadow(0 0 15px rgba(0, 255, 136, 0.15));
}

.torso-bg {
  fill: rgba(0, 20, 35, 0.85);
  stroke: #00ff88;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.2));
}

.torso-glow {
  fill: none;
  stroke: #00ff88;
  stroke-width: 0.5;
  opacity: 0.2;
  animation: torsoPulse 2s ease-in-out infinite;
}

@keyframes torsoPulse {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.4; }
}

.torso-line {
  stroke: rgba(0, 255, 136, 0.15);
  stroke-width: 0.5;
  stroke-dasharray: 3 3;
}

.torso-core {
  fill: rgba(0, 255, 136, 0.1);
  stroke: #00ff88;
  stroke-width: 1;
  animation: coreGlow 1.5s ease-in-out infinite;
}

.torso-core-glow {
  fill: #00ff88;
  opacity: 0.3;
  animation: corePulse 1.5s ease-in-out infinite;
}

@keyframes coreGlow {
  0%, 100% { stroke-opacity: 0.3; r: 12; }
  50% { stroke-opacity: 0.8; r: 14; }
}

@keyframes corePulse {
  0%, 100% { opacity: 0.2; r: 8; }
  50% { opacity: 0.6; r: 10; }
}

/* =========================================================
   BRAZOS
   ========================================================= */

.robot-arm {
  position: absolute;
  top: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  opacity: 0.6;
  transition: all 0.3s;
}

.robot-arm.left {
  left: -18px;
  transform: rotate(15deg);
}

.robot-arm.right {
  right: -18px;
  transform: rotate(-15deg);
}

.robot-avatar:hover .robot-arm {
  opacity: 1;
}

.robot-avatar:hover .robot-arm.left {
  transform: rotate(5deg);
}

.robot-avatar:hover .robot-arm.right {
  transform: rotate(-5deg);
}

.arm-segment {
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, #00ff88, #0066aa);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.2);
}

.arm-segment:nth-child(2) {
  height: 14px;
  opacity: 0.7;
}

.arm-hand {
  width: 8px;
  height: 8px;
  background: radial-gradient(circle at 40% 35%, #00ff88, #003355);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
  margin-top: 2px;
  animation: handGlow 2s ease-in-out infinite;
}

@keyframes handGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 136, 0.2); }
  50% { box-shadow: 0 0 16px rgba(0, 255, 136, 0.5); }
}

/* =========================================================
   PATAS (NUEVAS)
   ========================================================= */

.robot-leg {
  position: absolute;
  bottom: -15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0.7;
  transition: all 0.3s;
  z-index: 0;
}

.robot-leg.left {
  left: 18px;
}

.robot-leg.right {
  right: 18px;
}

.leg-segment {
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, #0066aa, #00ff88);
  border-radius: 3px;
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.leg-segment:nth-child(2) {
  height: 14px;
  opacity: 0.7;
}

.leg-foot {
  width: 12px;
  height: 5px;
  background: #00ff88;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 255, 136, 0.3);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

/* =========================================================
   BURBUJA
   ========================================================= */

.robot-bubble {
  position: absolute;
  bottom: 175px;
  right: 5px;
  background: rgba(0, 255, 136, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 255, 136, 0.2);
  color: #00ff88;
  padding: 8px 16px;
  border-radius: 14px;
  font-size: 11px;
  white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  font-weight: 500;
  transform: translateY(8px) scale(0.95);
}

.robot-assistant:hover .robot-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* =========================================================
   MODAL
   ========================================================= */

.robot-modal {
  position: fixed;
  width: 380px;
  height: 480px;
  background: rgba(8, 12, 22, 0.96);
  backdrop-filter: blur(25px);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10001;
  border: 1px solid rgba(0, 255, 136, 0.12);
}

.robot-modal.open {
  display: flex;
  animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.robot-modal-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(0, 255, 136, 0.08);
  color: #00ff88;
  font-weight: 600;
  font-size: 13px;
}

.robot-modal-header button {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 8px;
  transition: all 0.2s;
}

.robot-modal-header button:hover {
  background: rgba(0, 255, 136, 0.08);
  color: #00ff88;
}

.robot-modal-chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.robot-modal-chat::-webkit-scrollbar {
  width: 3px;
}
.robot-modal-chat::-webkit-scrollbar-track { background: transparent; }
.robot-modal-chat::-webkit-scrollbar-thumb { background: #00ff88; border-radius: 2px; }

.robot-message {
  max-width: 85%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 13px;
  word-wrap: break-word;
  line-height: 1.5;
  animation: msgIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.robot-message.user {
  background: linear-gradient(135deg, #00ff88, #00cc66);
  color: #000;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.robot-message.bot {
  background: rgba(255, 255, 255, 0.04);
  color: #c0c8d8;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border-left: 2px solid #00ff88;
}

.robot-modal-input {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.robot-modal-input input {
  flex: 1;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 255, 136, 0.12);
  border-radius: 30px;
  color: #e0e0e0;
  outline: none;
  font-size: 13px;
  transition: all 0.3s;
}

.robot-modal-input input:focus {
  border-color: #00ff88;
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.05);
}

.robot-modal-input input::placeholder { color: #445; }

.robot-modal-input button {
  background: #00ff88;
  border: none;
  border-radius: 30px;
  padding: 8px 24px;
  cursor: pointer;
  font-weight: 600;
  color: #000;
  transition: all 0.3s;
  font-size: 13px;
}

.robot-modal-input button:hover {
  background: #00cc66;
  transform: scale(1.02);
}

.robot-voice-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #00ff88 !important;
  font-size: 18px;
  padding: 6px 14px !important;
  border: 1px solid rgba(0, 255, 136, 0.12) !important;
}

.robot-voice-btn:hover {
  background: rgba(0, 255, 136, 0.1) !important;
  border-color: #00ff88 !important;
}

@media (max-width: 480px) {
  .robot-avatar { width: 80px; }
  .robot-face { width: 50px; height: 60px; }
  .robot-eye { width: 16px; height: 8px; }
  .robot-body { transform: scale(0.7); margin-top: -15px; }
  .robot-leg { transform: scale(0.7); }
  .robot-bubble { bottom: 145px; }
  .robot-modal { width: 92vw; height: 70vh; max-height: 500px; }
}
