/* Smart assistant widget (replaced the floating WhatsApp button, 2026-10-07). */
.wzt-ai {
    --ai-blue: #218FE5;
    --ai-violet: #6d5dfc;
    --ai-ink: #0f172a;
    --ai-muted: #64748b;
    --ai-line: #e2e8f0;
    --ai-grad: linear-gradient(135deg, #218FE5 0%, #4f6ef7 55%, #7c5cff 100%);
    font-family: 'Noto Kufi Arabic', Tahoma, sans-serif;
}
.wzt-ai .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.wzt-ai [hidden] { display: none !important; }

/* --wzt-ad-offset (set by assistant.js) is the height of an AdSense anchor ad at the bottom of the
   screen; every floating control moves above it so nothing ever covers or crowds an ad. */
/* Make room above the launcher for the remaining floating buttons and the Telegram toast. */
.floating-actions { bottom: calc(88px + var(--wzt-ad-offset, 0px)); }
.back-to-top { bottom: calc(22px + var(--wzt-ad-offset, 0px)); }
.telegram-nudge { bottom: calc(222px + var(--wzt-ad-offset, 0px)); }

/* Footer + page buttons that open the assistant. */
.footer-contact-info .footer-contact-row-ai { background: none; border: 0; padding: 0; font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; text-align: start; }
.footer-contact-info .footer-contact-row-ai svg { color: #a5b4fc; }
/* These rows sit inside .footer-brand, whose `span` rule is the big Lalezar logo type; use the footer's body type. */
.footer-brand .footer-contact-row span { font-family: 'Noto Kufi Arabic', Tahoma, sans-serif; font-size: 0.92rem; font-weight: 500; color: inherit; letter-spacing: 0; }

/* ---- Launcher ---------------------------------------------------------- */
.wzt-ai-launcher { position: fixed; z-index: 60; bottom: calc(22px + var(--wzt-ad-offset, 0px)); right: 22px; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wzt-ai-orb { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%; background: var(--ai-grad); color: #fff; box-shadow: 0 12px 30px rgba(79,110,247,.45), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease; overflow: hidden; }
.wzt-ai-orb::before { content: ''; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent 0 65%, rgba(255,255,255,.55) 75%, transparent 85%); animation: wztSpin 4.5s linear infinite; }
.wzt-ai-orb::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--ai-grad); }
.wzt-ai-orb svg { position: relative; z-index: 1; width: 24px; height: 24px; fill: currentColor; transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .2s ease; }
.wzt-ai-orb .wzt-ai-icon-close { position: absolute; fill: none; opacity: 0; transform: rotate(-90deg) scale(.6); width: 20px; height: 20px; }
.wzt-ai-launcher::before, .wzt-ai-launcher::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(109,93,252,.55); animation: wztRipple 2.8s ease-out infinite; pointer-events: none; }
.wzt-ai-launcher::after { animation-delay: 1.4s; }
.wzt-ai-launcher:hover .wzt-ai-orb { transform: translateY(-3px) scale(1.06); box-shadow: 0 18px 38px rgba(79,110,247,.55); }
.wzt-ai-launcher:hover .wzt-ai-icon-spark { transform: rotate(18deg) scale(1.08); }
.wzt-ai-launcher:focus-visible { outline: 3px solid #fde68a; outline-offset: 3px; }
.wzt-ai.is-open .wzt-ai-launcher::before, .wzt-ai.is-open .wzt-ai-launcher::after { animation: none; opacity: 0; }
.wzt-ai.is-open .wzt-ai-icon-spark { opacity: 0; transform: rotate(90deg) scale(.5); }
.wzt-ai.is-open .wzt-ai-icon-close { opacity: 1; transform: rotate(0) scale(1); }
.wzt-ai-badge { position: absolute; top: -2px; left: -2px; z-index: 2; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px #fff; animation: wztPop .4s cubic-bezier(.34,1.56,.64,1); }

/* ---- Teaser bubble ----------------------------------------------------- */
.wzt-ai-teaser { position: fixed; z-index: 59; bottom: calc(30px + var(--wzt-ad-offset, 0px)); right: 88px; max-width: 240px; padding: 12px 16px 12px 30px; border-radius: 18px 18px 4px 18px; background: #fff; color: var(--ai-ink); box-shadow: 0 16px 40px rgba(15,23,42,.16); display: flex; flex-direction: column; gap: 2px; animation: wztRise .5s cubic-bezier(.16,1,.3,1); cursor: pointer; }
.wzt-ai-teaser strong { font-size: .86rem; }
.wzt-ai-teaser span { font-size: .78rem; color: var(--ai-muted); line-height: 1.6; }
.wzt-ai-teaser-close { position: absolute; top: 6px; left: 8px; width: 20px; height: 20px; padding: 0; border: 0; background: none; color: #94a3b8; font-size: 1.1rem; line-height: 1; cursor: pointer; }

/* ---- Panel ------------------------------------------------------------- */
.wzt-ai-panel { position: fixed; z-index: 61; bottom: calc(88px + var(--wzt-ad-offset, 0px)); right: 22px; width: 360px; height: min(580px, calc(100vh - 120px - var(--wzt-ad-offset, 0px))); display: flex; flex-direction: column; background: #f8fafc; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(15,23,42,.28), 0 0 0 1px rgba(15,23,42,.05); transform-origin: bottom right; animation: wztOpen .38s cubic-bezier(.16,1,.3,1); }
.wzt-ai-panel.is-closing { animation: wztClose .22s ease-in forwards; }
.wzt-ai-head { position: relative; display: flex; align-items: center; gap: 9px; padding: 13px 14px 16px; background: var(--ai-grad); color: #fff; }
.wzt-ai-head::after { content: ''; position: absolute; inset: auto 0 -1px 0; height: 14px; background: #f8fafc; border-radius: 14px 14px 0 0; }
.wzt-ai-orb-sm { width: 36px; height: 36px; flex: 0 0 auto; background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.wzt-ai-orb-sm::before, .wzt-ai-orb-sm::after { display: none; }
.wzt-ai-orb-sm svg { width: 19px; height: 19px; animation: wztTwinkle 3s ease-in-out infinite; }
.wzt-ai-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wzt-ai-head-text strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wzt-ai-online { font-size: .72rem; opacity: .92; display: flex; align-items: center; gap: 6px; }
.wzt-ai-online i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.3); animation: wztBreathe 2s ease-in-out infinite; }
.wzt-ai-icon-btn { width: 32px; height: 32px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .2s ease, transform .2s ease; }
.wzt-ai-icon-btn:hover { background: rgba(255,255,255,.26); transform: translateY(-1px); }
.wzt-ai-icon-btn svg { width: 16px; height: 16px; }

/* ---- Messages ---------------------------------------------------------- */
.wzt-ai-log { flex: 1; overflow-y: auto; padding: 10px 14px 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; overscroll-behavior: contain; }
.wzt-ai-log::-webkit-scrollbar { width: 6px; }
.wzt-ai-log::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
.wzt-ai-msg { display: flex; gap: 8px; align-items: flex-end; animation: wztRise .35s cubic-bezier(.16,1,.3,1); }
.wzt-ai-msg.is-user { flex-direction: row-reverse; }
.wzt-ai-avatar { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; background: var(--ai-grad); color: #fff; display: flex; align-items: center; justify-content: center; }
.wzt-ai-avatar svg { width: 15px; height: 15px; fill: currentColor; }
.wzt-ai-msg.is-admin .wzt-ai-avatar { background: linear-gradient(135deg, #10b981, #059669); }
.wzt-ai-msg-body { min-width: 0; max-width: 84%; display: flex; flex-direction: column; gap: 8px; }
.wzt-ai-bubble { padding: 9px 13px; border-radius: 16px 16px 16px 6px; background: #fff; color: var(--ai-ink); font-size: .83rem; line-height: 1.85; box-shadow: 0 2px 10px rgba(15,23,42,.06); word-break: break-word; }
.wzt-ai-msg.is-user .wzt-ai-bubble { border-radius: 18px 18px 6px 18px; background: var(--ai-grad); color: #fff; box-shadow: 0 6px 18px rgba(79,110,247,.28); }
.wzt-ai-msg.is-admin .wzt-ai-bubble { background: #ecfdf5; border: 1px solid #a7f3d0; color: #064e3b; }
.wzt-ai-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.wzt-ai-who { font-size: .68rem; color: #94a3b8; padding: 0 6px; margin-top: -4px; }
.wzt-ai-msg.is-admin .wzt-ai-who { color: #059669; font-weight: 700; }

/* Result cards */
.wzt-ai-cards { display: flex; flex-direction: column; gap: 6px; }
.wzt-ai-card { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--ai-line); color: var(--ai-ink); text-decoration: none; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.wzt-ai-card:hover { transform: translateX(-3px); border-color: #93c5fd; box-shadow: 0 8px 20px rgba(33,143,229,.14); }
.wzt-ai-card-icon { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #eff6ff; color: var(--ai-blue); }
.wzt-ai-card-icon svg { width: 18px; height: 18px; }
.wzt-ai-card[data-type="article"] .wzt-ai-card-icon { background: #fef3c7; color: #b45309; }
.wzt-ai-card[data-type="tool"] .wzt-ai-card-icon { background: #ede9fe; color: #6d28d9; }
.wzt-ai-card[data-type="telegram"] .wzt-ai-card-icon, .wzt-ai-card[data-type="channel"] .wzt-ai-card-icon, .wzt-ai-card[data-type="bell"] .wzt-ai-card-icon { background: #dcfce7; color: #15803d; }
.wzt-ai-card[data-type="company"] .wzt-ai-card-icon { background: #e0f2fe; color: #0369a1; }
.wzt-ai-card[data-type="search"] { background: linear-gradient(135deg, #eff6ff, #f5f3ff); border-style: dashed; }
.wzt-ai-card-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.wzt-ai-card-text strong { font-size: .8rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wzt-ai-card-text span { font-size: .7rem; color: var(--ai-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wzt-ai-card-badge { position: absolute; top: -7px; left: 10px; padding: 1px 8px; border-radius: 999px; background: #f59e0b; color: #fff; font-size: .62rem; font-weight: 700; }
.wzt-ai-card-arrow { color: #94a3b8; font-size: 1rem; flex: 0 0 auto; }

/* Quick replies */
.wzt-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-inline-start: 36px; animation: wztRise .45s cubic-bezier(.16,1,.3,1); }
.wzt-ai-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid #c7d2fe; background: #fff; color: #4338ca; font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; transition: background-color .2s ease, color .2s ease, transform .2s ease, border-color .2s ease; }
.wzt-ai-chip:hover { background: var(--ai-grad); color: #fff; border-color: transparent; transform: translateY(-2px); }

/* Typing indicator */
.wzt-ai-typing .wzt-ai-bubble { display: flex; gap: 5px; padding: 14px 16px; }
.wzt-ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: #a5b4fc; animation: wztDot 1.2s ease-in-out infinite; }
.wzt-ai-typing i:nth-child(2) { animation-delay: .15s; }
.wzt-ai-typing i:nth-child(3) { animation-delay: .3s; }

/* Hand-off form */
.wzt-ai-lead { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: #fff; border: 1px solid #c7d2fe; box-shadow: 0 8px 22px rgba(79,110,247,.12); }
.wzt-ai-lead-title { font-size: .78rem; font-weight: 700; color: #4338ca; display: flex; align-items: center; gap: 6px; }
.wzt-ai-lead input, .wzt-ai-lead textarea { width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--ai-line); background: #f8fafc; font: inherit; font-size: .8rem; color: var(--ai-ink); transition: border-color .2s ease, background-color .2s ease; }
.wzt-ai-lead input:focus, .wzt-ai-lead textarea:focus { outline: none; border-color: var(--ai-blue); background: #fff; }
.wzt-ai-lead textarea { min-height: 64px; resize: vertical; }
.wzt-ai-lead-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wzt-ai-lead-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wzt-ai-lead button { padding: 10px; border: 0; border-radius: 12px; background: var(--ai-grad); color: #fff; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; transition: transform .2s ease, opacity .2s ease; }
.wzt-ai-lead button:hover { transform: translateY(-1px); }
.wzt-ai-lead button[disabled] { opacity: .6; cursor: wait; }
.wzt-ai-lead-error { font-size: .74rem; color: #dc2626; }
.wzt-ai-lead.is-done { opacity: .55; pointer-events: none; }

/* ---- Composer ---------------------------------------------------------- */
.wzt-ai-compose { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 6px; padding-inline-start: 14px; background: #fff; border-radius: 18px; border: 1px solid var(--ai-line); box-shadow: 0 4px 16px rgba(15,23,42,.06); transition: border-color .2s ease, box-shadow .2s ease; }
.wzt-ai-compose:focus-within { border-color: #a5b4fc; box-shadow: 0 0 0 4px rgba(99,102,241,.12); }
.wzt-ai-compose textarea { flex: 1; min-width: 0; max-height: 110px; padding: 8px 0; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: .86rem; line-height: 1.6; color: var(--ai-ink); }
.wzt-ai-send { width: 36px; height: 36px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 12px; background: var(--ai-grad); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .2s ease, opacity .2s ease; }
.wzt-ai-send svg { width: 18px; height: 18px; transform: scaleX(-1); }
.wzt-ai-send:hover { transform: scale(1.06); }
.wzt-ai-send[disabled] { opacity: .45; cursor: default; transform: none; }
.wzt-ai-foot { margin: 6px 0 10px; padding: 0 14px; font-size: .64rem; color: #94a3b8; text-align: center; }

/* ---- Small screens: full-height sheet --------------------------------- */
@media (max-width: 480px) {
    .wzt-ai-launcher { bottom: calc(14px + var(--wzt-ad-offset, 0px)); right: 14px; width: 50px; height: 50px; }
    .floating-actions { bottom: calc(74px + var(--wzt-ad-offset, 0px)); }
    .back-to-top { bottom: calc(14px + var(--wzt-ad-offset, 0px)); }
    .telegram-nudge { bottom: calc(196px + var(--wzt-ad-offset, 0px)); }
    .wzt-ai-teaser { right: 74px; bottom: calc(18px + var(--wzt-ad-offset, 0px)); max-width: calc(100vw - 100px); }
    /* A floating card above the launcher, so the page stays visible around it. */
    .wzt-ai-panel { left: 12px; right: 12px; bottom: calc(74px + var(--wzt-ad-offset, 0px)); width: auto; height: min(520px, calc(100vh - 170px - var(--wzt-ad-offset, 0px))); height: min(520px, calc(100dvh - 170px - var(--wzt-ad-offset, 0px))); border-radius: 20px; transform-origin: bottom right; }
    .wzt-ai-head { padding: 10px 12px 14px; gap: 8px; }
    .wzt-ai-orb-sm { width: 34px; height: 34px; }
    .wzt-ai-orb-sm svg { width: 18px; height: 18px; }
    .wzt-ai-head-text strong { font-size: .86rem; }
    .wzt-ai-icon-btn { width: 32px; height: 32px; border-radius: 10px; }
    .wzt-ai-log { padding: 8px 10px 12px; gap: 10px; }
    .wzt-ai-bubble { font-size: .82rem; padding: 9px 12px; }
    .wzt-ai-compose { margin: 0 8px 8px; }
    .wzt-ai-compose textarea { font-size: 16px; }
    .wzt-ai-foot { display: none; }
}

/* ---- Motion ------------------------------------------------------------ */
@keyframes wztSpin { to { transform: rotate(360deg); } }
@keyframes wztRipple { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.65); opacity: 0; } }
@keyframes wztPop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes wztRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wztOpen { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes wztClose { to { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes wztDot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes wztBreathe { 50% { box-shadow: 0 0 0 6px rgba(74,222,128,0); } }
@keyframes wztTwinkle { 50% { transform: scale(1.12) rotate(10deg); } }
@media (prefers-reduced-motion: reduce) {
    .wzt-ai *, .wzt-ai *::before, .wzt-ai *::after, .wzt-ai-launcher::before, .wzt-ai-launcher::after { animation: none !important; transition: none !important; }
}
