/**
 * AI Chat Widget Styles
 */

/* Chat Button */
.ai-chat-button {
  position: fixed !important;
  bottom: 20px;
  right: 20px;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4), 0 0 0 0 rgba(102, 126, 234, 0.5);
  z-index: 9998;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 14px;
  animation: pulseGlow 2s ease-in-out infinite;
  visibility: visible !important;
  opacity: 1 !important;
}

.ai-chat-button::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0.3;
  z-index: -1;
  animation: ripple 2s ease-out infinite;
  pointer-events: none;
}

.ai-chat-button::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0.2;
  z-index: -2;
  animation: ripple 2s ease-out infinite 0.5s;
  pointer-events: none;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4), 0 0 0 0 rgba(102, 126, 234, 0.5);
  }
  50% {
    box-shadow: 0 4px 25px rgba(102, 126, 234, 0.6), 0 0 0 8px rgba(102, 126, 234, 0);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0.8);
    opacity: 0.3;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.ai-chat-button img {
  filter: brightness(0) invert(1);
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: float 3s ease-in-out infinite;
  position: relative;
  z-index: 10;
  display: block;
}

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

.ai-chat-button:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6), 0 0 0 4px rgba(102, 126, 234, 0.2);
  animation: none;
}

.ai-chat-button:hover::before,
.ai-chat-button:hover::after {
  animation: none;
  opacity: 0;
}

.ai-chat-button:hover img {
  transform: scale(1.1) rotate(-5deg);
  animation: none;
}

.ai-chat-button:active {
  transform: scale(1.05);
  box-shadow: 0 2px 15px rgba(102, 126, 234, 0.5);
}

.ai-chat-button.active {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 4px 20px rgba(240, 147, 251, 0.5), 0 0 0 0 rgba(240, 147, 251, 0.6);
  animation: pulseGlowActive 2s ease-in-out infinite;
}

@keyframes pulseGlowActive {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(240, 147, 251, 0.5), 0 0 0 0 rgba(240, 147, 251, 0.6);
  }
  50% {
    box-shadow: 0 4px 25px rgba(240, 147, 251, 0.7), 0 0 0 8px rgba(240, 147, 251, 0);
  }
}

.ai-chat-button.active::before {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ai-chat-button.active::after {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ai-chat-button.ai-chat-position-right {
  right: 20px;
  left: auto;
}

.ai-chat-button.ai-chat-position-left {
  right: auto;
  left: 20px;
}

/* Chat Window */
.ai-chat-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 110px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
  overflow: hidden;
}

.ai-chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ai-chat-window.ai-chat-position-right {
  right: 20px;
  left: auto;
}

.ai-chat-window.ai-chat-position-left {
  right: auto;
  left: 20px;
}

/* Chat Header */
.ai-chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 16px 16px 0 0;
}

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
}

.ai-chat-title-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  filter: invert(1);
}

.ai-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-chat-new-chat {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: 6px;
  font-size: 14px;
  width: 24px;
  height: 24px;
}
.ai-chat-new-chat img {
  filter: brightness(0) invert(1);
}

.ai-chat-new-chat:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.ai-chat-close {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  width: 24px;
  height: 24px;
}

.ai-chat-close img {
  filter: brightness(0) invert(1);
}

.ai-chat-close:hover {
  transform: rotate(90deg);
}

/* Messages Container */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f5f7fa;
	font-size: 13px;
}

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

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

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

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Welcome Message */
.ai-chat-welcome {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.ai-chat-welcome-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: block;
}

.ai-chat-welcome p {
  font-size: 16px;
  margin: 0;
}

/* Message */
.ai-chat-message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

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

.ai-chat-message-user {
  flex-direction: row-reverse;
}

.ai-chat-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px;
}

.ai-chat-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ai-chat-message-user .ai-chat-message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ai-chat-message-user .ai-chat-message-avatar img {
  filter: brightness(0) invert(1);
}

.ai-chat-message-assistant .ai-chat-message-avatar {
  background: #e0e0e0;
}

.ai-chat-message-content {
  flex: 1;
  min-width: 0;
}

.ai-chat-message-text {
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  word-wrap: break-word;
  line-height: 1.6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Markdown Styles */
.ai-chat-message-text p {
  margin: 0 0 8px 0;
}

.ai-chat-message-text p:last-child {
  margin-bottom: 0;
}

.ai-chat-message-text strong,
.ai-chat-message-text b {
  font-weight: 600;
  color: inherit;
}

.ai-chat-message-text em,
.ai-chat-message-text i {
  font-style: italic;
  color: inherit;
}

.ai-chat-message-text code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9em;
  color: #e83e8c;
}

.ai-chat-message-user .ai-chat-message-text code {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.ai-chat-message-text pre {
  background: #f5f5f5;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
  border: 1px solid #e0e0e0;
}

.ai-chat-message-user .ai-chat-message-text pre {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.ai-chat-message-text pre code {
  background: transparent;
  padding: 0;
  color: #333;
  font-size: 0.85em;
  line-height: 1.5;
}

.ai-chat-message-user .ai-chat-message-text pre code {
  color: #fff;
}

.ai-chat-message-text a {
  color: #FFF;
  text-decoration: none;
  transition: border-color 0.2s;
}

.ai-chat-message-text a:hover {
  border-bottom-color: #667eea;
}

.ai-chat-message-user .ai-chat-message-text a {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.ai-chat-message-user .ai-chat-message-text a:hover {
  border-bottom-color: #fff;
}

.ai-chat-message-text ul,
.ai-chat-message-text ol {
  margin: 8px 0;
  padding-right: 24px;
  padding-left: 0;
}

.ai-chat-message-text li {
  margin: 4px 0;
  line-height: 1.6;
}

.ai-chat-message-text ul {
  list-style-type: disc;
}

.ai-chat-message-text ol {
  list-style-type: decimal;
}

.ai-chat-message-user .ai-chat-message-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.ai-chat-message-assistant .ai-chat-message-text {
  background: #fff;
  color: #333;
}

.ai-chat-message.error .ai-chat-message-text {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

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

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

/* Typing Indicator */
.ai-chat-typing-indicator {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.ai-chat-typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
  animation: typing 1.4s infinite;
}

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

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

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

/* Input Container */
.ai-chat-input-container {
  padding: 10px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-chat-input-container > *:first-child {
  order: 2;
}

.ai-chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  width: 100%;
}

.ai-chat-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 5px 10px !important;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  outline: none;
  transition: border-color 0.2s;
}

.ai-chat-input:focus {
  border-color: #667eea;
}

.ai-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 10px;
}

.ai-chat-send img {
  filter: brightness(0) invert(1);
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ai-chat-send:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

/* Image Upload Button */
.ai-chat-image-upload {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 8px;
}

.ai-chat-image-upload img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(40%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0.6) contrast(1);
  transition: filter 0.2s;
}

.ai-chat-image-upload:hover {
  background: #e0e0e0;
  transform: scale(1.05);
}

.ai-chat-image-upload:hover img {
  filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0) contrast(1);
}

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

/* Image Preview Container */
.ai-chat-image-preview-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.ai-chat-image-preview {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e0e0e0;
  flex-shrink: 0;
}

.ai-chat-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.ai-chat-image-preview-remove:hover {
  background: rgba(255, 0, 0, 0.8);
  transform: scale(1.1);
}

/* Message Images */
.ai-chat-message-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-chat-message-image-wrapper {
  border-radius: 8px;
  overflow: hidden;
  max-width: 300px;
  cursor: pointer;
  transition: transform 0.2s;
}

.ai-chat-message-image-wrapper:hover {
  transform: scale(1.02);
}

.ai-chat-message-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.ai-chat-message-user .ai-chat-message-image-wrapper {
  margin-left: auto;
  margin-right: 0;
}

.ai-chat-message-assistant .ai-chat-message-image-wrapper {
  margin-left: 0;
  margin-right: auto;
}

/* Responsive */
@media (max-width: 480px) {
  .ai-chat-window {
    width: calc(100% - 40px);
    right: 20px;
    left: 20px;
    height: calc(100vh - 110px);
    max-height: calc(100vh - 110px);
  }

  .ai-chat-button {
    bottom: 15px;
    right: 15px;
    width: 56px;
    height: 56px;
  }

  .ai-chat-window {
    bottom: 80px;
  }
}

/* RTL Support - Only for message layout, not widget position */

[dir="rtl"] .ai-chat-message-user {
  flex-direction: row;
}

/* Product Cards */
.ai-chat-product-card {
  margin: 16px 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
  animation: productCardFadeIn 0.4s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

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

.ai-chat-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #667eea;
}

.ai-chat-product-image {
  width: 100%;
  height: 200px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.ai-chat-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ai-chat-product-card:hover .ai-chat-product-image img {
  transform: scale(1.08);
}

.ai-chat-product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  background: #f8f9fa;
}

.ai-chat-product-placeholder svg {
  width: 60px;
  height: 60px;
}

.ai-chat-product-placeholder-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #667eea;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 4px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ai-chat-product-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-chat-product-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #212529;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-chat-product-description {
  margin: 0;
  font-size: 14px;
  color: #6c757d;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-chat-product-price-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-chat-product-price {
  font-size: 20px;
  font-weight: 700;
  color: #667eea;
  direction: ltr;
  text-align: left;
}

.ai-chat-product-old-price {
  font-size: 16px;
  color: #adb5bd;
  text-decoration: line-through;
  direction: ltr;
  text-align: left;
}

.ai-chat-product-button {
  display: inline-block;
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.ai-chat-product-button:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  color: #fff;
  text-decoration: none;
}

.ai-chat-product-button:active {
  transform: translateY(0);
}

/* Dark theme for product cards */
.ai-chat-dark .ai-chat-product-card {
  background: #2d3748;
  border-color: #4a5568;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ai-chat-dark .ai-chat-product-card:hover {
  border-color: #667eea;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.ai-chat-dark .ai-chat-product-image {
  background: #1a202c;
}

.ai-chat-dark .ai-chat-product-placeholder {
  background: #1a202c;
  color: #4a5568;
}

.ai-chat-dark .ai-chat-product-title {
  color: #e2e8f0;
}

.ai-chat-dark .ai-chat-product-description {
  color: #a0aec0;
}

.ai-chat-dark .ai-chat-product-price {
  color: #667eea;
}

.ai-chat-dark .ai-chat-product-old-price {
  color: #718096;
}

.ai-chat-dark .ai-chat-product-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ai-chat-dark .ai-chat-product-button:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Responsive product cards */
@media (max-width: 480px) {
  .ai-chat-product-image {
    height: 180px;
  }

  .ai-chat-product-info {
    padding: 12px;
  }

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

  .ai-chat-product-description {
    font-size: 13px;
  }

  .ai-chat-product-price {
    font-size: 18px;
  }

  .ai-chat-product-button {
    padding: 10px 16px;
    font-size: 14px;
  }
}

[dir="rtl"] .ai-chat-message-user .ai-chat-message-time {
  text-align: left;
}

/* Dark Theme */
.ai-chat-dark .ai-chat-window {
  background: #1e1e1e;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.ai-chat-dark .ai-chat-header {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.ai-chat-dark .ai-chat-messages {
  background: #1e1e1e;
}

.ai-chat-dark .ai-chat-welcome {
  color: #e2e8f0;
}

.ai-chat-dark .ai-chat-welcome-icon {
  filter: invert(100%);
}

.ai-chat-dark .ai-chat-input-container {
  background: #2d3748;
  border-top: 1px solid #4a5568;
}

.ai-chat-dark .ai-chat-input {
  background: #2d3748;
  color: #e2e8f0;
  border-color: #4a5568;
}

.ai-chat-dark .ai-chat-input:focus {
  border-color: #667eea;
  background: #374151;
}

.ai-chat-dark .ai-chat-input::placeholder {
  color: #9ca3af;
}

.ai-chat-dark .ai-chat-image-upload {
  background: #374151;
  border-color: #4a5568;
  color: #e2e8f0;
}

.ai-chat-dark .ai-chat-image-upload img {
  filter: brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(1) contrast(1);
}

.ai-chat-dark .ai-chat-image-upload:hover {
  background: #4a5568;
}

.ai-chat-dark .ai-chat-image-upload:hover img {
  filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(1) contrast(1);
}

.ai-chat-dark .ai-chat-image-preview-container {
  background: #2d3748;
}

.ai-chat-dark .ai-chat-image-preview {
  border-color: #4a5568;
}

.ai-chat-dark .ai-chat-send {
  background: #667eea;
  color: #fff;
}

.ai-chat-dark .ai-chat-send:hover {
  background: #5568d3;
}

.ai-chat-dark .ai-chat-send:disabled {
  background: #4a5568;
  color: #9ca3af;
}

.ai-chat-dark .ai-chat-message-text {
  background: #2d3748;
  color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.ai-chat-dark .ai-chat-message-user .ai-chat-message-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.ai-chat-dark .ai-chat-message-assistant .ai-chat-message-text {
  background: #2d3748;
  color: #e2e8f0;
}

.ai-chat-dark .ai-chat-message.error .ai-chat-message-text {
  background: #742a2a;
  color: #fca5a5;
  border: 1px solid #991b1b;
}

.ai-chat-dark .ai-chat-message-time {
  color: #9ca3af;
}

.ai-chat-dark .ai-chat-message-user .ai-chat-message-time {
  color: rgba(255, 255, 255, 0.7);
}

.ai-chat-dark .ai-chat-message-assistant .ai-chat-message-avatar {
  background: #374151;
}

.ai-chat-dark .ai-chat-message-assistant .ai-chat-message-avatar img {
  filter: brightness(0) saturate(100%) invert(75%) sepia(10%) saturate(200%)
    hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Dark Theme - Markdown Styles */
.ai-chat-dark .ai-chat-message-text code {
  background: rgba(0, 0, 0, 0.3);
  color: #f472b6;
}

.ai-chat-dark .ai-chat-message-user .ai-chat-message-text code {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.ai-chat-dark .ai-chat-message-text pre {
  background: #1a1a1a;
  border: 1px solid #374151;
}

.ai-chat-dark .ai-chat-message-user .ai-chat-message-text pre {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.ai-chat-dark .ai-chat-message-text pre code {
  color: #e2e8f0;
}

.ai-chat-dark .ai-chat-message-user .ai-chat-message-text pre code {
  color: #fff;
}

.ai-chat-dark .ai-chat-message-text a {
  color: #FFF;
}

.ai-chat-dark .ai-chat-message-user .ai-chat-message-text a {
  color: #fff;
}

/* Dark Theme - Loading */
.ai-chat-dark .ai-chat-loading .ai-chat-message-text {
  background: #2d3748;
}

.ai-chat-dark .ai-chat-loading-dot {
  background: #9ca3af;
}

/* Retry Button Styles */
.ai-chat-retry-button {
  margin-top: 10px;
  padding: 8px 16px;
  background: #1976d2;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.ai-chat-retry-button img {
  width: 14px;
	height: 14px;
	filter: brightness(0) invert(1);
}

.ai-chat-retry-button:hover {
  background: #1565c0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.ai-chat-retry-button:active {
  transform: translateY(0);
}

.ai-chat-retry-button svg {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-left: 4px;
}

.ai-chat-dark .ai-chat-retry-button {
  background: #1976d2;
}

.ai-chat-dark .ai-chat-retry-button:hover {
  background: #1565c0;
}

/* Dark Theme - New Chat Button */
.ai-chat-dark .ai-chat-new-chat {
  background: rgba(255, 255, 255, 0.15);
}

.ai-chat-dark .ai-chat-new-chat:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Quick Reply Buttons */
.ai-chat-quick-replies {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

.ai-chat-quick-reply-button {
  padding: 10px 16px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  color: #495057;
  text-align: center;
  transition: all 0.2s ease;
  font-family: inherit;
  width: 100%;
}

.ai-chat-quick-reply-button:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ai-chat-quick-reply-button:active {
  transform: translateY(0);
}

/* Dark theme for quick replies */
.ai-chat-dark .ai-chat-quick-replies {
  border-top-color: #4a5568;
}

.ai-chat-dark .ai-chat-quick-reply-button {
  background: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

.ai-chat-dark .ai-chat-quick-reply-button:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: #667eea;
}

/* Contact Information Cards */
.ai-chat-contact-card {
  margin: 10px 0;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.ai-chat-contact-link {
  display: flex;
  align-items: center;
  padding: 0;
  text-decoration: none;
  color: inherit;
  gap: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border: none;
  min-width: 0;
  background: transparent;
}

.ai-chat-contact-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 0;
}

.ai-chat-contact-link:hover .ai-chat-contact-card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-chat-contact-link:hover::before {
  opacity: 1;
}

.ai-chat-contact-link:hover .ai-chat-contact-icon {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ai-chat-contact-link:hover .ai-chat-contact-icon-img {
  transform: scale(1.08);
}

.ai-chat-contact-icon {
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 14px;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
	margin: 5px;
}

.ai-chat-contact-icon-img {
  width: 28px;
  height: 28px;
  transition: all 0.25s ease;
}

/* Brand-specific colors */
.ai-chat-contact-card.contact-whatsapp {
  border-color: #25D366;
}

.ai-chat-contact-card.contact-whatsapp .ai-chat-contact-icon {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.ai-chat-contact-card.contact-whatsapp .ai-chat-contact-link:hover::before {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.ai-chat-contact-card.contact-whatsapp .ai-chat-contact-icon-img {
  filter: brightness(0) invert(1);
}

.ai-chat-contact-card.contact-telegram {
  border-color: #0088cc;
}

.ai-chat-contact-card.contact-telegram .ai-chat-contact-icon {
  background: linear-gradient(135deg, #0088cc 0%, #005f8c 100%);
}

.ai-chat-contact-card.contact-telegram .ai-chat-contact-link:hover::before {
  background: linear-gradient(135deg, #0088cc 0%, #005f8c 100%);
}

.ai-chat-contact-card.contact-telegram .ai-chat-contact-icon-img {
  filter: brightness(0) invert(1);
}

.ai-chat-contact-card.contact-instagram {
  border-color: #E4405F;
}

.ai-chat-contact-card.contact-instagram .ai-chat-contact-icon {
  background: linear-gradient(135deg, #833AB4 0%, #FD1D1D 50%, #FCAF45 100%);
}

.ai-chat-contact-card.contact-instagram .ai-chat-contact-link:hover::before {
  background: linear-gradient(135deg, #833AB4 0%, #FD1D1D 50%, #FCAF45 100%);
}

.ai-chat-contact-card.contact-instagram .ai-chat-contact-icon-img {
  filter: brightness(0) invert(1);
}

.ai-chat-contact-card.contact-youtube {
  border-color: #FF0000;
}

.ai-chat-contact-card.contact-youtube .ai-chat-contact-icon {
  background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
}

.ai-chat-contact-card.contact-youtube .ai-chat-contact-link:hover::before {
  background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
}

.ai-chat-contact-card.contact-youtube .ai-chat-contact-icon-img {
  filter: brightness(0) invert(1);
}

.ai-chat-contact-card.contact-email {
  border-color: #EA4335;
}

.ai-chat-contact-card.contact-email .ai-chat-contact-icon {
  background: linear-gradient(135deg, #EA4335 0%, #C5221F 100%);
}

.ai-chat-contact-card.contact-email .ai-chat-contact-link:hover::before {
  background: linear-gradient(135deg, #EA4335 0%, #C5221F 100%);
}

.ai-chat-contact-card.contact-email .ai-chat-contact-icon-img {
  filter: brightness(0) invert(1);
}

.ai-chat-contact-card.contact-phone {
  border-color: #667eea;
}

.ai-chat-contact-card.contact-phone .ai-chat-contact-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ai-chat-contact-card.contact-phone .ai-chat-contact-link:hover::before {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ai-chat-contact-card.contact-phone .ai-chat-contact-icon-img {
  filter: brightness(0) invert(1);
}

.ai-chat-contact-card.contact-address {
  border-color: #10b981;
}

.ai-chat-contact-card.contact-address .ai-chat-contact-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ai-chat-contact-card.contact-address .ai-chat-contact-link:hover::before {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ai-chat-contact-card.contact-address .ai-chat-contact-icon-img {
  filter: brightness(0) invert(1);
}

.ai-chat-contact-card.contact-default {
  border-color: #6b7280;
}

.ai-chat-contact-card.contact-default .ai-chat-contact-icon {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.ai-chat-contact-card.contact-default .ai-chat-contact-link:hover::before {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.ai-chat-contact-card.contact-default .ai-chat-contact-icon-img {
  filter: brightness(0) invert(1);
}

.ai-chat-contact-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
  padding: 8px 0;
  padding-right: 5px;
  min-width: 0;
}

.ai-chat-contact-label {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: color 0.25s ease;
  line-height: 1.2;
}

.ai-chat-contact-link:hover .ai-chat-contact-label, .ai-chat-contact-link:hover .ai-chat-contact-value {
  color: #FFF;
}

.ai-chat-contact-value {
  font-size: 14px;
  color: #111827;
  font-weight: 600;
  transition: color 0.25s ease;
  line-height: 1.4;
  word-break: break-word;
}

.ai-chat-contact-arrow {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: all 0.25s ease;
  opacity: 0.5;
  margin-left: auto;
  margin-right: 5px;
}

.ai-chat-contact-link:hover .ai-chat-contact-arrow {
  opacity: 1;
  transform: translateX(-4px);
}

.ai-chat-contact-arrow-img {
  width: 20px;
  height: 20px;
  filter: brightness(0) opacity(0.4);
  transition: all 0.25s ease;
}

.ai-chat-contact-link:hover .ai-chat-contact-arrow-img {
  filter: brightness(0) opacity(1) invert(1);
  transform: translateX(-1px);
}

/* Dark theme for contact cards */
.ai-chat-dark .ai-chat-contact-card {
  background: #1f2937;
  border-color: #374151;
}

.ai-chat-dark .ai-chat-contact-label {
  color: #9ca3af;
}

.ai-chat-dark .ai-chat-contact-value {
  color: #f3f4f6;
}

.ai-chat-dark .ai-chat-contact-arrow-img {
  filter: brightness(0) invert(0.5);
}

.ai-chat-dark .ai-chat-contact-card.contact-whatsapp {
  border-color: #25D366;
}

.ai-chat-dark .ai-chat-contact-card.contact-telegram {
  border-color: #0088cc;
}

.ai-chat-dark .ai-chat-contact-card.contact-instagram {
  border-color: #E4405F;
}

.ai-chat-dark .ai-chat-contact-card.contact-youtube {
  border-color: #FF0000;
}

.ai-chat-dark .ai-chat-contact-card.contact-email {
  border-color: #EA4335;
}

.ai-chat-dark .ai-chat-contact-card.contact-phone {
  border-color: #667eea;
}

.ai-chat-dark .ai-chat-contact-card.contact-address {
  border-color: #10b981;
}
