/* Simple AI Chat Widget - Public CSS - RTL SaaS */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

.saic-widget {
  font-family: 'Cairo', Tahoma, sans-serif;
  background: #F7F9FC;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: var(--saic-height, 600px);
  max-width: 100%;
  direction: rtl;
  box-shadow: 0 4px 12px rgba(23,32,51,0.06);
  color: #172033;
}
.saic-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.saic-header-title { font-weight: 700; font-size: 15px; color: #172033; }
.saic-header-actions { display: flex; gap: 8px; align-items: center; }
.saic-provider-select { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 8px; background:#fff; font-size: 13px; }
.saic-clear-btn { background:#f3f4f6; border:1px solid #e5e7eb; padding:6px 10px; border-radius:8px; cursor:pointer; font-size:12px; }
.saic-clear-btn:hover { background:#e5e7eb; }
.saic-messages { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:12px; background:#F7F9FC; }
.saic-welcome { text-align:center; color:#667085; padding:20px; font-size:14px; }
.saic-message { max-width:85%; padding:10px 14px; border-radius:14px; line-height:1.6; font-size:14px; word-break:break-word; position:relative; }
.saic-message-user { align-self:flex-start; background:#16A6A1; color:#fff; border-bottom-right-radius:4px; }
.saic-message-assistant { align-self:flex-end; background:#fff; border:1px solid #e5e7eb; border-bottom-left-radius:4px; color:#172033; }
.saic-message .saic-meta { font-size:10px; opacity:0.7; margin-top:4px; }
.saic-message pre { background:#172033; color:#fff; padding:10px; border-radius:8px; overflow:auto; direction:ltr; text-align:left; margin:8px 0; }
.saic-message code { background:rgba(0,0,0,0.05); padding:2px 6px; border-radius:4px; font-family:monospace; }
.saic-typing { padding:8px 16px; color:#667085; font-size:13px; display:flex; align-items:center; gap:6px; }
.saic-typing span { width:6px; height:6px; background:#667085; border-radius:50%; display:inline-block; animation:saic-bounce 1.4s infinite; }
.saic-typing span:nth-child(2){ animation-delay:0.2s; }
.saic-typing span:nth-child(3){ animation-delay:0.4s; }
@keyframes saic-bounce { 0%,80%,100%{transform:scale(0.8); opacity:0.5;} 40%{transform:scale(1); opacity:1;} }
.saic-composer { background:#fff; border-top:1px solid #e5e7eb; padding:10px 12px; display:flex; align-items:flex-end; gap:8px; }
.saic-attach-btn { background:#f3f4f6; border:1px solid #e5e7eb; border-radius:8px; width:36px; height:36px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.saic-input { flex:1; border:1px solid #d1d5db; border-radius:10px; padding:10px 12px; resize:none; min-height:40px; max-height:120px; font-family:inherit; font-size:14px; outline:none; }
.saic-input:focus { border-color:#16A6A1; box-shadow:0 0 0 3px rgba(22,166,161,0.15); }
.saic-send-btn { background:#16A6A1; color:#fff; border:none; border-radius:10px; padding:10px 16px; cursor:pointer; font-weight:600; font-size:14px; }
.saic-send-btn:disabled { opacity:0.5; cursor:not-allowed; }
.saic-send-btn:hover:not(:disabled){ background:#149089; }
.saic-error { background:#fee2e2; border-top:1px solid #fecaca; color:#991b1b; padding:10px 16px; font-size:13px; }
.saic-attachment-preview { background:#f9fafb; border:1px dashed #d1d5db; border-radius:8px; padding:8px; font-size:12px; display:flex; align-items:center; gap:8px; }
.saic-attachment-preview .saic-remove-attach { color:#D64545; cursor:pointer; margin-right:auto; }
@media(max-width:600px){ .saic-widget{ height:500px !important; border-radius:0; } .saic-message{ max-width:92%; } }
