/**
 * QPS AG Website Chatbot Styles
 * Mobile-optimized with fullscreen overlay
 */

/* Chat Button - Fixed on left side */
.qps-chat-button {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066cc 0%, #004999 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 9998;
}

.qps-chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 102, 204, 0.6);
}

.qps-chat-button svg {
  color: white;
}

/* Overlay - Fullscreen on mobile */
.qps-chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.qps-chat-overlay.active {
  display: flex;
  opacity: 1;
}

/* Chat Container */
.qps-chat-container {
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Chat Header */
.qps-chat-header {
  background: linear-gradient(135deg, #0066cc 0%, #004999 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.qps-chat-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.qps-chat-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.qps-chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Messages Container */
.qps-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f5f5f5;
}

/* Individual Messages */
.qps-chat-message {
  margin-bottom: 16px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.qps-chat-message p {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
}

.qps-bot-message p {
  background: white;
  color: #333;
  border-bottom-left-radius: 4px;
}

.qps-user-message {
  text-align: right;
}

.qps-user-message p {
  background: linear-gradient(135deg, #0066cc 0%, #004999 100%);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

/* Input Container */
.qps-chat-input-container {
  padding: 16px;
  background: white;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.qps-chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease;
}

.qps-chat-input:focus {
  border-color: #0066cc;
}

.qps-chat-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066cc 0%, #004999 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.qps-chat-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.qps-chat-send:active {
  transform: scale(0.95);
}

/* Desktop Styles */
@media (min-width: 768px) {
  .qps-chat-container {
    width: 420px;
    height: 600px;
    max-height: 90vh;
    border-radius: 16px;
  }

  .qps-chat-header {
    border-radius: 16px 16px 0 0;
  }
}

/* Tablet Styles */
@media (min-width: 481px) and (max-width: 767px) {
  .qps-chat-container {
    width: 90%;
    height: 80%;
    border-radius: 12px;
  }

  .qps-chat-header {
    border-radius: 12px 12px 0 0;
  }
}

/* Mobile Optimization */
@media (max-width: 480px) {
  .qps-chat-button {
    width: 56px;
    height: 56px;
    left: 16px;
    bottom: 16px;
  }

  .qps-chat-container {
    border-radius: 0;
  }

  .qps-chat-header {
    padding: 16px;
  }

  .qps-chat-header h3 {
    font-size: 18px;
  }

  .qps-chat-messages {
    padding: 16px;
  }

  .qps-chat-input-container {
    padding: 12px;
  }

  .qps-chat-input {
    font-size: 16px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .qps-chat-button,
  .qps-chat-overlay,
  .qps-chat-message {
    animation: none;
    transition: none;
  }
}
