/* Chat Widget Styles */

/* Upload Progress Bar */
.chat-upload-progress {
  padding: 10px;
  background: #f0f0f1;
  border-radius: 4px;
  margin-bottom: 10px;
}

.chat-upload-progress-bar {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 5px;
}

.chat-upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2271b1 0%, #135e96 100%);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.chat-upload-progress-text {
  font-size: 12px;
  color: #666;
  display: block;
  text-align: center;
}

#chat-eshop-widget {
  position: fixed;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#chat-eshop-widget[data-position="bottom-right"] {
  bottom: 20px;
  right: 20px;
}

#chat-eshop-widget[data-position="bottom-left"] {
  bottom: 20px;
  left: 20px;
}

/* Toggle Button */
.chat-toggle-btn {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.chat-toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-toggle-btn:active {
  transform: scale(0.95);
}

.chat-toggle-btn .unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 80px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

#chat-eshop-widget[data-position="bottom-right"] .chat-window {
  right: 0;
}

#chat-eshop-widget[data-position="bottom-left"] .chat-window {
  left: 0;
}

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

/* Chat Header */
.chat-header {
  padding: 16px 20px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.chat-minimize-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.chat-minimize-btn:hover {
  opacity: 1;
}

/* Pre-chat Form */
.chat-pre-form {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.chat-welcome {
  margin: 0 0 20px 0;
  font-size: 15px;
  line-height: 1.5;
  color: #374151;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.form-group .required {
  color: #ef4444;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
}

.chat-submit-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-submit-btn:hover {
  opacity: 0.9;
}

.chat-submit-btn:active {
  transform: scale(0.98);
}

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

.chat-message {
  margin-bottom: 16px;
  display: flex;
  animation: fadeIn 0.3s ease;
}

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

.chat-message.customer {
  justify-content: flex-end;
}

.chat-message.owner {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message.customer .message-bubble {
  background: #3b82f6;
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.owner .message-bubble {
  background: white;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

.message-time {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.7;
}

/* Input Area */
.chat-input-area {
  padding: 16px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

#chat-message-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

#chat-message-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  transition: border-color 0.2s;
}

#chat-message-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.chat-input-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.chat-upload-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #6b7280;
  transition: all 0.2s;
}

.chat-upload-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.chat-upload-btn:active {
  transform: scale(0.95);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s;
}

.chat-send-btn:hover {
  opacity: 0.9;
}

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

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Image Preview */
.chat-image-preview {
  position: relative;
  margin-top: 8px;
  padding: 8px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.chat-image-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
  display: block;
}

.chat-remove-image-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s;
}

.chat-remove-image-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Message Image */
.chat-message-image {
  margin-top: 8px;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.chat-message-image img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: opacity 0.2s;
}

.chat-message-image img:hover {
  opacity: 0.9;
}

/* Theme Colors */
#chat-eshop-widget[data-theme="blue"] .chat-toggle-btn,
#chat-eshop-widget[data-theme="blue"] .chat-header,
#chat-eshop-widget[data-theme="blue"] .chat-submit-btn,
#chat-eshop-widget[data-theme="blue"] .chat-send-btn {
  background: #3b82f6;
}

#chat-eshop-widget[data-theme="green"] .chat-toggle-btn,
#chat-eshop-widget[data-theme="green"] .chat-header,
#chat-eshop-widget[data-theme="green"] .chat-submit-btn,
#chat-eshop-widget[data-theme="green"] .chat-send-btn {
  background: #10b981;
}

#chat-eshop-widget[data-theme="purple"] .chat-toggle-btn,
#chat-eshop-widget[data-theme="purple"] .chat-header,
#chat-eshop-widget[data-theme="purple"] .chat-submit-btn,
#chat-eshop-widget[data-theme="purple"] .chat-send-btn {
  background: #8b5cf6;
}

#chat-eshop-widget[data-theme="orange"] .chat-toggle-btn,
#chat-eshop-widget[data-theme="orange"] .chat-header,
#chat-eshop-widget[data-theme="orange"] .chat-submit-btn,
#chat-eshop-widget[data-theme="orange"] .chat-send-btn {
  background: #f59e0b;
}

#chat-eshop-widget[data-theme="red"] .chat-toggle-btn,
#chat-eshop-widget[data-theme="red"] .chat-header,
#chat-eshop-widget[data-theme="red"] .chat-submit-btn,
#chat-eshop-widget[data-theme="red"] .chat-send-btn {
  background: #ef4444;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  #chat-eshop-widget {
    bottom: 10px;
    right: 10px;
    left: 10px;
  }

  .chat-toggle-btn {
    width: 56px;
    height: 56px;
  }

  .chat-window {
    width: 100%;
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
    bottom: 70px;
    left: 0;
    right: 0;
    border-radius: 16px 16px 0 0;
  }
}

