.chat-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 2000;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #10488b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(16, 72, 139, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.chat-fab-label {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  min-width: 180px;
  max-width: 190px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(16, 72, 139, 0.12);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: auto;
}

.chat-fab-label.is-hidden {
  display: none;
}

.chat-fab-label-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(16, 72, 139, 0.08);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.78rem;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease;
}

.chat-fab-label-close:hover {
  background: rgba(16, 72, 139, 0.14);
  color: #10488b;
}

.chat-fab-label-title {
  font-family: "Outfit", sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  color: #10488b;
  line-height: 1.1;
  padding-right: 18px;
}

.chat-fab-label-text {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  color: #475569;
  line-height: 1.3;
  padding-right: 8px;
}

.chat-fab:hover {
  transform: scale(1.1);
  background: #0c366a;
  box-shadow: 0 12px 36px rgba(16, 72, 139, 0.35);
}

.fab-icon {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: #fff;
}

.fab-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #10488b;
  animation: pulse 2.5s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}

.fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e53e3e;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border: 2px solid #fff;
}

.chat-window {
  position: fixed;
  bottom: 112px;
  right: 32px;
  z-index: 2000;
  width: 390px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid rgba(16, 72, 139, 0.15);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(16, 72, 139, 0.18), 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: none;
  animation: slideUp 0.3s ease;
  max-height: 85vh;
  flex-direction: column;
}

.chat-window.open { display: flex; }

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

.chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 85vh;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(16, 72, 139, 0.15);
  background: #10488b;
  flex-shrink: 0;
}

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

.agent-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.agent-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
  font-family: "Inter", sans-serif;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

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

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

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  background: #f5f8fc;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(16, 72, 139, 0.15);
  border-radius: 2px;
}

.msg {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: msgIn 0.3s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
  width: 34px;
  height: 34px;
  background: #10488b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-bubble {
  background: #fff;
  border: 1px solid rgba(16, 72, 139, 0.15);
  border-radius: 18px 18px 18px 4px;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  max-width: 85%;
  color: #0d1b2e;
  box-shadow: 0 2px 12px rgba(16, 72, 139, 0.08);
}

.user-msg { flex-direction: row-reverse; }

.user-msg .msg-bubble {
  background: #10488b;
  border-color: transparent;
  border-radius: 18px 18px 4px 18px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 72, 139, 0.2);
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -8px;
  padding-left: 44px;
}

.quick-btn {
  background: #fff;
  border: 1.5px solid rgba(16, 72, 139, 0.35);
  border-radius: 50px;
  padding: 7px 16px;
  font-size: 0.82rem;
  color: #10488b;
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.quick-btn:hover {
  background: #10488b;
  color: #fff;
  border-color: #10488b;
  transform: scale(1.03);
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: #8aa3c0;
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(16, 72, 139, 0.15);
  background: #fff;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: #f5f8fc;
  border: 1.5px solid rgba(16, 72, 139, 0.15);
  border-radius: 50px;
  padding: 11px 18px;
  color: #0d1b2e;
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input:focus {
  border-color: #10488b;
  box-shadow: 0 0 0 3px rgba(16, 72, 139, 0.1);
}

.chat-input::placeholder { color: #8aa3c0; }

.send-btn {
  width: 44px;
  height: 44px;
  background: #10488b;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:hover {
  background: #0c366a;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(16, 72, 139, 0.2);
}

.send-btn:disabled {
  opacity: 0.5;
  transform: none;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .chat-fab-label {
    min-width: 0;
    max-width: 170px;
    padding: 10px 12px;
    right: calc(100% + 10px);
  }

  .chat-fab-label-text {
    font-size: 0.72rem;
  }

  .chat-window {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 100px;
    border-radius: 20px;
  }

  .chat-fab {
    right: 20px;
    bottom: 20px;
  }
}
