/* ===== CSS VARIABLES ===== */
#aica-widget-root {
  --woot-primary: var(--aica-primary-color, #1f93ff) !important;
  --woot-primary-dark: color-mix(in srgb, var(--woot-primary) 80%, black) !important;
  --woot-secondary: #f5f7fb !important;
  --woot-text: #1f2d3d !important;
  --woot-text-light: #6b7280 !important;
  --woot-border: #e4e4e7 !important;
  --woot-bubble-user: var(--woot-primary) !important;
  --woot-bubble-bot: #ffffff !important;
  --woot-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.02) !important;
  --woot-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  --woot-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  direction: rtl !important;
}

/* Dark mode */
:root[data-aica-theme="dark"] #aica-widget-root {
  --woot-secondary: #1e293b !important;
  --woot-text: #f1f5f9 !important;
  --woot-text-light: #94a3b8 !important;
  --woot-border: #334155 !important;
  --woot-bubble-bot: #1e293b !important;
}

/* ===== POSITION UTILITIES (RTL Adjusted) ===== */
#aica-widget-root .woot-bottom-4 { bottom: 1rem !important; }
#aica-widget-root .woot-right-4 { left: 1rem !important; right: auto !important; }
#aica-widget-root .woot-left-4 { right: 1rem !important; left: auto !important; }
#aica-widget-root .woot-top-4 { top: 1rem !important; }

/* ===== FLOATING BUTTON (Chatwoot Style) ===== */
#aica-widget-root .woot-widget-button {
  position: fixed !important;
  width: 60px !important;
  height: 60px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, var(--woot-primary), var(--woot-primary-dark)) !important;
  box-shadow: var(--woot-shadow) !important;
  cursor: pointer !important;
  transition: var(--woot-transition) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  z-index: 99999 !important;
}

#aica-widget-root .woot-widget-button:hover {
  transform: scale(1.05) !important;
  box-shadow: var(--woot-shadow-lg) !important;
}

#aica-widget-root .woot-widget-button:active {
  transform: scale(0.95) !important;
}

/* Unread badge - RTL */
#aica-widget-root .woot-unread-badge {
  position: absolute !important;
  top: -4px !important;
  left: -4px !important;
  right: auto !important;
  background: #ef4444 !important;
  color: white !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  min-width: 20px !important;
  height: 20px !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 5px !important;
  font-family: inherit !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* ===== CHAT WINDOW ===== */
/* Desktop: fixed positioning */
#aica-widget-root .woot-widget-window {
  position: fixed !important;
  width: 380px !important;
  max-width: calc(100vw - 20px) !important;
  height: 600px !important;
  max-height: calc(100vh - 80px) !important;
  background: var(--woot-bubble-bot) !important;
  border-radius: 14px !important;
  box-shadow: var(--woot-shadow-lg) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transition: var(--woot-transition) !important;
  z-index: 99999 !important;
}

/* Mobile: absolute positioning for proper keyboard handling */
@media (max-width: 640px) {
  html:has(#aica-widget-root .woot-widget-window:not(.woot-minimized)),
  body:has(#aica-widget-root .woot-widget-window:not(.woot-minimized)) {
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    touch-action: none !important;
  }
  
  #aica-widget-root .woot-widget-window {
    /*position: absolute;*/
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    /* Use env() for safe areas on iOS */
    padding-top: env(safe-area-inset-top) !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
    padding-left: env(safe-area-inset-left) !important;
    padding-right: env(safe-area-inset-right) !important;
  }
}

/* Minimized state */
#aica-widget-root .woot-widget-window.woot-minimized {
  height: 72px !important;
  cursor: pointer !important;
}

/* ===== CHAT HEADER ===== */
#aica-widget-root .woot-chat-header {
  background: linear-gradient(135deg, var(--woot-primary), var(--woot-primary-dark)) !important;
  padding: 16px 15px !important;
  color: white !important;
  flex-shrink: 0 !important;
}

#aica-widget-root .woot-header-content {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* RTL: Avatar on the right */
#aica-widget-root .woot-avatar {
  width: 35px !important;
  height: 35px !important;
  background: rgba(255,255,255,0.2) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 20px !important;
  flex-shrink: 0 !important;
}

#aica-widget-root .woot-header-info {
  flex: 1 !important;
  text-align: right !important;
}

#aica-widget-root .woot-header-info h3 {
  font-size: 14px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}

#aica-widget-root .woot-status {
  font-size: 12px !important;
  opacity: 0.85 !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  margin-top: 2px !important;
  justify-content: flex-start !important;
}

/* RTL: Status dot on the right */
#aica-widget-root .woot-status-dot {
  width: 8px !important;
  height: 8px !important;
  background: #22c55e !important;
  border-radius: 50% !important;
  animation: woot-pulse 2s infinite !important;
  order: -1 !important;
}

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

#aica-widget-root .woot-header-actions {
  display: flex !important;
  gap: 8px !important;
}

#aica-widget-root .woot-icon-btn {
  background: rgba(255,255,255,0.15) !important;
  border: none !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: var(--woot-transition) !important;
  color: white !important;
}

#aica-widget-root .woot-icon-btn:hover {
  background: rgba(255,255,255,0.25) !important;
  transform: scale(1.05) !important;
}

/* ===== MESSAGES AREA ===== */
#aica-widget-root .woot-messages-area {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 20px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  background: var(--woot-secondary) !important;
  scroll-behavior: smooth !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Custom scrollbar */
#aica-widget-root .woot-messages-area::-webkit-scrollbar {
  width: 5px !important;
}

#aica-widget-root .woot-messages-area::-webkit-scrollbar-track {
  background: transparent !important;
}

#aica-widget-root .woot-messages-area::-webkit-scrollbar-thumb {
  background: var(--woot-border) !important;
  border-radius: 3px !important;
}

/* ===== MESSAGE BUBBLES (RTL) ===== */
#aica-widget-root .woot-message {
  display: flex !important;
  flex-direction: column !important;
  max-width: 85% !important;
  animation: woot-message-slide-in 0.3s ease-out !important;
}

@keyframes woot-message-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RTL: User message on the left (since RTL flips) */
#aica-widget-root .woot-message-user {
  align-self: flex-start !important;
}

/* RTL: Bot message on the right */
#aica-widget-root .woot-message-bot {
  align-self: flex-end !important;
}

#aica-widget-root .woot-bubble {
  padding: 10px 14px !important;
  border-radius: 18px !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  word-wrap: break-word !important;
  position: relative !important;
}

/* User bubble - RTL: rounded corner on top-left */
#aica-widget-root .woot-message-user .woot-bubble {
  background: var(--woot-bubble-user) !important;
  color: white !important;
  border-top-left-radius: 4px !important;
  border-bottom-left-radius: 18px !important;
  border-top-right-radius: 18px !important;
  border-bottom-right-radius: 18px !important;
}

/* Bot bubble - RTL: rounded corner on top-right */
#aica-widget-root .woot-message-bot .woot-bubble {
  background: var(--woot-bubble-bot) !important;
  color: var(--woot-text) !important;
  border: 1px solid var(--woot-border) !important;
  border-top-right-radius: 4px !important;
  border-top-left-radius: 18px !important;
  border-bottom-left-radius: 18px !important;
  border-bottom-right-radius: 18px !important;
}

#aica-widget-root .woot-message-bot .woot-bubble p {
    color: var(--woot-text) !important;
}

/* Error message */
#aica-widget-root .woot-message-error .woot-bubble {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fecaca !important;
}

:root[data-aica-theme="dark"] #aica-widget-root .woot-message-error .woot-bubble {
  background: #7f1d1d !important;
  color: #fca5a5 !important;
  border-color: #991b1b !important;
}

/* Message time - RTL aligned */
#aica-widget-root .woot-message-time {
  font-size: 10px !important;
  color: var(--woot-text-light) !important;
  margin-top: 4px !important;
  margin-right: 8px !important;
  margin-left: 8px !important;
}

#aica-widget-root .woot-message-user .woot-message-time {
  text-align: left !important;
}

#aica-widget-root .woot-message-bot .woot-message-time {
  text-align: right !important;
}

/* ===== TYPING INDICATOR (RTL) ===== */
#aica-widget-root .woot-typing {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 15px !important;
  background: var(--woot-bubble-bot) !important;
  border: 1px solid var(--woot-border) !important;
  border-radius: 18px !important;
  border-top-right-radius: 4px !important;
  width: fit-content !important;
}

#aica-widget-root .woot-typing-dot {
  width: 6px !important;
  height: 6px !important;
  background: var(--woot-text-light) !important;
  border-radius: 50% !important;
  animation: woot-typing-bounce 1.4s infinite ease-in-out !important;
}

#aica-widget-root .woot-typing-dot:nth-child(1) { animation-delay: 0s !important; }
#aica-widget-root .woot-typing-dot:nth-child(2) { animation-delay: 0.2s !important; }
#aica-widget-root .woot-typing-dot:nth-child(3) { animation-delay: 0.4s !important; }

@keyframes woot-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* ===== QUICK REPLY BUTTONS (RTL) ===== */
#aica-widget-root .woot-suggestions {
  padding: 12px 16px !important;
  background: var(--woot-secondary) !important;
  border-top: 1px solid var(--woot-border) !important;
}

#aica-widget-root .woot-suggestions-title {
  font-size: 11px !important;
  color: var(--woot-text-light) !important;
  margin-bottom: 10px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-weight: 600 !important;
  text-align: right !important;
}

#aica-widget-root .woot-suggestions-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
}

@media (max-width: 480px) {
  #aica-widget-root .woot-suggestions-grid {
    grid-template-columns: 1fr !important;
  }
}

#aica-widget-root .woot-suggestion-btn {
  background: var(--woot-bubble-bot) !important;
  border: 1px solid var(--woot-border) !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
  color: var(--woot-text) !important;
  cursor: pointer !important;
  transition: var(--woot-transition) !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  text-align: right !important;
}

#aica-widget-root .woot-suggestion-btn:hover {
  border-color: var(--woot-primary) !important;
  background: rgba(31, 147, 255, 0.05) !important;
  transform: translateY(-1px) !important;
}

/* ===== PRODUCT CARD (RTL) ===== */
#aica-widget-root .woot-product-card {
  background: var(--woot-bubble-bot) !important;
  border: 1px solid var(--woot-border) !important;
  border-radius: 12px !important;
  padding: 10px !important;
  margin-top: 10px !important;
  transition: var(--woot-transition) !important;
}

#aica-widget-root .woot-product-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--woot-shadow) !important;
}

#aica-widget-root .woot-product-content {
  display: flex !important;
  gap: 10px !important;
}

#aica-widget-root .woot-product-img {
  width: 50px !important;
  height: 50px !important;
  border-radius: 8px !important;
  object-fit: cover !important;
}

#aica-widget-root .woot-product-info {
  flex: 1 !important;
  text-align: right !important;
}

#aica-widget-root .woot-product-title {
  font-size: 13px !important;
  font-weight: 600 !important;
  margin: 0 0 4px 0 !important;
  color: var(--woot-text) !important;
}

#aica-widget-root .woot-product-price {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--woot-primary) !important;
  display: inline-block !important;
}

#aica-widget-root .woot-product-old-price {
  font-size: 11px !important;
  text-decoration: line-through !important;
  color: var(--woot-text-light) !important;
  margin-left: 6px !important;
  margin-right: 0 !important;
  display: inline-block !important;
}

#aica-widget-root .woot-product-actions {
  display: flex !important;
  gap: 8px !important;
  margin-top: 8px !important;
}

#aica-widget-root .woot-add-to-cart {
  background: var(--woot-primary) !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 11px !important;
  color: white !important;
  cursor: pointer !important;
  transition: var(--woot-transition) !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}

#aica-widget-root .woot-add-to-cart:hover {
  background: var(--woot-primary-dark) !important;
}

#aica-widget-root .woot-view-product {
  background: transparent !important;
  border: 1px solid var(--woot-border) !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 11px !important;
  color: var(--woot-text) !important;
  cursor: pointer !important;
  transition: var(--woot-transition) !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
}

#aica-widget-root .woot-view-product:hover {
  background: var(--woot-secondary) !important;
}

/* ===== ORDER CARD (RTL) ===== */
#aica-widget-root .woot-order-card {
  background: var(--woot-bubble-bot) !important;
  border: 1px solid var(--woot-border) !important;
  border-radius: 12px !important;
  padding: 12px !important;
  margin-top: 10px !important;
}

#aica-widget-root .woot-order-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

#aica-widget-root .woot-order-number {
  font-weight: 600 !important;
  font-size: 12px !important;
  color: var(--woot-text) !important;
}

#aica-widget-root .woot-order-status {
  font-size: 10px !important;
  padding: 2px 8px !important;
  border-radius: 20px !important;
  font-weight: 500 !important;
}

#aica-widget-root .woot-order-status.completed { background: #d1fae5 !important; color: #065f46 !important; }
#aica-widget-root .woot-order-status.processing { background: #dbeafe !important; color: #1e40af !important; }
#aica-widget-root .woot-order-status.hold { background: #fef3c7 !important; color: #92400e !important; }
#aica-widget-root .woot-order-status.cancelled { background: #fee2e2 !important; color: #991b1b !important; }

:root[data-aica-theme="dark"] #aica-widget-root .woot-order-status.completed { background: #064e3b !important; color: #6ee7b7 !important; }
:root[data-aica-theme="dark"] #aica-widget-root .woot-order-status.processing { background: #1e3a8a !important; color: #93c5fd !important; }
:root[data-aica-theme="dark"] #aica-widget-root .woot-order-status.hold { background: #78350f !important; color: #fde68a !important; }
:root[data-aica-theme="dark"] #aica-widget-root .woot-order-status.cancelled { background: #7f1d1d !important; color: #fca5a5 !important; }

/* ===== INPUT AREA (RTL) ===== */
#aica-widget-root .woot-input-area {
  padding: 16px !important;
  border-top: 1px solid var(--woot-border) !important;
  background: var(--woot-bubble-bot) !important;
  flex-shrink: 0 !important;
}

#aica-widget-root .woot-input-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: var(--woot-secondary) !important;
  border: 1px solid var(--woot-border) !important;
  border-radius: 24px !important;
  padding: 6px 16px 6px 6px !important;
  transition: var(--woot-transition) !important;
}

#aica-widget-root .woot-input-wrapper:focus-within {
  border-color: var(--woot-primary) !important;
  box-shadow: 0 0 0 2px rgba(31, 147, 255, 0.1) !important;
}

#aica-widget-root .woot-input {
  flex: 1 !important;
  border: none !important;
  background: transparent !important;
  padding: 8px 0 !important;
  font-size: 13px !important;
  color: var(--woot-text) !important;
  resize: none !important;
  font-family: inherit !important;
  outline: none !important;
  height: 45px !important;
  text-align: right !important;
}

#aica-widget-root .woot-input::placeholder {
  color: var(--woot-text-light) !important;
  text-align: right !important;
}

#aica-widget-root .woot-send-btn {
  background: transparent !important;
  border: none !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: var(--woot-transition) !important;
  color: var(--woot-primary) !important;
  flex-shrink: 0 !important;
}

#aica-widget-root .woot-send-btn:hover:not(:disabled) {
  background: rgba(31, 147, 255, 0.1) !important;
  transform: scale(1.05) !important;
}

#aica-widget-root .woot-send-btn:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* ===== FOOTER ===== */
#aica-widget-root .woot-footer {
  text-align: center !important;
  padding: 8px 16px !important;
  color: var(--woot-text-light) !important;
  border-top: 1px solid var(--woot-border) !important;
  background: var(--woot-bubble-bot) !important;
}

#aica-widget-root .woot-footer a {
  color: var(--woot-text-light) !important;
  text-decoration: none !important;
  font-size: 10px !important;
}

#aica-widget-root .woot-footer a:hover {
  color: var(--woot-primary) !important;
}

/* ===== ANIMATIONS ===== */
@keyframes woot-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#aica-widget-root .woot-widget-window {
  animation: woot-slide-up 0.25s ease-out !important;
}

@media (max-width: 640px) {
  @keyframes woot-slide-up-mobile {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }
  
  #aica-widget-root .woot-widget-window {
    animation: woot-slide-up-mobile 0.25s ease-out !important;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  #aica-widget-root *,
  #aica-widget-root *::before,
  #aica-widget-root *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== LOADING SKELETON ===== */
#aica-widget-root .woot-skeleton {
  background: linear-gradient(90deg, var(--woot-secondary) 25%, var(--woot-border) 50%, var(--woot-secondary) 75%) !important;
  background-size: 200% 100% !important;
  animation: woot-skeleton-loading 1.5s infinite !important;
  border-radius: 8px !important;
}

@keyframes woot-skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== RESPONSIVE RTL FIXES ===== */
@media (max-width: 640px) {
  #aica-widget-root .woot-message {
    max-width: 90% !important;
  }
  
  #aica-widget-root .woot-suggestion-btn {
    font-size: 12px !important;
    padding: 14px !important;
    font-weight: bold !important;
  }
  
  #aica-widget-root .woot-product-title {
    font-size: 14px !important;
  }
}

/* ===== FOCUS STATES ===== */
#aica-widget-root .woot-focus-visible:focus-visible {
  outline: 2px solid var(--woot-primary) !important;
  outline-offset: 2px !important;
}

/* ===== UTILITY CLASSES ===== */
#aica-widget-root .woot-hidden {
  display: none !important;
}

#aica-widget-root .woot-text-center {
  text-align: center !important;
}

#aica-widget-root .woot-mt-2 {
  margin-top: 8px !important;
}

#aica-widget-root .woot-mb-2 {
  margin-bottom: 8px !important;
}

/* دکمه پاک کردن تاریخچه - آیکون سطل زباله */
#aica-widget-root .woot-clear-btn {
  background: rgba(255,255,255,0.15) !important;
  border: none !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: var(--woot-transition) !important;
  color: white !important;
  position: relative !important;
}

#aica-widget-root .woot-clear-btn:hover {
  background: rgba(239, 68, 68, 0.8) !important;
  transform: scale(1.05) !important;
}

/* تایید پاک کردن - Toast notification */
#aica-widget-root .woot-toast {
  position: fixed !important;
  bottom: 20px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: var(--woot-primary) !important;
  color: white !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  z-index: 100000 !important;
  animation: woot-toast-slide 0.3s ease-out !important;
  white-space: nowrap !important;
  box-shadow: var(--woot-shadow) !important;
}

@keyframes woot-toast-slide {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* مدال تایید */
#aica-widget-root .woot-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100001 !important;
  animation: woot-fade-in 0.2s ease-out !important;
}

@keyframes woot-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

#aica-widget-root .woot-modal {
  background: var(--woot-bubble-bot) !important;
  border-radius: 16px !important;
  padding: 20px !important;
  width: 280px !important;
  text-align: center !important;
  box-shadow: var(--woot-shadow-lg) !important;
  border: 1px solid var(--woot-border) !important;
}

#aica-widget-root .woot-modal h4 {
  margin: 0 0 8px 0 !important;
  font-size: 16px !important;
  color: var(--woot-text) !important;
}

#aica-widget-root .woot-modal p {
  margin: 0 0 20px 0 !important;
  font-size: 13px !important;
  color: var(--woot-text-light) !important;
}

#aica-widget-root .woot-modal-buttons {
  display: flex !important;
  gap: 12px !important;
  justify-content: center !important;
}

#aica-widget-root .woot-modal-btn {
  padding: 8px 20px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: var(--woot-transition) !important;
  border: none !important;
}

#aica-widget-root .woot-modal-btn-confirm {
  background: #ef4444 !important;
  color: white !important;
}

#aica-widget-root .woot-modal-btn-confirm:hover {
  background: #dc2626 !important;
}

#aica-widget-root .woot-modal-btn-cancel {
  background: var(--woot-secondary) !important;
  color: var(--woot-text) !important;
  border: 1px solid var(--woot-border) !important;
}

#aica-widget-root .woot-modal-btn-cancel:hover {
  background: var(--woot-border) !important;
}


.woot-message-actions {
    display: flow-root !important;
    gap: 8px !important;
    margin-top: 12px !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--woot-border) !important;
    justify-content: flex-end !important;
  }
  
  .woot-message-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 4px 8px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    color: var(--woot-text-light) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-family: inherit !important;
  }
  
  .woot-message-action-btn:hover {
    background: var(--woot-secondary) !important;
    color: var(--woot-primary) !important;
  }
  
  .woot-message-action-btn svg {
    stroke: currentColor !important;
  }
  
  .woot-action-text {
    font-size: 11px !important;
  }
  
  /* دکمه درخواست مجدد - رنگ متفاوت */
  .woot-retry-btn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
  }
  
  /* Toast کپی متن */
  .woot-copied-toast {
    position: absolute !important;
    bottom: -30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: var(--woot-primary) !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    animation: fadeInUp 0.3s ease !important;
    z-index: 10 !important;
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateX(-50%) translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
  }
  
  /* برای پیام‌های کاربر دکمه‌ها نمایش داده نشود */
  .woot-message-user .woot-message-actions {
    display: none !important;
  }
  
  /* بهینه‌سازی برای موبایل */
  @media (max-width: 640px) {
    .woot-message-action-btn {
      padding: 6px 10px !important;
    }
    
    .woot-action-text {
      font-size: 10px !important;
    }
    
    .woot-copied-toast {
      font-size: 10px !important;
      padding: 3px 10px !important;
      bottom: -25px !important;
    }
  }

  /* رفع مشکل کروم موبایل */
@media screen and (max-width: 768px) {
  .woot-widget-window {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    z-index: 999999 !important;
  }
  
  .woot-messages-area {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    height: calc(100vh - 120px) !important;
  }
  
  .woot-input-area {
    position: sticky;
    bottom: 0;
    background: var(--woot-bg);
    border-top: 1px solid var(--woot-border);
    padding: 12px;
    z-index: 10;
  }
  
  /* جلوگیری از اسکرول بدنه هنگام باز بودن چت */
  body:has(#aica-widget-root .woot-widget-window) {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }
}

/* رفع مشکل مخصوص کروم */
@media screen and (max-width: 768px) and (-webkit-min-device-pixel-ratio: 0) {
  .woot-widget-window {
    height: -webkit-fill-available !important;
  }
  
  .woot-messages-area {
    height: -webkit-fill-available !important;
  }
}