/* ========================================
   FLOATING CHAT WIDGET
   ======================================== */

.chat-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Main trigger button */
.chat-widget__trigger {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e63946, #c1121f);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 28px rgba(230,57,70,0.5), 0 0 0 0 rgba(230,57,70,0.4);
  animation: chat-pulse 2.4s infinite;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 2;
}

.chat-widget__trigger:hover {
  transform: scale(1.12);
}

.chat-widget__trigger.open {
  background: linear-gradient(135deg, #4361ee, #7209b7);
  animation: none;
  box-shadow: 0 6px 28px rgba(67,97,238,0.5);
}

.chat-widget__icon {
  font-size: 1.5rem;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
  position: absolute;
}

.chat-widget__icon--chat { opacity: 1; transform: scale(1) rotate(0deg); }
.chat-widget__icon--close { opacity: 0; transform: scale(0.4) rotate(-90deg); }

.chat-widget__trigger.open .chat-widget__icon--chat {
  opacity: 0;
  transform: scale(0.4) rotate(90deg);
}
.chat-widget__trigger.open .chat-widget__icon--close {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Live badge */
.chat-widget__live {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #06d6a0;
  color: #000;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 2px solid #0d0d0d;
  animation: live-blink 1.8s infinite;
}

/* Options panel */
.chat-widget__options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.chat-widget__option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.chat-widget__option:nth-child(2) {
  transition-delay: 0.06s;
}

.chat-widget__options.open .chat-widget__option {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.chat-widget__option-label {
  background: rgba(10,10,20,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  color: #f8f9fa;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 50px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.chat-widget__option-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.chat-widget__option:hover .chat-widget__option-btn {
  transform: scale(1.1);
}

.chat-widget__option-btn--telegram {
  background: linear-gradient(135deg, #0088cc, #005f8e);
}

.chat-widget__option-btn--whatsapp {
  background: linear-gradient(135deg, #25d366, #128c3c);
}

/* Ripple ring on trigger */
.chat-widget__ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(230,57,70,0.35);
  animation: ring-expand 2.4s infinite;
  pointer-events: none;
}

.chat-widget__ring:nth-child(2) {
  animation-delay: 0.8s;
}

/* Tooltip on hover (desktop) */
.chat-widget__tooltip {
  position: absolute;
  right: 72px;
  bottom: 50%;
  transform: translateY(50%);
  background: rgba(10,10,20,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  color: #f8f9fa;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.chat-widget__tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -5px;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: rgba(10,10,20,0.95);
  border-right: 1px solid rgba(255,255,255,0.12);
  border-top: 1px solid rgba(255,255,255,0.12);
}

.chat-widget__trigger:not(.open):hover .chat-widget__tooltip {
  opacity: 1;
}

/* ---- Keyframes ---- */
@keyframes chat-pulse {
  0%   { box-shadow: 0 6px 28px rgba(230,57,70,0.5), 0 0 0 0 rgba(230,57,70,0.4); }
  60%  { box-shadow: 0 6px 28px rgba(230,57,70,0.5), 0 0 0 18px rgba(230,57,70,0); }
  100% { box-shadow: 0 6px 28px rgba(230,57,70,0.5), 0 0 0 0 rgba(230,57,70,0); }
}

@keyframes ring-expand {
  0%   { opacity: 0.7; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.7); }
}

@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@media (max-width: 480px) {
  .chat-widget {
    bottom: 18px;
    right: 18px;
  }
  .chat-widget__trigger {
    width: 54px;
    height: 54px;
  }
}
