/* Support Chat Widget Styles */

#support-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
}

/* Chat Button */
.support-chat-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.support-chat-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.support-chat-button:active {
  transform: scale(0.95);
}

.support-chat-icon {
  width: 28px;
  height: 28px;
}

.support-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  border-radius: 12px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

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

/* Header */
.support-chat-header {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.support-chat-header-content {
  flex: 1;
}

.support-chat-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.support-chat-subtitle {
  font-size: 13px;
  margin: 0;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.support-chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.support-chat-header-actions {
  display: flex;
  gap: 4px;
}

.support-chat-action-button {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.support-chat-action-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.support-chat-action-button svg {
  width: 18px;
  height: 18px;
}

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

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

.support-chat-close svg {
  width: 20px;
  height: 20px;
}

/* Messages Container */
.support-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.support-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.support-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.support-chat-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.support-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Welcome Message */
.support-chat-welcome {
  text-align: center;
  padding: 40px 20px;
}

.support-chat-welcome-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.support-chat-welcome h4 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 8px 0;
}

.support-chat-welcome p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

/* Message Bubbles */
.support-chat-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: messageSlide 0.2s ease;
}

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

.support-chat-message-user {
  align-self: flex-end;
}

.support-chat-message-support,
.support-chat-message-system,
.support-chat-message-status,
.support-chat-message-error {
  align-self: flex-start;
}

.support-chat-message-content {
  padding: 12px 16px;
  border-radius: 12px;
  word-wrap: break-word;
  line-height: 1.4;
  font-size: 14px;
}

.support-chat-message-user .support-chat-message-content {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.support-chat-message-support .support-chat-message-content {
  background: white;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

.support-chat-message-system .support-chat-message-content {
  background: #dbeafe;
  color: #1e40af;
  border-bottom-left-radius: 4px;
  font-size: 13px;
}

.support-chat-message-status .support-chat-message-content {
  background: #d1fae5;
  color: #065f46;
  border-bottom-left-radius: 4px;
  font-size: 13px;
  border: 1px solid #a7f3d0;
}

.support-chat-message-error .support-chat-message-content {
  background: #fee2e2;
  color: #991b1b;
  border-bottom-left-radius: 4px;
  font-size: 13px;
}

.support-chat-message-time {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
  padding: 0 4px;
}

.support-chat-message-user .support-chat-message-time {
  text-align: right;
}

/* Typing Indicator */
.support-chat-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.support-chat-typing span {
  width: 8px;
  height: 8px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.support-chat-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.support-chat-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

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

.support-chat-user-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.support-chat-input-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.support-chat-input-field:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Guest Intro Section - Beautiful Welcome UI */
.support-chat-guest-intro {
  margin-bottom: 16px;
  animation: fadeInSlide 0.4s ease;
}

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

.support-chat-guest-header {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}

.support-chat-guest-icon {
  font-size: 32px;
  margin-bottom: 8px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.support-chat-guest-title {
  font-size: 16px;
  font-weight: 600;
  color: #0c4a6e;
  margin-bottom: 4px;
}

.support-chat-guest-subtitle {
  font-size: 13px;
  color: #0369a1;
  line-height: 1.4;
}

.support-chat-guest-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.support-chat-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.support-chat-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.support-chat-field-label svg {
  color: #3b82f6;
  flex-shrink: 0;
}

.support-chat-field-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: white;
}

.support-chat-field-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.support-chat-field-input::placeholder {
  color: #9ca3af;
}

.support-chat-validation-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 12px;
  color: #dc2626;
  font-size: 12px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.support-chat-validation-error::before {
  content: '⚠️';
  flex-shrink: 0;
}

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

.support-chat-textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: border-color 0.2s ease;
}

.support-chat-textarea:focus {
  outline: none;
  border-color: #3b82f6;
}

.support-chat-send-button {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.support-chat-send-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

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

.support-chat-send-button svg {
  width: 20px;
  height: 20px;
}

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

  .support-chat-button {
    width: 56px;
    height: 56px;
  }

  .support-chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 80px);
    border-radius: 12px;
  }

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

  .support-chat-title {
    font-size: 16px;
  }

  .support-chat-subtitle {
    font-size: 12px;
  }

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