/* Chat Widget */
#chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
}

/* Chat Icon */
#chatbox-icon {
  width: 60px;
  height: 60px;
  background: #099386;
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chatbox-icon:hover {
  background: #1b5f90;
  transform: translateY(-3px);
}

#chatbox-icon .fa-comments {
  font-size: 24px;
}

#chatbox-icon .fa-times {
  display: none;
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 14px;
  background: rgba(255,255,255,0.2);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chat Container */
#chat-container {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 320px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 10px 50px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: #099386;
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h6 {
  margin: 0;
  font-weight: 600;
}

.chat-header .fa-times {
  cursor: pointer;
  opacity: 0.8;
}

.chat-header .fa-times:hover {
  opacity: 1;
}

.chat-messages {
  height: 250px;
  overflow-y: auto;
  padding: 15px;
  background: #f8f9fd;
}

.message {
  margin-bottom: 15px;
  padding: 10px 15px;
  border-radius: 8px;
  max-width: 80%;
}

.message.received {
  background: white;
  border-left: 4px solid #099386;
  margin-right: auto;
}

.message p {
  margin: 0;
  color: #2d3e50;
  font-size: 14px;
}

.message .time {
  font-size: 11px;
  color: #6c757d;
  display: block;
  margin-top: 5px;
}

.chat-input {
  padding: 15px;
  background: white;
  border-top: 1px solid #dee2e6;
  display: flex;
  gap: 10px;
}

.chat-input input {
  flex: 1;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: 8px 15px;
  font-size: 14px;
  outline: none;
}

.chat-input input:focus {
  border-color: #099386;
}

.chat-input button {
  border-radius: 20px;
  padding: 8px 15px;
  font-size: 14px;
  background: #099386;
  border: none;
}

.chat-input button:hover {
  background: #1b5f90;
}

/* Open state */
#chat-widget.open #chat-container {
  display: flex;
}

#chat-widget.open #chatbox-icon .fa-comments {
  display: block;
}

#chat-widget.open #chatbox-icon .fa-times {
  display: flex;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  #chat-widget {
    bottom: 20px;
    right: 20px;
  }

  #chatbox-icon {
    width: 50px;
    height: 50px;
  }

  #chat-container {
    width: 280px;
    right: -10px;
  }

  .chat-messages {
    height: 200px;
  }
}
