/* =========================================================
   PREMIUM DOCTOR LAUNCHER v3 - FINAL
   - Ψάχνει / κοιτάει δεξιά-αριστερά
   - Φαίνεται πιο προβληματισμένος
   - Ο φακός κινείται μαζί με το χέρι
   - Στο hover κρύβεται μέσα στο μπλε κυκλάκι
   - Πιο διακριτικό και καθαρό μήνυμα
========================================================= */

#chat-toggle.hcb-doctor-toggle {
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  z-index: 999999 !important;

  width: auto !important;
  height: auto !important;

  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;

  display: flex !important;
  align-items: flex-end !important;
  justify-content: flex-end !important;
  gap: 10px !important;

  cursor: pointer !important;
  overflow: visible !important;
  transform-origin: bottom right;

  animation: hcb3LauncherEnter 0.9s cubic-bezier(.22, 1, .36, 1);
}

#chat-toggle.hcb-doctor-toggle.hcb-launcher-hiding {
  animation: hcb3LauncherHide 0.34s ease forwards;
}

#chat-toggle.hcb-doctor-toggle.hcb-launcher-showing {
  animation: hcb3LauncherShow 0.55s cubic-bezier(.22, 1, .36, 1);
}

#chat-toggle.hcb-doctor-toggle::before,
#chat-toggle.hcb-doctor-toggle::after {
  display: none !important;
  content: none !important;
}

/* =========================
   MESSAGE BUBBLE
========================= */

.hcb-doctor-label {
  position: relative !important;
  z-index: 4 !important;

  min-width: 205px !important;
  max-width: 220px !important;
  padding: 12px 15px 12px 17px !important;

  background: rgba(255, 255, 255, 0.93) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border: 1px solid #dceaf6 !important;
  border-radius: 21px !important;

  box-shadow: 0 14px 28px rgba(16, 90, 170, 0.13) !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;

  animation: hcb3LabelFloat 4s ease-in-out infinite;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    filter 0.28s ease;
}

.hcb-doctor-label::after {
  content: "";
  position: absolute;
  right: -9px;
  bottom: 18px;

  width: 17px;
  height: 17px;

  background: rgba(255, 255, 255, 0.93);
  border-right: 1px solid #dceaf6;
  border-bottom: 1px solid #dceaf6;

  transform: rotate(-45deg);
  border-bottom-right-radius: 6px;
}

.hcb-label-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  margin-bottom: 4px;

  font-size: 9px;
  line-height: 1;
  font-weight: 900;
  color: #6b8299;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.hcb-label-kicker::before {
  content: "";
  width: 7px;
  height: 7px;

  border-radius: 50%;
  background: #2ee58f;
  box-shadow:
    0 0 0 4px rgba(46, 229, 143, 0.16),
    0 0 12px rgba(46, 229, 143, 0.34);
}

.hcb-doctor-label strong {
  font-size: 18px !important;
  line-height: 1.05 !important;
  font-weight: 950 !important;
  color: #0b58b3 !important;
  letter-spacing: 0.1px !important;
  text-transform: none !important;
}

.hcb-doctor-label small {
  display: block !important;

  margin-top: 5px !important;

  font-size: 10px !important;
  line-height: 1.3 !important;
  font-weight: 760 !important;
  color: #708196 !important;
}

#chat-toggle.hcb-doctor-toggle:hover .hcb-doctor-label {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 19px 36px rgba(16, 90, 170, 0.18) !important;
}

/* =========================
   SVG AREA
========================= */

.hcb-doctor-visual {
  position: relative !important;
  z-index: 5 !important;

  width: 158px !important;
  height: 158px !important;
  min-width: 158px !important;
  min-height: 158px !important;

  display: block !important;
  overflow: visible !important;
  pointer-events: none !important;

  filter: drop-shadow(0 18px 30px rgba(8, 90, 180, 0.22));
}

.hcb-doctor-svg {
  width: 158px !important;
  height: 158px !important;

  display: block !important;
  overflow: visible !important;
}

/* =========================
   DEFAULT: SEARCHING / THINKING
========================= */

.hcb3-doctor {
  transform-origin: 130px 136px;

  /*
   * Δεν βάζουμε animation εδώ, γιατί στο mouseleave
   * ο γιατρός εμφανίζεται απότομα.
   * Το κρύψιμο / εμφάνιση γίνεται με transition.
   */
  animation: none !important;

  transform: translate(0, 0) scale(1);
  opacity: 1;
  filter: blur(0);

  transition:
    transform 0.58s cubic-bezier(.22, 1, .36, 1),
    opacity 0.52s ease,
    filter 0.52s ease;
}

.hcb3-head {
  transform-origin: 130px 78px;
  animation: hcb3HeadSearchStrong 3.6s ease-in-out infinite;
  transition:
    transform 0.38s ease,
    opacity 0.34s ease;
}

.hcb3-arm-search {
  transform-origin: 128px 94px;
  animation: hcb3SearchArmStrong 1.9s ease-in-out infinite;
  transition:
    opacity 0.28s ease,
    transform 0.38s ease;
}

/* Το χέρι που κρατά τον φακό και ο φακός έχουν ίδιο animation */
.hcb3-arm-hold {
  transform-origin: 174px 102px;
  animation: hcb3LensAndHandSearch 1.9s ease-in-out infinite;
  transition:
    opacity 0.28s ease,
    transform 0.38s ease;
}

.hcb3-magnifier {
  transform-origin: 174px 102px;
  animation: hcb3LensAndHandSearch 1.9s ease-in-out infinite;
  transition:
    opacity 0.28s ease,
    transform 0.38s ease;
}

.hcb3-pupil-left,
.hcb3-pupil-right,
.hcb3-shine-left,
.hcb3-shine-right {
  animation: hcb3PupilLookStrong 3.6s ease-in-out infinite;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

.hcb3-brow-left,
.hcb3-brow-right {
  transform-origin: center;
  animation: hcb3BrowsThinkStrong 3.6s ease-in-out infinite;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

.hcb3-chat-button {
  transform-origin: 132px 191px;
  animation: hcb3ButtonPulse 2s ease-in-out infinite;
  transition:
    transform 0.38s ease,
    filter 0.38s ease;
}

.hcb3-sparkles {
  transform-origin: 130px 90px;
  animation: hcb3Sparkles 3.2s ease-in-out infinite;
}

/* Δεν θέλουμε happy arms πλέον */
.hcb3-happy-face,
.hcb3-happy-arms {
  opacity: 0 !important;
  pointer-events: none !important;
  display: none !important;
}

/* =========================
   HOVER: HIDE INTO BLUE BUTTON
========================= */

#chat-toggle.hcb-doctor-toggle:hover .hcb3-doctor {
  animation: none !important;
  transform: translate(22px, 45px) scale(0.48);
  opacity: 0.04;
  filter: blur(0.4px);
}

#chat-toggle.hcb-doctor-toggle:hover .hcb3-head,
#chat-toggle.hcb-doctor-toggle:hover .hcb3-arm-search,
#chat-toggle.hcb-doctor-toggle:hover .hcb3-arm-hold,
#chat-toggle.hcb-doctor-toggle:hover .hcb3-magnifier,
#chat-toggle.hcb-doctor-toggle:hover .hcb3-pupil-left,
#chat-toggle.hcb-doctor-toggle:hover .hcb3-pupil-right,
#chat-toggle.hcb-doctor-toggle:hover .hcb3-shine-left,
#chat-toggle.hcb-doctor-toggle:hover .hcb3-shine-right,
#chat-toggle.hcb-doctor-toggle:hover .hcb3-brow-left,
#chat-toggle.hcb-doctor-toggle:hover .hcb3-brow-right {
  animation-play-state: paused;
}

#chat-toggle.hcb-doctor-toggle:hover .hcb3-chat-button {
  transform: scale(1.13);
  filter: drop-shadow(0 12px 20px rgba(0, 130, 255, 0.28));
  animation: hcb3ButtonHoverPulse 0.95s ease-in-out infinite;
}

#chat-toggle.hcb-doctor-toggle:hover .hcb3-sparkles {
  opacity: 0.25;
}

/* =========================
   KEYFRAMES
========================= */

@keyframes hcb3LauncherEnter {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.88);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hcb3LauncherHide {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(24px) scale(0.82);
  }
}

@keyframes hcb3LauncherShow {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.82);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hcb3LabelFloat {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

@keyframes hcb3DoctorFloat {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* Πιο έντονο ψάξιμο / προβληματισμός */
@keyframes hcb3HeadSearchStrong {
  0%, 100% {
    transform: rotate(0deg) translateX(0);
  }

  12% {
    transform: rotate(-8deg) translateX(-5px);
  }

  28% {
    transform: rotate(-3deg) translateX(-2px);
  }

  50% {
    transform: rotate(4deg) translateX(4px);
  }

  70% {
    transform: rotate(8deg) translateX(6px);
  }

  86% {
    transform: rotate(2deg) translateX(2px);
  }
}

@keyframes hcb3SearchArmStrong {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }

  20% {
    transform: rotate(-8deg) translate(-3px, -3px);
  }

  45% {
    transform: rotate(4deg) translate(2px, 1px);
  }

  70% {
    transform: rotate(9deg) translate(5px, -2px);
  }
}

/* Ίδιο animation για χέρι + φακό ώστε να φαίνεται ότι τον κρατάει */
@keyframes hcb3LensAndHandSearch {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }

  16% {
    transform: translate(-4px, -3px) rotate(-10deg);
  }

  36% {
    transform: translate(2px, 0) rotate(-3deg);
  }

  56% {
    transform: translate(7px, -2px) rotate(8deg);
  }

  76% {
    transform: translate(-2px, 2px) rotate(-5deg);
  }
}

@keyframes hcb3PupilLookStrong {
  0%, 100% {
    transform: translate(0, 0);
  }

  15% {
    transform: translate(-3px, 0);
  }

  35% {
    transform: translate(1px, -2px);
  }

  55% {
    transform: translate(4px, 0);
  }

  75% {
    transform: translate(-2px, 2px);
  }
}

@keyframes hcb3BrowsThinkStrong {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }

  18% {
    transform: translateY(-2px) rotate(-4deg);
  }

  40% {
    transform: translateY(1px) rotate(2deg);
  }

  68% {
    transform: translateY(-1px) rotate(4deg);
  }
}

@keyframes hcb3ButtonPulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.04);
  }
}

@keyframes hcb3ButtonHoverPulse {
  0%, 100% {
    transform: scale(1.13);
  }

  50% {
    transform: scale(1.19);
  }
}

@keyframes hcb3Sparkles {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

/* Ο γιατρός μπαίνει μέσα στο μπλε κυκλάκι */
@keyframes hcb3DoctorHideInBubble {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
    filter: blur(0);
  }

  45% {
    transform: translate(10px, 18px) scale(0.78);
    opacity: 0.55;
    filter: blur(0);
  }

  100% {
    transform: translate(22px, 45px) scale(0.48);
    opacity: 0.04;
    filter: blur(0.4px);
  }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {
  #chat-toggle.hcb-doctor-toggle {
    right: 14px !important;
    bottom: 14px !important;
    gap: 8px !important;
  }

  .hcb-doctor-label {
    min-width: 175px !important;
    max-width: 188px !important;
    padding: 11px 13px !important;
  }

  .hcb-label-kicker {
    font-size: 8.5px !important;
  }

  .hcb-doctor-label strong {
    font-size: 17px !important;
  }

  .hcb-doctor-label small {
    font-size: 9.5px !important;
    line-height: 1.25 !important;
  }

  .hcb-doctor-visual,
  .hcb-doctor-svg {
    width: 122px !important;
    height: 122px !important;
    min-width: 122px !important;
    min-height: 122px !important;
  }
}
