/* Landing widget — trích từ chat8x.html (LiveChat 8Xbet) */

:root {
  --8x-bg: #f8f8f8;
  --8x-card: #ffffff;
  --8x-text: #111111;
  --8x-muted: rgba(17, 17, 17, 0.7);
  --8x-primary: #4c9eea;
  --8x-cta: #57a3eb;
  --8x-online: #268750;
  --8x-bubble-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --8x-card-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

body.theme-body:not(.chat-active) {
  background: var(--8x-bg);
  color: #111;
}

.widget-landing {
  width: 100%;
  max-width: 420px;
  min-height: 100dvh;
  margin-inline: auto;
  padding: calc(10px + var(--safe-top)) 12px calc(12px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

.widget-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom));
}

.widget-top {
  min-height: 40px;
  display: flex;
  align-items: flex-start;
  padding: 4px 2px 8px;
}

.widget-menu-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #666;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0;
}
.widget-menu-btn:hover { color: var(--8x-primary); }
.widget-menu-btn[aria-expanded="true"] { color: var(--8x-primary); }

.agent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 8px 16px;
  padding: 14px 16px;
  background: var(--8x-card);
  border-radius: 16px;
  box-shadow: var(--8x-card-shadow);
}

.agent-avatar {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.agent-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #fff;
}

.agent-online {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--8x-online);
  border: 2px solid #fff;
}

.agent-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.agent-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--8x-text);
  line-height: 1.2;
}

.agent-title {
  font-size: 0.8125rem;
  color: var(--8x-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0 4px;
  margin-bottom: auto;
}

.widget-message-logo {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 8px;
  background: #fff;
}

.widget-bubble {
  flex: 1;
  padding: 12px 14px;
  background: var(--8x-card);
  border-radius: 14px;
  box-shadow: var(--8x-bubble-shadow);
}

.widget-bubble p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--8x-text);
}

.widget-contacts {
  margin: 12px 4px;
  animation: widget-fade-in 0.25s ease;
}

.widget-channels-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #888;
}

.widget-cta-wrap {
  padding: 8px 4px 0;
  margin-top: auto;
}

.widget-login {
  margin-top: auto;
  padding: 8px 4px 0;
  animation: widget-fade-in 0.25s ease;
}

.widget-login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-login-label {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}

.widget-login-input-wrap {
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #fff;
}

.widget-login-input-wrap:focus-within {
  border-color: var(--8x-primary);
  box-shadow: 0 0 0 3px rgba(76, 158, 234, 0.15);
}

.widget-login-input {
  width: 100%;
  border: none;
  background: transparent;
  color: #111;
  font: inherit;
  font-size: 15px;
  padding: 13px 0;
  outline: none;
}

.widget-login-input::placeholder { color: #9ca3af; }

.widget-login-notice {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}

.widget-login-submit {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--8x-text);
  background: var(--8x-cta);
  cursor: pointer;
}
.widget-login-submit:hover { filter: brightness(1.04); }
.widget-login-submit:active { transform: scale(0.98); }

.widget-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--8x-text);
  background: var(--8x-cta);
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.widget-cta:hover { filter: brightness(1.04); }
.widget-cta:active { transform: scale(0.98); }

.widget-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
  padding: 8px 0 4px;
  font-size: 11px;
  color: #999;
  text-decoration: none;
}
.widget-powered:hover { color: #666; }
.widget-powered svg { display: block; }

@keyframes widget-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card liên hệ trên landing — nền sáng */
.widget-landing .card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #111;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.widget-landing .card:hover {
  background: #fafafa;
  border-color: rgba(76, 158, 234, 0.35);
}
.widget-landing .card-title { color: #111; }
.widget-landing .card-desc { color: #666; }
.widget-landing .contact-empty-theme { color: #888; }

.widget-channels {
  margin: 12px 4px;
  animation: widget-fade-in 0.25s ease;
}

.widget-login-channel {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1565c0;
  text-align: center;
  line-height: 1.4;
}

.widget-login-back {
  width: 100%;
  border: 0;
  background: transparent;
  color: #6b7280;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0 0;
}
.widget-login-back:hover { color: var(--8x-primary); }

/* Card kênh CSKH trên landing */
.widget-landing .card-chat {
  min-height: 72px;
}
.widget-landing .card-chat .card-title { color: #111; font-size: 13px; }
.widget-landing .card-chat .card-desc { color: #666; }
.widget-landing .card-chat .card-arrow { color: var(--8x-primary); }

