/* ============================================= */
/* HUDHUD v4 - الهدهد المساعد ثلاثي الأبعاد */
/* 3D Hoopoe Bird - Duolingo Style */
/* ============================================= */

/* Container - bottom right only */
#hudhud-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* Character */
#hudhud-character {
  width: 100px;
  height: 100px;
  position: relative;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 8px 20px rgba(255,140,66,0.3));
}

#hudhud-character:hover {
  transform: scale(1.1) !important;
}

#hudhud-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Speech Bubble */
#hudhud-bubble {
  background: white;
  border-radius: 20px;
  padding: 14px 18px;
  box-shadow: 0 8px 30px rgba(255,140,66,0.25);
  max-width: 260px;
  min-width: 180px;
  opacity: 0;
  transform: scale(0.8) translateY(10px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  border: 2px solid rgba(255,140,66,0.3);
  position: relative;
}

#hudhud-bubble.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Speech toggle button */
#hudhud-speech-toggle {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 10;
  transition: transform 0.2s;
}

#hudhud-speech-toggle:hover {
  transform: scale(1.2);
}

/* Bubble close button */
#hudhud-bubble-close {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 22px;
  height: 22px;
  background: #FF4757;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255,71,87,0.4);
  transition: transform 0.2s;
}

#hudhud-bubble-close:hover {
  transform: scale(1.2);
}

/* Mobile */
@media (max-width: 768px) {
  #hudhud-container {
    bottom: 14px;
    right: 14px;
  }

  #hudhud-character {
    width: 80px;
    height: 80px;
  }

  #hudhud-bubble {
    max-width: 210px;
    min-width: 150px;
    padding: 10px 14px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  #hudhud-character {
    width: 65px;
    height: 65px;
  }
}
