.pr-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #39C5B5;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pr-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.pr-chat-btn svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

.pr-chat-btn[data-open="true"] {
  display: none;
}

/* Unread dot */
.pr-chat-btn::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #e74c3c;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: pr-pulse 2s ease-in-out 3;
}

.pr-chat-btn.pr-opened::after {
  display: none;
}

@keyframes pr-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* Chat window */
.pr-chat-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  z-index: 100000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

/* Header */
.pr-chat-header {
  background: #2C3E55;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.pr-chat-header-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pr-chat-header-title svg {
  width: 20px;
  height: 20px;
}

.pr-chat-header-dot {
  width: 8px;
  height: 8px;
  background: #39C5B5;
  border-radius: 50%;
  display: inline-block;
}

.pr-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.pr-chat-close:hover {
  opacity: 1;
}

/* Messages area */
.pr-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #F8F9FA;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pr-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.pr-chat-msg a {
  color: inherit;
  text-decoration: underline;
}

.pr-chat-msg-bot {
  background: #E9ECEF;
  color: #2C3E55;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.pr-chat-msg-user {
  background: #39C5B5;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.pr-chat-typing {
  align-self: flex-start;
  display: none;
  gap: 4px;
  padding: 12px 16px;
  background: #E9ECEF;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.pr-chat-typing.pr-visible {
  display: flex;
}

.pr-chat-typing-dot {
  width: 8px;
  height: 8px;
  background: #9CA3AF;
  border-radius: 50%;
  animation: pr-typing 1.4s ease-in-out infinite;
}

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

@keyframes pr-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Input area */
.pr-chat-input-area {
  display: flex;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #E9ECEF;
  gap: 8px;
  flex-shrink: 0;
}

.pr-chat-input {
  flex: 1;
  border: 1px solid #D1D5DB;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.pr-chat-input:focus {
  border-color: #39C5B5;
}

.pr-chat-input::placeholder {
  color: #9CA3AF;
}

.pr-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #39C5B5;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.pr-chat-send:hover {
  background: #2fb3a4;
}

.pr-chat-send:disabled {
  background: #D1D5DB;
  cursor: not-allowed;
}

.pr-chat-send svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* Powered by */
.pr-chat-footer {
  text-align: center;
  padding: 6px;
  font-size: 11px;
  color: #9CA3AF;
  background: #fff;
  flex-shrink: 0;
}

/* Mobile */
@media (max-width: 768px) {
  .pr-chat-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 85vh;
    border-radius: 16px 16px 0 0;
  }

  .pr-chat-btn {
    bottom: 16px;
    right: 16px;
  }
}
