/* ── Interio Universe Container ──────────────────────── */

.interio-universe {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  overflow: hidden;
}

/* ── Robot Avatar ────────────────────────────────────── */

.interio-avatar {
  position: absolute;
  width: 72px;
  height: 82px;
  border: 0;
  background: transparent;
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
  z-index: 9999;
  filter: drop-shadow(0 6px 18px rgba(40, 35, 28, 0.25));
  transition: filter 0.3s ease;
}

.interio-avatar:hover {
  filter: drop-shadow(0 8px 24px rgba(40, 35, 28, 0.35));
}

/* Robot Head */
.interio-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px 18px 14px 14px;
  background: linear-gradient(170deg, #f5efe8 0%, #e8ddd0 40%, #d4c4b0 100%);
  border: 2px solid rgba(173, 142, 106, 0.35);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.6),
    inset 0 -3px 8px rgba(0, 0, 0, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
  overflow: visible;
}

.interio-avatar:hover .interio-body {
  transform: scale(1.03);
}

/* Antenna */
.interio-antenna {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 2.5px;
  height: 14px;
  background: linear-gradient(to top, #ad8e6a, #d4b99b);
  border-radius: 2px;
}

.interio-antenna-tip {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e8c496, #ad8e6a);
  box-shadow: 0 0 8px rgba(173, 142, 106, 0.6);
  animation: antennaPulse 2.5s ease-in-out infinite;
}

@keyframes antennaPulse {
  0%,
  100% {
    box-shadow: 0 0 6px rgba(173, 142, 106, 0.4);
  }
  50% {
    box-shadow: 0 0 14px rgba(212, 185, 155, 0.8);
  }
}

/* Visor / Eye Panel */
.interio-visor {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 24px;
  border-radius: 12px;
  background: linear-gradient(145deg, #2a2420, #1a1510);
  border: 1.5px solid rgba(173, 142, 106, 0.3);
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.4),
    0 1px 2px rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.interio-visor-shine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), transparent);
  border-radius: 12px 12px 0 0;
  pointer-events: none;
}

/* Eyes inside visor */
.interio-eyes {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 14px;
  transition: transform 0.2s ease;
}

.interio-eye {
  width: 12px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #d4b99b, #ad8e6a);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 0 6px rgba(173, 142, 106, 0.5);
}

.interio-pupil {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff, #f0e6da);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

/* Mouth — 3-bar speaker grille */
.interio-mouth {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  align-items: center;
  transition: all 0.25s ease;
}

.interio-mouth-bar {
  height: 2px;
  border-radius: 1px;
  background: rgba(173, 142, 106, 0.5);
  transition: all 0.25s ease;
}

.interio-mouth-bar:nth-child(1) {
  width: 18px;
}
.interio-mouth-bar:nth-child(2) {
  width: 14px;
}
.interio-mouth-bar:nth-child(3) {
  width: 10px;
}

/* Side Ears / Sensors */
.interio-ears {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  pointer-events: none;
}

.interio-ear {
  position: absolute;
  width: 6px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(to bottom, #d4b99b, #ad8e6a);
  border: 1px solid rgba(173, 142, 106, 0.3);
}

.interio-ear-l {
  left: -5px;
  border-radius: 3px 0 0 3px;
}

.interio-ear-r {
  right: -5px;
  border-radius: 0 3px 3px 0;
}

/* ── Expressions ────────────────────────────────────── */

/* Happy — eyes squint, mouth bars widen */
.interio-avatar.happy .interio-eye {
  height: 10px;
  border-radius: 8px 8px 2px 2px;
}

.interio-avatar.happy .interio-mouth-bar:nth-child(1) {
  width: 22px;
}
.interio-avatar.happy .interio-mouth-bar:nth-child(2) {
  width: 18px;
}
.interio-avatar.happy .interio-mouth-bar:nth-child(3) {
  width: 14px;
}

.interio-avatar.happy .interio-mouth-bar {
  background: rgba(173, 142, 106, 0.7);
}

/* Curious — eyes enlarge */
.interio-avatar.curious .interio-eye {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 10px rgba(173, 142, 106, 0.7);
}

.interio-avatar.curious .interio-pupil {
  width: 6px;
  height: 6px;
}

/* Thinking — eyes shift, antenna blinks fast */
.interio-avatar.thinking .interio-eyes {
  transform: translate(calc(-50% + 3px), -50%);
}

.interio-avatar.thinking .interio-mouth-bar {
  animation: thinkPulse 1s ease-in-out infinite;
}

.interio-avatar.thinking .interio-mouth-bar:nth-child(2) {
  animation-delay: 0.15s;
}

.interio-avatar.thinking .interio-mouth-bar:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes thinkPulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.interio-avatar.thinking .interio-antenna-tip {
  animation: antennaPulse 0.6s ease-in-out infinite;
}

/* Sleeping — eyes are thin lines */
.interio-avatar.sleeping .interio-eye {
  height: 2px;
  width: 12px;
  border-radius: 2px;
  box-shadow: 0 0 3px rgba(173, 142, 106, 0.3);
}

.interio-avatar.sleeping .interio-pupil {
  display: none;
}

.interio-avatar.sleeping .interio-mouth-bar {
  opacity: 0.25;
}

.interio-avatar.sleeping .interio-antenna-tip {
  animation: none;
  opacity: 0.4;
}

/* Surprised — big round eyes */
.interio-avatar.surprised .interio-eye {
  width: 16px;
  height: 16px;
  box-shadow: 0 0 12px rgba(212, 185, 155, 0.8);
}

.interio-avatar.surprised .interio-pupil {
  width: 4px;
  height: 4px;
}

.interio-avatar.surprised .interio-mouth-bar:nth-child(1) {
  width: 10px;
}
.interio-avatar.surprised .interio-mouth-bar:nth-child(2) {
  width: 10px;
}
.interio-avatar.surprised .interio-mouth-bar:nth-child(3) {
  width: 10px;
}

/* ── Glow ───────────────────────────────────────────── */

.interio-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140%;
  height: 140%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  filter: blur(18px);
  background: radial-gradient(
    circle at center,
    rgba(212, 185, 155, 0.3) 0%,
    rgba(173, 142, 106, 0.1) 50%,
    transparent 70%
  );
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.35;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.65;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

/* ── Speech Bubble (glassmorphism) ──────────────────── */

.interio-bubble {
  position: absolute;
  z-index: 10000;
  max-width: 280px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  border-radius: 16px 16px 16px 4px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 13px 17px;
  border: 1px solid rgba(212, 185, 155, 0.3);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.interio-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

.bubble-content {
  font-family: 'Manrope', sans-serif;
  color: #2a2420;
  font-size: 13.5px;
  line-height: 1.45;
}

.bubble-tail {
  position: absolute;
  bottom: -7px;
  left: 16px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid rgba(255, 255, 255, 0.9);
}

/* ── Menu (glassmorphism) ───────────────────────────── */

.interio-menu {
  position: absolute;
  min-width: 200px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 10001;
  pointer-events: auto;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 185, 155, 0.25);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.13);
}

.interio-menu.show {
  display: flex;
}

.interio-menu-item {
  border: none;
  background: transparent;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  font-size: 13.5px;
  font-family: 'Manrope', sans-serif;
  padding: 9px 12px;
  border-radius: 8px;
  color: #2a2420;
  transition: background 0.15s ease;
}

.interio-menu-item:hover {
  background: rgba(212, 185, 155, 0.18);
}

.interio-menu-item i {
  width: 18px;
  color: #ad8e6a;
  font-size: 14px;
}

/* ── Sparkle Canvas ─────────────────────────────────── */

.interio-sparkles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9997;
}

/* ── Animations ─────────────────────────────────────── */

.interio-avatar.landing {
  animation: landBounce 0.5s ease;
}

@keyframes landBounce {
  0% {
    transform: scale(0.85);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Breathing (idle) — subtle bob */
.interio-avatar.idle .interio-body {
  animation: robotBreathe 3.5s ease-in-out infinite;
}

@keyframes robotBreathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

/* ── Chat Panel ─────────────────────────────────────── */

.interio-chat-container {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 360px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
  z-index: 10002;
  pointer-events: auto;
  border-radius: 20px 20px 16px 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(212, 185, 155, 0.2);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.14);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  visibility: hidden;
}

.interio-chat-container.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.interio-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(212, 185, 155, 0.2);
  border-radius: 20px 20px 0 0;
  background: linear-gradient(135deg, rgba(249, 243, 236, 0.95), rgba(240, 230, 218, 0.95));
}

.interio-chat-header-title {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #2a2420;
  display: flex;
  align-items: center;
  gap: 8px;
}

.interio-chat-header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4b99b, #ad8e6a);
  box-shadow: 0 0 8px rgba(173, 142, 106, 0.5);
  animation: dotPulse 3s ease-in-out infinite;
}

@keyframes dotPulse {
  0%,
  100% {
    opacity: 0.7;
    box-shadow: 0 0 6px rgba(173, 142, 106, 0.3);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 12px rgba(173, 142, 106, 0.6);
  }
}

.interio-chat-close {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  color: #9a8b7a;
  font-size: 16px;
  line-height: 1;
  border-radius: 6px;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.interio-chat-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #5a4d40;
}

.interio-chat-display {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  min-height: 180px;
  max-height: 320px;
  scroll-behavior: smooth;
}

.interio-chat-display::-webkit-scrollbar {
  width: 4px;
}

.interio-chat-display::-webkit-scrollbar-thumb {
  background: rgba(173, 142, 106, 0.3);
  border-radius: 2px;
}

.chat-msg {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 8px;
  max-width: 86%;
  word-wrap: break-word;
}

.chat-msg.user {
  background: linear-gradient(135deg, #f0e6da, #e8ddd0);
  color: #2a2420;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chat-msg.interio {
  background: rgba(249, 246, 242, 0.85);
  color: #3a3025;
  margin-right: auto;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(212, 185, 155, 0.12);
}

.chat-msg strong {
  font-weight: 600;
}

.chat-msg.interio-thinking {
  color: #9a8b7a;
  font-style: italic;
}

.interio-chat-divider {
  text-align: center;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  color: #7a6d60;
  padding: 8px 0;
}

.interio-chat-input-area {
  display: flex;
  gap: 8px;
  padding: 13px 15px;
  border-top: 1px solid rgba(212, 185, 155, 0.18);
}

.interio-chat-input {
  flex: 1;
  border: 1px solid rgba(212, 185, 155, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  color: #2a2420;
  background: rgba(250, 248, 245, 0.7);
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.interio-chat-input:focus {
  border-color: #ad8e6a;
  box-shadow: 0 0 0 3px rgba(173, 142, 106, 0.1);
}

.interio-chat-input::placeholder {
  color: #8a7d70;
}

.interio-chat-send-btn {
  border: none;
  background: linear-gradient(135deg, #d4b99b, #ad8e6a);
  cursor: pointer;
  padding: 8px 12px;
  color: #fff;
  font-size: 14px;
  border-radius: 10px;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  flex-shrink: 0;
}

.interio-chat-send-btn:hover {
  opacity: 0.85;
  transform: scale(1.05);
}

.interio-chat-upload-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  color: #ad8e6a;
  font-size: 16px;
  border-radius: 8px;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
  flex-shrink: 0;
}

.interio-chat-upload-btn:hover {
  background: rgba(212, 185, 155, 0.18);
  transform: scale(1.05);
}

/* ── Mobile ─────────────────────────────────────────── */

@media (max-width: 768px) {
  .interio-avatar {
    width: 58px;
    height: 66px;
  }

  .interio-bubble {
    max-width: 220px;
    padding: 11px 14px;
  }

  .bubble-content {
    font-size: 12px;
  }

  .interio-chat-container {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 20px 20px 0 0;
  }
}
