/* Contact Floating Widget - Left Side Toggle, Default Open */
.qq-widget {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Circular toggle button */
.qq-widget-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1a1a2e;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 2;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}

.qq-widget-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.18);
}

.qq-widget-btn:active {
  transform: scale(0.95);
}

.qq-widget-btn svg {
  width: 28px;
  height: 28px;
  display: block;
}

/* Pulse ring */
.qq-widget-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.06);
  animation: qq-pulse 2.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes qq-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.4; }
}

/* Card panel */
.qq-widget-card {
  position: absolute;
  left: 64px;
  top: 50%;
  transform: translateY(-50%);
  width: 260px;
  background: linear-gradient(145deg, #1a1a2e 0%, #13131f 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.04) inset;
  padding: 22px 20px 18px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease,
              transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              visibility 0.25s;
}

.qq-widget:not(.show-card) .qq-widget-card {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(-12px) scale(0.95);
}

/* Card close button */
.qq-widget-card-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background 0.2s ease;
}

.qq-widget-card-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.qq-widget-card-close svg {
  width: 12px;
  height: 12px;
  display: block;
}

/* Card header */
.qq-widget-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 14px;
}

.qq-widget-card-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1e90ff, #0d6efd);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qq-widget-card-header-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.qq-widget-card-header-text h3 {
  font-size: 14px;
  font-weight: 600;
  color: #f0f0f0;
  margin: 0;
  line-height: 1.3;
}

/* Online status indicator */
.qq-widget-online {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

.qq-widget-online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

/* Contact button */
.qq-widget-btn-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  color: inherit;
  font: inherit;
  text-decoration: none;
  box-sizing: border-box;
}

.qq-widget-btn-chat:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.qq-widget-btn-chat:active {
  background: rgba(255, 255, 255, 0.05);
}

.qq-widget-btn-chat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qq-widget-btn-chat-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.qq-widget-btn-chat-info {
  flex: 1;
  text-align: left;
}

.qq-widget-btn-chat-info .name {
  font-size: 13px;
  font-weight: 500;
  color: #e8e8e8;
  display: block;
  line-height: 1.3;
}

.qq-widget-btn-chat-info .desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  display: block;
  line-height: 1.3;
  margin-top: 1px;
}

/* Arrow hint */
.qq-widget-btn-chat-arrow {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.qq-widget-btn-chat:hover .qq-widget-btn-chat-arrow {
  transform: translateX(2px);
}

.qq-widget-btn-chat-arrow svg {
  width: 12px;
  height: 12px;
  display: block;
  color: rgba(255, 255, 255, 0.25);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .qq-widget {
    left: 10px;
  }

  .qq-widget-card {
    width: 230px;
    padding: 16px 14px 14px;
  }

  .qq-widget-card-header-text h3 {
    font-size: 13px;
  }
}

/* Hidden state */
.qq-widget.is-hidden {
  display: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .qq-widget-btn,
  .qq-widget-btn::before,
  .qq-widget-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  .qq-widget-btn::before {
    display: none;
  }
}
