/* Chat Widget Styles */
.woobix-chat-widget {
  position: fixed;
  z-index: 9999;
  font-family: -apple-system, BlinkMacMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  direction: rtl;
  /* Position will be set dynamically via JavaScript */
}

.woobix-chat-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.woobix-chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.woobix-chat-button svg {
  width: 28px;
  height: 28px;
  color: white;
}

.woobix-chat-badge {
  position: absolute;
  top: -5px;
  left: -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;
  animation: pulse 2s infinite;
}

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

.woobix-chat-window {
  position: fixed !important;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none !important;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999 !important;
  visibility: hidden;
  opacity: 0;
  /* Position will be set dynamically via JavaScript */
}

.woobix-chat-window.open {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  animation: slideUp 0.3s ease;
}

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

.woobix-chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.woobix-chat-header-info p {
  margin: 4px 0 0 0;
  font-size: 13px;
  opacity: 0.9;
}

.woobix-chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.woobix-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.woobix-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f9fafb;
}

.woobix-chat-message {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.woobix-chat-message.customer {
  align-items: flex-end;
}

.woobix-chat-message.admin {
  align-items: flex-start;
}

.woobix-chat-message-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  word-wrap: break-word;
}

.woobix-chat-message.customer .woobix-chat-message-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

.woobix-chat-message.admin .woobix-chat-message-bubble {
  background: #e5e7eb;
  color: #1f2937;
  border-bottom-left-radius: 4px;
  margin-right: auto;
}

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

.woobix-chat-form-container {
  padding: 20px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

.woobix-chat-form-content {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(500px - 80px);
}

.woobix-chat-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.woobix-chat-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.woobix-chat-form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.woobix-chat-input-container {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

.woobix-chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 8px 12px;
}

.woobix-chat-message-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

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

.woobix-chat-send-button:hover {
  transform: scale(1.1);
}

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

.woobix-chat-send-button svg {
  width: 18px;
  height: 18px;
}

.woobix-chat-input,
.woobix-chat-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.woobix-chat-input:focus,
.woobix-chat-textarea:focus {
  outline: none;
  border-color: #667eea;
}

.woobix-chat-textarea {
  resize: none;
  min-height: 60px;
}

.woobix-chat-send-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.woobix-chat-send-btn:hover {
  transform: translateY(-2px);
}

.woobix-chat-send-btn:active {
  transform: translateY(0);
}

.woobix-chat-welcome {
  text-align: center;
  padding: 40px 20px;
}

.woobix-chat-welcome svg {
  width: 64px;
  height: 64px;
  color: #667eea;
  margin-bottom: 16px;
}

.woobix-chat-welcome h4 {
  margin: 0 0 8px 0;
  color: #1f2937;
  font-size: 18px;
}

.woobix-chat-welcome p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.woobix-chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.woobix-chat-info-form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media (max-width: 480px) {
  .woobix-chat-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 110px);
  }
}

/* Add styles for loading and notification states */
.woobix-notification {
  padding: 12px 16px;
  margin: 8px 8px 0 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  animation: slideDown 0.3s ease-out;
}

.woobix-notification.error {
  background-color: #fee;
  color: #c33;
  border-left: 4px solid #c33;
}

.woobix-notification.success {
  background-color: #efe;
  color: #3a3;
  border-left: 4px solid #3a3;
}

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

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

#woobix-chat-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
