/**
 * HADDAF Coach AI — Floating Chat Icon
 *
 * Lightweight stylesheet loaded on ALL frontend pages (not the Coach AI page itself).
 * Provides the fixed-position floating button that links to the Coach AI chatbot.
 */

/* ===== FLOATING BUTTON CONTAINER ===== */
#hcai-floating-icon {
  position: fixed;
  bottom: 90px; /* Moved up to avoid currency switcher */
  left: 28px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none !important;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  /* Entrance animation start state — JS will animate in */
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.4s ease;
}

#hcai-floating-icon.hcai-float--visible {
  transform: translateY(0);
  opacity: 1;
}

#hcai-floating-icon.hcai-float--hidden {
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
}


/* ===== CIRCULAR ICON BUTTON ===== */
.hcai-float-svg {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C9A84C 0%, #A8893A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    0 4px 16px rgba(201, 168, 76, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
}

.hcai-float-svg svg {
  width: 26px;
  height: 26px;
  color: #1A1814;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ===== PULSE RING ANIMATION ===== */
.hcai-float-svg::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(201, 168, 76, 0.5);
  animation: hcaiFloatPulse 2.5s ease-out infinite;
  pointer-events: none;
}

@keyframes hcaiFloatPulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  70%, 100% {
    transform: scale(1.35);
    opacity: 0;
  }
}


/* ===== HOVER STATES ===== */
#hcai-floating-icon:hover .hcai-float-svg {
  transform: scale(1.1);
  box-shadow:
    0 6px 24px rgba(201, 168, 76, 0.55),
    0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Stop pulse on hover — clean look */
#hcai-floating-icon:hover .hcai-float-svg::before {
  animation: none;
  opacity: 0;
}

#hcai-floating-icon:active .hcai-float-svg {
  transform: scale(0.95);
}


/* ===== EXPANDABLE LABEL (shown on hover) ===== */
.hcai-float-label {
  display: block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #FAF8F4;
  background: rgba(26, 24, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 0;
  border-radius: 12px;
  margin-left: 12px;
  transition: max-width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              padding 0.35s ease;
  direction: rtl;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

#hcai-floating-icon:hover .hcai-float-label {
  max-width: 280px;
  padding: 10px 20px;
}


/* ===== ACTIVE SUBSCRIBER BADGE ===== */
.hcai-float--active .hcai-float-svg::after {
  content: '';
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border: 2.5px solid #1A1814;
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}


/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  #hcai-floating-icon {
    bottom: 70px; /* Moved up to avoid currency switcher */
    left: 20px;
  }

  .hcai-float-svg {
    width: 52px;
    height: 52px;
    min-width: 52px;
  }

  .hcai-float-svg svg {
    width: 23px;
    height: 23px;
  }

  /* No label expansion on mobile — direct tap to navigate */
  .hcai-float-label {
    display: none !important;
  }
}


/* ===== PRINT — HIDE ENTIRELY ===== */
@media print {
  #hcai-floating-icon {
    display: none !important;
  }
}
