.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 700000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/*.contact {
  width: 60px;
  height: 60px;
  background: #007bff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

  .contact:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.5);
  }

  .contact::before {
    content: '💬';
    font-size: 28px;
  }*/

.chat-container {
  display: none;
  flex-direction: column;
  width: 380px;
  height: 600px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.chat-header {
  background: #003767;
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 18px;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

  .chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
  }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
}

.message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.human-message {
  background: #007bff;
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.agent-message, .bot-message {
  background: white;
  color: #333;
  margin-right: auto;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.system-message {
  background: #e9ecef;
  color: #6c757d;
  margin: 0 auto;
  text-align: center;
  font-size: 0.9em;
  max-width: 90%;
}

.nickname {
  font-size: 0.75em;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.human-message .nickname {
  color: rgba(255, 255, 255, 0.9);
}

.agent-message .nickname, .bot-message .nickname {
  color: #007bff;
}

.message .timestamp {
  font-size: 10px;
  opacity: 0.6;
  font-weight: normal;
  margin-left: auto;
}

.human-message .timestamp {
  color: rgba(255, 255, 255, 0.7);
}

.bot-message .timestamp,
.agent-message .timestamp {
  color: #999;
}

.typing-indicator-area {
  min-height: 20px;
  padding: 0 20px;
}

#typingIndicator {
  color: #6c757d;
  font-size: 0.9em;
  font-style: italic;
  padding: 8px 0;
}

.chat-input-area {
  background: white;
  border-top: 1px solid #e9ecef;
  padding: 12px;
}

.file-info {
  font-size: 0.85em;
  color: #6c757d;
  margin-bottom: 8px;
  padding: 0 4px;
}

.file-upload-progress {
  margin-bottom: 8px;
  display: none;
}

  .file-upload-progress.active {
    display: block;
  }

.progress-text {
  font-size: 0.85em;
  color: #6c757d;
  margin-bottom: 4px;
}

.progress-bar-container {
  background: #e9ecef;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  background: #007bff;
  height: 100%;
  width: 0%;
  transition: width 0.3s;
}

.input-container {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.input-wrapper {
  flex: 1;
}

#messageInput {
  width: 100%;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  max-height: 120px;
  overflow-y: auto;
}

  #messageInput:focus {
    outline: none;
    border-color: #007bff;
  }

.input-buttons {
  display: flex;
  gap: 8px;
}

.file-button, .send-button {
  padding: 10px 20px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.file-button {
  background: #e9ecef;
  color: #495057;
}

  .file-button:hover {
    background: #dee2e6;
  }

.send-button {
  background: #003767;
  color: white;
}

  .send-button:hover {
    background: #0056b3;
  }

  .send-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
  }

#fileInput {
  display: none;
}

.message-attachment {
  margin-top: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

  .message-attachment a {
    color: inherit;
    text-decoration: none;
  }

    .message-attachment a:hover {
      text-decoration: underline;
    }

.quick-reply-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.quick-reply-button {
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  transition: all 0.2s;
}

  .quick-reply-button:hover {
    background: #e9ecef;
    border-color: #007bff;
  }

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

  .chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
  }

/* Mobile responsiveness */
@media (max-width: 480px) {
  .chat-container {
    width: 100vw;
    height: 100%;
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }

  /*.contact {
    width: 56px;
    height: 56px;
    bottom: 15px;
    right: 15px;
  }*/

  .message {
    max-width: 85%;
  }
}
