#openChatBtn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #ff4081;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: all 0.3s;
  z-index: 999;
}
#openChatBtn:hover {
  background-color: #ff679d;
}

/* Chat Window */
.chat-container {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 320px;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  overflow: hidden;
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hidden {
  transform: scale(0.95);
  opacity: 0;
  pointer-events: none;
}

/* Header */
.chat-header {
  background: #ff4081;
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.chat-header button {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

/* Messages */
.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #fff7f9;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}
.sent {
  align-self: flex-end;
  background: #ff4081;
  color: white;
  border-bottom-right-radius: 4px;
}
.received {
  align-self: flex-start;
  background: #f1f1f1;
  color: #333;
  border-bottom-left-radius: 4px;
}
.empty-state {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-top: 50px;
}

/* Input Bar */
.chat-input {
  display: flex;
  border-top: 1px solid #eee;
  padding: 8px;
  background: white;
}
.chat-input input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 20px;
  outline: none;
  font-size: 14px;
}
.chat-input button {
  margin-left: 8px;
  background: #ff4081;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}
.chat-input button:hover {
  background: #ff679d;
}

.admin #openChatBtn {
    display: none;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 1024px) {
  .chat-container {
    border-radius: 0;
    height: 100vh;
    margin-top: 0;
  }

  .chat-header {
    font-size: 0.9rem;
    padding: 10px;
  }

  .chat-input-area {
    padding: 8px;
  }

  .chat-input-area input {
    font-size: 0.9rem;
    padding: 8px;
  }

  .chat-input-area button {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .message {
    font-size: 0.9rem;
    max-width: 85%;
  }
}
