/* Bazi420 Live Chat System Widget - Matching Reference Design */

:root {
  --bh-chat-primary-red: #d32f2f;
  --bh-chat-gradient-start: #e52d27;
  --bh-chat-gradient-end: #ef5350;
  --bh-chat-bg: #f8f9fa;
  --bh-chat-card-bg: #ffffff;
  --bh-chat-text-dark: #1e293b;
  --bh-chat-text-muted: #64748b;
  --bh-chat-accent-orange: #ff9800;
  --bh-chat-border: #e2e8f0;
}

/* Floating Launcher Icon & Girl Support Avatar */
#bh-chat-launcher-wrapper {
  position: fixed;
  bottom: 75px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 999999;
  cursor: pointer;
}

.bh-chat-avatar-head {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: #ffffff;
  cursor: pointer;
}

.bh-chat-avatar-head:hover {
  transform: scale(1.12);
}

.bh-chat-avatar-head img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bh-chat-avatar-online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #ffffff;
}

#bh-chat-launcher {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bh-chat-gradient-start), var(--bh-chat-gradient-end));
  box-shadow: 0 8px 24px rgba(211, 47, 47, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease;
}

#bh-chat-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 28px rgba(211, 47, 47, 0.5), 0 6px 16px rgba(0, 0, 0, 0.2);
}

#bh-chat-launcher svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
}

#bh-chat-launcher .bh-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff1744;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  padding: 0 4px;
}

/* Main Chat Widget Container */
#bh-chat-widget {
  position: fixed;
  bottom: 80px;
  right: 18px;
  width: 370px;
  height: 620px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 100px);
  background: var(--bh-chat-bg);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), 0 8px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  z-index: 999998;
  display: none;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  animation: bhChatSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Shift Angular float-widget & game entrance buttons up so they don't overlap bottom nav */
.float-widget, .game-entrance, .undraggable-group {
  margin-bottom: 50px !important;
}

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

/* Top Header Banner */
.bh-chat-header {
  background: linear-gradient(180deg, #d32f2f 0%, #ef5350 45%, #f8f9fa 100%);
  padding: 24px 20px 16px 20px;
  color: #ffffff;
  position: relative;
  flex-shrink: 0;
}

.bh-chat-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bh-chat-logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ff9800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.bh-chat-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.85;
  transition: opacity 0.2s;
  line-height: 1;
}

.bh-chat-close-btn:hover {
  opacity: 1;
}

.bh-chat-header-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  color: #ffffff;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Card inside Header - Send us a message */
.bh-chat-action-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

.bh-chat-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.bh-chat-action-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bh-chat-action-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.bh-chat-action-sub {
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
}

.bh-chat-action-arrow {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d32f2f;
  font-size: 18px;
}

/* Content Panel Views */
.bh-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
}

.bh-chat-view {
  display: none;
  flex: 1;
  flex-direction: column;
}

.bh-chat-view.active {
  display: flex;
}

/* Chat Conversation Stream */
.bh-chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bh-chat-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  margin-bottom: 4px;
}

.bh-chat-msg-row.user {
  align-self: flex-end;
  align-items: flex-end;
}

.bh-chat-msg-row.admin {
  align-self: flex-start;
  align-items: flex-start;
}

.bh-chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}

.bh-chat-msg-row.user .bh-chat-bubble {
  background: linear-gradient(135deg, #d32f2f, #ef5350);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(211, 47, 47, 0.25);
}

.bh-chat-msg-row.admin .bh-chat-bubble {
  background: #ffffff;
  color: #1e293b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

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

/* User Identification Input Bar (if guest) */
.bh-chat-guest-info {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bh-chat-guest-info input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  box-sizing: border-box;
}

/* Composer Form */
.bh-chat-composer {
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bh-chat-composer input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 12px;
  font-size: 13.5px;
  color: #1e293b;
  background: transparent;
}

.bh-chat-composer button {
  background: #d32f2f;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.bh-chat-composer button:hover {
  background: #b71c1c;
}

/* Help Articles View */
.bh-chat-help-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bh-chat-help-item {
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 500;
  color: #1e293b;
  transition: border-color 0.2s;
}

.bh-chat-help-item:hover {
  border-color: #d32f2f;
  color: #d32f2f;
}

/* Bottom Floating Navigation Pill */
.bh-chat-bottom-nav {
  margin: 10px 16px 4px 16px;
  background: #ffffff;
  border-radius: 20px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.bh-chat-nav-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 12px;
  transition: color 0.2s, background 0.2s;
}

.bh-chat-nav-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.bh-chat-nav-btn.active {
  color: #d32f2f;
}

/* Footer Tagline */
.bh-chat-footer-tag {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  padding-bottom: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.bh-chat-footer-tag strong {
  color: #64748b;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  #bh-chat-widget {
    right: 12px;
    bottom: 80px;
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
  }
}
