/* Chat Widget Styles */
.chat-widget {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
}

.chat-widget.open {
  display: flex;
}

/* Unread message badge */
.unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  border: 2px solid white;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h4 {
  margin: 0;
  font-size: 1.1rem;
  color: white;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  padding: 10px 15px;
  border-radius: 12px;
  max-width: 75%;
  word-wrap: break-word;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.sent {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  align-self: flex-end;
  margin-left: auto;
}

.chat-message.received {
  background: white;
  color: #333;
  align-self: flex-start;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-message-info {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 5px;
}

.chat-footer {
  padding: 15px;
  background: white;
  border-top: 1px solid #e0e0e0;
}

.chat-users {
  margin-bottom: 10px;
}

.chat-users label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 5px;
  color: #666;
  font-weight: 600;
}

.chat-users select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
}

.chat-input-container {
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s;
}

.chat-input:focus {
  border-color: #667eea;
}

.chat-send {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.chat-send:hover {
  transform: scale(1.1);
}

.chat-send:active {
  transform: scale(0.95);
}

.chat-empty {
  text-align: center;
  color: #999;
  padding: 40px 20px;
}

.chat-empty i {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.3;
}

.chat-loading {
  text-align: center;
  padding: 20px;
  color: #999;
}

.chat-error {
  background: #fff3cd;
  color: #856404;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .chat-widget {
    width: calc(100% - 20px);
    height: calc(100vh - 120px);
    right: 10px;
    bottom: 90px;
  }
}
