/* ===================================================================
   SUPPORT CHATBOT WIDGET
   =================================================================== */

#support-widget-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #2A5298, #1B3A6B);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(27, 58, 107, 0.4);
  cursor: pointer;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid rgba(255,255,255,0.1);
}

#support-widget-btn:hover {
  transform: scale(1.08) translateY(-4px);
  box-shadow: 0 12px 28px rgba(27, 58, 107, 0.5);
}

#support-widget-btn .icon {
  font-size: 28px;
  animation: float 3s ease-in-out infinite;
}

#support-chat-window {
  position: fixed;
  bottom: 100px;
  left: 24px;
  width: 380px;
  height: 550px;
  max-height: calc(100vh - 120px);
  max-width: calc(100vw - 48px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.2);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
  border: 1px solid #e2e8f0;
}

#support-chat-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.support-header {
  background: linear-gradient(135deg, #1B3A6B, #2A5298);
  padding: 20px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.support-header-info h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Heebo', sans-serif;
}

.support-header-info p {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.support-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.support-close-btn:hover {
  opacity: 1;
}

.support-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.support-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  font-family: 'Heebo', sans-serif;
  animation: slideInMsg 0.3s ease-out;
  word-wrap: break-word;
}

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

.support-msg.user {
  align-self: flex-start;
  background: #1B3A6B;
  color: white;
  border-bottom-right-radius: 4px;
}

.support-msg.ai {
  align-self: flex-end;
  background: white;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.support-input-area {
  padding: 16px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 12px;
}

.support-input-area input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  outline: none;
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  color: #1e293b !important;
  transition: border-color 0.2s;
  background: #f8fafc;
}

.support-input-area input:focus {
  border-color: #2A5298;
  background: white;
}

.support-input-area button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1B3A6B;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.support-input-area button:hover {
  background: #2A5298;
  transform: scale(1.05);
}

.support-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-end;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.support-typing .dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.support-typing .dot:nth-child(1) { animation-delay: -0.32s; }
.support-typing .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0px); }
}

/* AI Rich Message Formatting */
.ai-block {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  border-right: 4px solid transparent;
  animation: slideInMsg 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1.4;
}
.ai-block:last-child {
  margin-bottom: 0;
}

.ai-block-title {
  font-weight: bold;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}

.ai-block-info {
  background: #f0f9ff;
  border-right-color: #38bdf8;
  color: #0c4a6e;
}

.ai-block-action {
  background: #ecfdf5;
  border-right-color: #34d399;
  color: #064e3b;
}

.ai-block-tip {
  background: #fffbeb;
  border-right-color: #fbbf24;
  color: #78350f;
}

.ai-block-question {
  background: #fdf4ff;
  border-color: #f5d0fe;
  border-style: solid;
  border-width: 1px;
  border-right-width: 4px;
  border-right-color: #e879f9;
  color: #701a75;
  font-weight: 500;
  border-radius: 16px;
}
