/* MCA Islamic Study chatbot widget */
.mca-chatbot-root{--mca-chat-primary:#1a5c3a;--mca-chat-primary-dark:#134a2e;--mca-chat-accent:#c9973a;--mca-chat-bg:#fff;--mca-chat-text:#1a2e1e;--mca-chat-muted:#5a6b5f;--mca-chat-border:rgba(26,92,58,.12);--mca-chat-shadow:0 12px 40px rgba(15,40,25,.22);font-family:ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,'Nunito',sans-serif;z-index:99999}
.mca-chatbot-root *,.mca-chatbot-root *::before,.mca-chatbot-root *::after{box-sizing:border-box}
.mca-chatbot-toggle{position:fixed;right:1.25rem;bottom:1.25rem;width:3.75rem;height:3.75rem;border:none;border-radius:9999px;background:linear-gradient(135deg,var(--mca-chat-primary) 0%,#2d7a52 100%);color:#fff;cursor:pointer;box-shadow:var(--mca-chat-shadow);display:flex;align-items:center;justify-content:center;font-size:1.5rem;transition:transform .2s ease,box-shadow .2s ease}
.mca-chatbot-toggle:hover{transform:scale(1.05);box-shadow:0 16px 48px rgba(15,40,25,.28)}
.mca-chatbot-toggle:focus-visible{outline:3px solid var(--mca-chat-accent);outline-offset:3px}
.mca-chatbot-toggle.is-open{background:linear-gradient(135deg,#334155 0%,#475569 100%)}
.mca-chatbot-toggle__badge{position:absolute;top:-2px;right:-2px;width:.75rem;height:.75rem;border-radius:9999px;background:var(--mca-chat-accent);border:2px solid #fff}
.mca-chatbot-panel{position:fixed;right:1.25rem;bottom:5.5rem;width:min(22rem,calc(100vw - 2rem));max-height:min(32rem,calc(100vh - 7rem));background:var(--mca-chat-bg);border-radius:1.125rem;box-shadow:var(--mca-chat-shadow);border:1px solid var(--mca-chat-border);display:flex;flex-direction:column;overflow:hidden;opacity:0;visibility:hidden;transform:translateY(12px) scale(.96);transition:opacity .22s ease,transform .22s ease,visibility .22s}
.mca-chatbot-panel.is-open{opacity:1;visibility:visible;transform:translateY(0) scale(1)}
.mca-chatbot-header{background:linear-gradient(135deg,var(--mca-chat-primary) 0%,#2d7a52 55%,var(--mca-chat-accent) 140%);color:#fff;padding:.9rem 1rem;display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-shrink:0}
.mca-chatbot-header__info{min-width:0}
.mca-chatbot-header__title{margin:0;font-size:.95rem;font-weight:800;line-height:1.25}
.mca-chatbot-header__sub{margin:.15rem 0 0;font-size:.72rem;opacity:.88}
.mca-chatbot-header__actions{display:flex;gap:.35rem;flex-shrink:0}
.mca-chatbot-icon-btn{width:2rem;height:2rem;border:none;border-radius:.5rem;background:rgba(255,255,255,.18);color:#fff;cursor:pointer;font-size:.85rem;display:flex;align-items:center;justify-content:center;transition:background .15s}
.mca-chatbot-icon-btn:hover{background:rgba(255,255,255,.3)}
.mca-chatbot-messages{flex:1;overflow-y:auto;padding:1rem;display:flex;flex-direction:column;gap:.75rem;background:linear-gradient(180deg,#f8fbf9 0%,#fff 100%);min-height:14rem}
.mca-chatbot-msg{max-width:88%;padding:.65rem .85rem;border-radius:1rem;font-size:.875rem;line-height:1.55;word-wrap:break-word;white-space:pre-wrap}
.mca-chatbot-msg--bot{align-self:flex-start;background:#fff;border:1px solid var(--mca-chat-border);color:var(--mca-chat-text);border-bottom-left-radius:.25rem}
.mca-chatbot-msg--user{align-self:flex-end;background:var(--mca-chat-primary);color:#fff;border-bottom-right-radius:.25rem}
.mca-chatbot-msg--system{align-self:center;background:#fdf6e0;border:1px solid rgba(201,151,58,.35);color:#5a4a12;font-size:.8rem;text-align:center;max-width:100%}
.mca-chatbot-typing{align-self:flex-start;display:flex;gap:.25rem;padding:.65rem .85rem;background:#fff;border:1px solid var(--mca-chat-border);border-radius:1rem;border-bottom-left-radius:.25rem}
.mca-chatbot-typing span{width:.45rem;height:.45rem;border-radius:9999px;background:var(--mca-chat-muted);animation:mca-chatbot-bounce 1.2s infinite ease-in-out}
.mca-chatbot-typing span:nth-child(2){animation-delay:.15s}
.mca-chatbot-typing span:nth-child(3){animation-delay:.3s}
@keyframes mca-chatbot-bounce{0%,80%,100%{transform:translateY(0);opacity:.45}40%{transform:translateY(-4px);opacity:1}}
.mca-chatbot-input-wrap{padding:.75rem;border-top:1px solid var(--mca-chat-border);background:#fff;flex-shrink:0}
.mca-chatbot-form{display:flex;gap:.5rem;align-items:flex-end}
.mca-chatbot-input{flex:1;min-height:2.5rem;max-height:6rem;resize:none;border:1px solid var(--mca-chat-border);border-radius:.75rem;padding:.55rem .75rem;font-size:.875rem;font-family:inherit;color:var(--mca-chat-text);line-height:1.4}
.mca-chatbot-input:focus{outline:none;border-color:var(--mca-chat-primary);box-shadow:0 0 0 3px rgba(26,92,58,.12)}
.mca-chatbot-input:disabled{background:#f1f5f3;cursor:not-allowed}
.mca-chatbot-send{width:2.5rem;height:2.5rem;flex-shrink:0;border:none;border-radius:.75rem;background:var(--mca-chat-primary);color:#fff;cursor:pointer;font-size:1rem;display:flex;align-items:center;justify-content:center;transition:background .15s}
.mca-chatbot-send:hover:not(:disabled){background:var(--mca-chat-primary-dark)}
.mca-chatbot-send:disabled{opacity:.5;cursor:not-allowed}
.mca-chatbot-footer-note{margin:.4rem 0 0;font-size:.65rem;color:var(--mca-chat-muted);text-align:center;line-height:1.4}
@media (max-width:480px){.mca-chatbot-panel{right:.75rem;left:.75rem;width:auto;bottom:5rem;max-height:calc(100vh - 6rem)}.mca-chatbot-toggle{right:1rem;bottom:1rem}}
@media print{.mca-chatbot-root{display:none!important}}
