/* ==========================================================================
   ACESPEED RECOVERY — FLOATING LIVE CHAT WIDGET
   ========================================================================== */

.livechat-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* Floating Action Button (FAB) */
.livechat-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB 0%, #06B6D4 100%);
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.35), 0 4px 12px rgba(0, 0, 0, 0.5);
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  outline: none;
}

.livechat-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.5), 0 4px 16px rgba(0, 0, 0, 0.6);
}

.livechat-trigger:active {
  transform: scale(0.95);
}

/* Radar pulse animation */
.livechat-trigger::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid #38BDF8;
  opacity: 0.8;
  animation: livechatRadar 2.4s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes livechatRadar {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.4);
    opacity: 0;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Status Indicator Dot */
.livechat-status-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #10B981;
  border: 2.5px solid #060B18;
  border-radius: 50%;
  box-shadow: 0 0 8px #10B981;
}

/* Trigger Icons */
.livechat-icon-chat,
.livechat-icon-close {
  position: absolute;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.livechat-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}

.livechat-wrapper.is-open .livechat-icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

.livechat-wrapper.is-open .livechat-icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.livechat-wrapper.is-open .livechat-trigger::before {
  animation: none;
  display: none;
}

/* Chat Prompt Bubble (Teaser before opening) */
.livechat-teaser {
  position: absolute;
  bottom: 72px;
  right: 0;
  background: rgba(10, 20, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 10px 16px;
  border-radius: 20px 20px 6px 20px;
  color: #F0F6FC;
  font-size: 0.825rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(6, 182, 212, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: teaserFloat 3s ease-in-out infinite;
}

.livechat-wrapper.is-open .livechat-teaser {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

@keyframes teaserFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Chat Card Window */
.livechat-card {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: rgba(8, 16, 32, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(6, 182, 212, 0.25);
  overflow: hidden;
  display: none;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.livechat-wrapper.is-open .livechat-card {
  display: block !important;
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

/* Card Header */
.livechat-header {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(6, 182, 212, 0.18) 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.livechat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.livechat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1E40AF 0%, #0284C7 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  position: relative;
  flex-shrink: 0;
}

.livechat-avatar img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.livechat-avatar-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #10B981;
  border: 2px solid #081020;
  border-radius: 50%;
  box-shadow: 0 0 6px #10B981;
}

.livechat-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #F0F6FC;
  letter-spacing: -0.01em;
}

.livechat-subtitle {
  font-size: 0.75rem;
  color: #38BDF8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.livechat-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94A3B8;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.livechat-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

/* Card Body */
.livechat-body {
  padding: 18px;
}

.livechat-welcome-msg {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  color: #CBD5E1;
  font-size: 0.825rem;
  line-height: 1.45;
  margin-bottom: 16px;
}

.livechat-welcome-msg p {
  margin: 0;
}

.livechat-channels-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
  font-weight: 600;
  margin-bottom: 10px;
}

.livechat-channels-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

/* Channel Link Card */
.livechat-channel-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.livechat-channel-btn:hover {
  transform: translateY(-2px);
}

/* Signal Button Styling */
.livechat-channel-signal {
  background: rgba(58, 118, 240, 0.1);
  border: 1.5px solid rgba(58, 118, 240, 0.35);
}

.livechat-channel-signal:hover {
  background: rgba(58, 118, 240, 0.18);
  border-color: #3A76F0;
  box-shadow: 0 6px 20px rgba(58, 118, 240, 0.25);
}

.livechat-channel-icon-signal {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #3A76F0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(58, 118, 240, 0.4);
}

/* Telegram Button Styling */
.livechat-channel-telegram {
  background: rgba(34, 158, 217, 0.1);
  border: 1.5px solid rgba(34, 158, 217, 0.35);
}

.livechat-channel-telegram:hover {
  background: rgba(34, 158, 217, 0.18);
  border-color: #229ED9;
  box-shadow: 0 6px 20px rgba(34, 158, 217, 0.25);
}

.livechat-channel-icon-telegram {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(34, 158, 217, 0.4);
}

.livechat-channel-text {
  flex-grow: 1;
}

.livechat-channel-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.livechat-channel-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-signal {
  background: rgba(58, 118, 240, 0.25);
  color: #93C5FD;
}

.badge-telegram {
  background: rgba(34, 158, 217, 0.25);
  color: #7DD3FC;
}

.livechat-channel-desc {
  font-size: 0.72rem;
  color: #94A3B8;
  margin-top: 2px;
}

.livechat-channel-arrow {
  color: #64748B;
  transition: transform 0.2s, color 0.2s;
}

.livechat-channel-btn:hover .livechat-channel-arrow {
  transform: translateX(3px);
  color: #38BDF8;
}

/* Card Footer / Disclaimer */
.livechat-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  padding: 10px 18px 14px;
  text-align: center;
  font-size: 0.68rem;
  color: #64748B;
  line-height: 1.35;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .livechat-wrapper {
    bottom: 16px;
    right: 16px;
  }
  .livechat-card {
    width: calc(100vw - 32px);
    right: 0;
    bottom: 70px;
  }
}
