/* ===================================================
   NGUONX - LIVE CHAT SUPPORT WIDGET STYLING
   =================================================== */

/* Floating Button (Bottom Right) */
.live-chat-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
  cursor: pointer;
  z-index: 9998;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.live-chat-floating-btn:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.6);
}

.live-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: pulseBadge 1.5s infinite;
}

@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Chat Popup Window */
.live-chat-widget-box {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(2, 132, 199, 0.2);
  display: none;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  animation: chatSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.chat-widget-header {
  background: linear-gradient(135deg, #0284c7 0%, #075985 100%);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-support-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.chat-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #fff;
}

.chat-header-title {
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.2;
}

.chat-header-subtitle {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Container */
.chat-widget-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.chat-bubble-wrapper.user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble-wrapper.admin {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-sender-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 3px;
  padding: 0 4px;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.chat-bubble-wrapper.user .chat-bubble {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

.chat-bubble-wrapper.admin .chat-bubble {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 3px;
}

.chat-time-tag {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
  padding: 0 4px;
}

/* Input Area */
.chat-widget-input-area {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  height: 38px;
  border-radius: 20px;
  border: 1.5px solid #cbd5e1;
  padding: 0 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  background: #f8fafc;
}

.chat-input-field:focus {
  border-color: #0284c7;
  background: #ffffff;
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.chat-send-btn:hover {
  background: #0369a1;
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}
