/* ==============================================================================
   CONQUEST — BRAND LIVE CHAT WIDGET STYLES
   ============================================================================== */

/* Floating Launcher Trigger */
.conq-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  outline: none;
  user-select: none;
}

.conq-chat-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-color: var(--color-primary, #E91D3E);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(233, 29, 62, 0.35), 0 2px 8px rgba(37, 45, 61, 0.12);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.conq-chat-launcher:hover .conq-chat-btn {
  transform: scale(1.08) translateY(-2px);
  background-color: #252D3D;
  box-shadow: 0 14px 34px rgba(37, 45, 61, 0.28);
}

.conq-chat-btn-icon,
.conq-chat-btn-close {
  position: absolute;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.conq-chat-btn-icon {
  opacity: 1;
  transform: scale(1);
}

.conq-chat-btn-close {
  opacity: 0;
  transform: scale(0.6) rotate(-90deg);
}

.conq-chat-open .conq-chat-btn-icon {
  opacity: 0;
  transform: scale(0.6) rotate(90deg);
}

.conq-chat-open .conq-chat-btn-close {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Badge for Unread Messages */
.conq-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: #252D3D;
  color: #FFFFFF;
  border: 2px solid #FFFFFF;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  animation: conq-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes conq-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Chat Window Modal */
.conq-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background-color: #FFFFFF;
  border-radius: 20px;
  border: 1px solid rgba(37, 45, 61, 0.12);
  box-shadow: 0 24px 60px rgba(37, 45, 61, 0.18), 0 4px 16px rgba(37, 45, 61, 0.06);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  font-family: var(--font-primary, -apple-system, sans-serif);
}

.conq-chat-open .conq-chat-window {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.conq-chat-header {
  background: #252D3D;
  color: #FFFFFF;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.conq-chat-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #FFFFFF;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conq-chat-avatar-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.conq-chat-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background-color: #10B981;
  border: 2px solid #252D3D;
  border-radius: 50%;
}

.conq-chat-header-text h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.conq-chat-header-status {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.conq-chat-header-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10B981;
  animation: conq-pulse 1.8s infinite;
}

@keyframes conq-pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.conq-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.conq-chat-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #FFFFFF;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

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

/* Chat Body */
.conq-chat-body {
  flex: 1;
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FDFCF9;
  scroll-behavior: smooth;
}

.conq-chat-body::-webkit-scrollbar {
  width: 5px;
}
.conq-chat-body::-webkit-scrollbar-thumb {
  background: rgba(37, 45, 61, 0.15);
  border-radius: 10px;
}

/* Message Bubble */
.conq-chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: conq-msg-in 0.25s ease-out;
}

@keyframes conq-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.conq-chat-msg.msg-admin {
  align-self: flex-start;
}

.conq-chat-msg.msg-visitor {
  align-self: flex-end;
}

.conq-chat-bubble {
  padding: 11px 15px;
  font-size: 0.875rem;
  line-height: 1.48;
  word-break: break-word;
}

.conq-chat-msg.msg-admin .conq-chat-bubble {
  background: #FFFFFF;
  color: #252D3D;
  border: 1px solid rgba(37, 45, 61, 0.1);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 2px 8px rgba(37, 45, 61, 0.04);
}

.conq-chat-msg.msg-visitor .conq-chat-bubble {
  background: #E91D3E;
  color: #FFFFFF;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 4px 12px rgba(233, 29, 62, 0.2);
}

.conq-chat-time {
  font-size: 0.6875rem;
  color: rgba(37, 45, 61, 0.45);
  margin-top: 4px;
  padding: 0 4px;
}

.conq-chat-msg.msg-visitor .conq-chat-time {
  align-self: flex-end;
}

/* Quick Prompt Chips */
.conq-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.conq-chat-chip {
  background: #FFFFFF;
  border: 1px solid rgba(37, 45, 61, 0.15);
  color: #252D3D;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.conq-chat-chip:hover {
  border-color: #E91D3E;
  color: #E91D3E;
  background: rgba(233, 29, 62, 0.04);
  transform: translateY(-1px);
}

/* Chat Footer / Input */
.conq-chat-footer {
  padding: 12px 16px 14px;
  background: #FFFFFF;
  border-top: 1px solid rgba(37, 45, 61, 0.08);
}

.conq-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F7F5F0;
  border: 1px solid rgba(37, 45, 61, 0.12);
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.conq-chat-form:focus-within {
  border-color: #E91D3E;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(233, 29, 62, 0.12);
}

.conq-chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.875rem;
  color: #252D3D;
  padding: 8px 0;
}

.conq-chat-input::placeholder {
  color: rgba(37, 45, 61, 0.45);
}

.conq-chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E91D3E;
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.conq-chat-send-btn:hover {
  background: #252D3D;
  transform: scale(1.05);
}

.conq-chat-send-btn svg {
  transform: translate(1px, -1px);
}

/* Direct Channel Helper */
.conq-chat-helper-links {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: rgba(37, 45, 61, 0.5);
  padding: 0 4px;
}

.conq-chat-helper-link {
  color: #25D366;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.conq-chat-helper-link:hover {
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .conq-chat-launcher {
    bottom: calc(86px + env(safe-area-inset-bottom, 12px));
    right: 16px;
  }
}

@media (max-width: 480px) {
  .conq-chat-window {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .conq-chat-launcher {
    bottom: calc(84px + env(safe-area-inset-bottom, 12px));
    right: 14px;
  }
  .conq-chat-btn {
    width: 50px;
    height: 50px;
  }
}
