/* Al-Hamd Assistant — navy / white / gold */
#alhamd-ai, #alhamd-ai * { box-sizing: border-box; }
#alhamd-ai {
  --ah-primary: #0B1F3A; --ah-accent: #C9A24B;
  --ah-text: #1c2430; --ah-muted: #6b7686; --ah-bg: #ffffff; --ah-soft: #f4f6fa;
  position: fixed; bottom: 20px; z-index: 2147483000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Naskh Arabic", "Noto Nastaliq Urdu", Arial, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--ah-text);
}
/* Neutralise theme button/input styles (Hello Elementor colours buttons pink #c36 by default) */
#alhamd-ai button { text-transform: none; letter-spacing: normal; box-shadow: none; min-height: 0; line-height: 1.2; font-family: inherit; }
#alhamd-ai button:focus { outline: none; }
#alhamd-ai button, #alhamd-ai a { -webkit-tap-highlight-color: transparent; }
#alhamd-ai button:focus-visible, #alhamd-ai .ah-input:focus-visible { outline: 2px solid var(--ah-accent); outline-offset: 2px; }
#alhamd-ai .ah-chip { white-space: normal; }
#alhamd-ai.ah-pos-right { right: 20px; }
#alhamd-ai.ah-pos-left { left: 20px; }

/* Launcher */
#alhamd-ai .ah-launcher {
  position: relative; width: 62px; height: 62px; border-radius: 50%; border: 3px solid var(--ah-accent);
  background: var(--ah-primary); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(11, 31, 58, .35); transition: transform .2s; padding: 0; margin: 0;
}
#alhamd-ai .ah-launcher:hover { transform: scale(1.06); }
#alhamd-ai .ah-dot { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; background: var(--ah-accent); border: 2px solid #fff; border-radius: 50%; }
#alhamd-ai.ah-pos-left .ah-launcher { margin-right: auto; }
#alhamd-ai.ah-pos-right .ah-launcher { margin-left: auto; }

/* Teaser */
#alhamd-ai .ah-teaser {
  display: none; position: absolute; bottom: 76px; width: 250px; background: #fff; color: var(--ah-text);
  padding: 12px 30px 12px 14px; border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.16); border-left: 4px solid var(--ah-accent);
  font-size: 14px; cursor: pointer; animation: ah-pop .3s ease;
}
#alhamd-ai.ah-pos-right .ah-teaser { right: 0; }
#alhamd-ai.ah-pos-left .ah-teaser { left: 0; }
#alhamd-ai .ah-teaser.ah-show { display: block; }
#alhamd-ai .ah-teaser-x { position: absolute; top: 4px; right: 6px; background: none; border: 0; font-size: 18px; color: var(--ah-muted); cursor: pointer; padding: 2px 4px; }

/* Panel */
#alhamd-ai .ah-panel {
  display: none; position: absolute; bottom: 78px; width: 370px; height: 580px; max-height: calc(100vh - 110px);
  background: var(--ah-bg); border-radius: 18px; overflow: hidden; flex-direction: column;
  box-shadow: 0 14px 48px rgba(11, 31, 58, .28); animation: ah-pop .25s ease;
}
#alhamd-ai.ah-pos-right .ah-panel { right: 0; }
#alhamd-ai.ah-pos-left .ah-panel { left: 0; }
#alhamd-ai.ah-open .ah-panel { display: flex; }

#alhamd-ai .ah-head { background: var(--ah-primary); color: #fff; padding: 14px 12px 14px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 3px solid var(--ah-accent); }
#alhamd-ai .ah-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--ah-accent); color: var(--ah-primary); font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 42px; font-size: 15px; }
#alhamd-ai .ah-avatar img { width: 100%; height: 100%; object-fit: cover; }
#alhamd-ai .ah-head-text { flex: 1; min-width: 0; }
#alhamd-ai .ah-title { font-weight: 700; font-size: 16px; color: #fff; }
#alhamd-ai .ah-sub { font-size: 12px; color: rgba(255,255,255,.8); display: flex; align-items: center; gap: 6px; }
#alhamd-ai .ah-online { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; display: inline-block; }
#alhamd-ai .ah-icon-btn { background: transparent; border: 0; color: #fff; font-size: 22px; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; line-height: 1; padding: 0; }
#alhamd-ai .ah-icon-btn:hover { background: rgba(255,255,255,.12); }

#alhamd-ai .ah-body { flex: 1; overflow-y: auto; padding: 16px 12px; background: var(--ah-soft); -webkit-overflow-scrolling: touch; }
#alhamd-ai .ah-row { display: flex; margin: 6px 0; }
#alhamd-ai .ah-user { justify-content: flex-end; }
#alhamd-ai .ah-bubble { max-width: 82%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: start; }
#alhamd-ai .ah-bot .ah-bubble { background: #fff; border: 1px solid #e6e9ef; border-bottom-left-radius: 4px; }
#alhamd-ai .ah-user .ah-bubble { background: var(--ah-primary); color: #fff; border-bottom-right-radius: 4px; }
#alhamd-ai .ah-bubble a { color: inherit; text-decoration: underline; font-weight: 600; }
#alhamd-ai .ah-bot .ah-bubble a { color: var(--ah-primary); }

#alhamd-ai .ah-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
#alhamd-ai .ah-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ah-accent); animation: ah-bounce 1.2s infinite ease-in-out; }
#alhamd-ai .ah-typing span:nth-child(2) { animation-delay: .15s; }
#alhamd-ai .ah-typing span:nth-child(3) { animation-delay: .3s; }

#alhamd-ai .ah-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; background: var(--ah-soft); }
#alhamd-ai .ah-chip { background: #fff; border: 1.5px solid var(--ah-accent); color: var(--ah-primary); border-radius: 18px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-weight: 600; line-height: 1.2; }
#alhamd-ai .ah-chip:hover { background: var(--ah-accent); color: #fff; }

#alhamd-ai .ah-wa-bar { display: none; padding: 8px 12px; background: var(--ah-soft); border-top: 1px solid #e6e9ef; }
#alhamd-ai .ah-wa-bar.ah-show { display: block; }
#alhamd-ai .ah-wa-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: #25D366; color: #fff !important; text-decoration: none !important; border-radius: 10px; padding: 9px 12px; font-weight: 700; font-size: 14px; }

#alhamd-ai .ah-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #e6e9ef; background: #fff; margin: 0; }
#alhamd-ai .ah-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
#alhamd-ai .ah-input { flex: 1; resize: none; border: 1.5px solid #dfe3ea; border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 15px; max-height: 110px; outline: none; color: var(--ah-text); background: #fff; margin: 0; min-height: 42px; unicode-bidi: plaintext; }
#alhamd-ai .ah-input:focus { border-color: var(--ah-accent); }
#alhamd-ai .ah-send { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--ah-accent); color: var(--ah-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; flex: 0 0 42px; }
#alhamd-ai .ah-send:disabled { opacity: .5; cursor: default; }
#alhamd-ai .ah-foot { text-align: center; font-size: 11px; color: var(--ah-muted); padding: 0 0 8px; background: #fff; }
#alhamd-ai .ah-foot a { color: var(--ah-muted); }

@keyframes ah-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ah-bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

/* Mobile: full screen */
@media (max-width: 480px) {
  #alhamd-ai { bottom: 14px; }
  #alhamd-ai.ah-pos-right { right: 14px; } #alhamd-ai.ah-pos-left { left: 14px; }
  #alhamd-ai .ah-panel { position: fixed; inset: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; bottom: 0; }
  #alhamd-ai.ah-open .ah-launcher { display: none; }
  #alhamd-ai .ah-input { font-size: 16px; } /* stops iOS zoom */
}
