/* STOSPN Support Bot: neon chat bubble, bottom-right (bottom-left in Arabic). */
#stospn-bot {
    --sbot-bg: #06030a;
    --sbot-panel: #0d0a1c;
    --sbot-cyan: #00f0ff;
    --sbot-blue: #3b82f6;
    --sbot-violet: #a855f7;
    --sbot-green: #00ff9c;
    --sbot-red: #ff4d6d;
    --sbot-text: #e8ecf6;
    --sbot-muted: #9aa3b8;
    --sbot-lift: 0px;
    position: fixed;
    right: 20px;
    bottom: calc(20px + var(--sbot-lift));
    z-index: 99991;
    font-family: 'Segoe UI', system-ui, -apple-system, 'Noto Sans Arabic', sans-serif;
    font-size: 15px;
    line-height: 1.45;
    color: var(--sbot-text);
    transition: bottom 0.3s ease;
}
#stospn-bot[dir="rtl"] { right: auto; left: 20px; }
#stospn-bot *, #stospn-bot *::before, #stospn-bot *::after { box-sizing: border-box; }

/* The theme styles every button and link (capitals, Orbitron, borders): undo that inside the chat. */
#stospn-bot button, #stospn-bot a, #stospn-bot textarea {
    text-transform: none;
    letter-spacing: normal;
    font-family: inherit;
    font-weight: inherit;
    min-height: 0;
    min-width: 0;
    margin: 0;
    box-shadow: none;
    text-shadow: none;
    line-height: 1.35;
    width: auto;
}


/* launcher */
#stospn-bot .sbot-launch {
    position: relative;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 1px solid rgba(0, 240, 255, 0.6);
    border-radius: 50%;
    background: var(--sbot-bg);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.35), 0 8px 24px rgba(0, 0, 0, 0.55);
    cursor: pointer;
    display: grid;
    place-items: center;
    margin-left: auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#stospn-bot[dir="rtl"] .sbot-launch { margin-left: 0; margin-right: auto; }
#stospn-bot .sbot-launch:hover, #stospn-bot .sbot-launch:focus-visible { transform: scale(1.06); box-shadow: 0 0 26px rgba(0, 240, 255, 0.55), 0 8px 24px rgba(0, 0, 0, 0.55); outline: none; }
#stospn-bot .sbot-launch img { width: 40px; height: 40px; border-radius: 10px; }
#stospn-bot .sbot-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--sbot-green);
    box-shadow: 0 0 8px var(--sbot-green);
    border: 2px solid var(--sbot-bg);
}
#stospn-bot.is-open .sbot-launch { display: none; }

/* teaser */
#stospn-bot .sbot-teaser {
    display: none;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px auto;
    width: max-content;
    max-width: 260px;
    padding: 8px 8px 8px 14px;
    border-radius: 14px;
    background: var(--sbot-panel);
    border: 1px solid rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.3);
    animation: sbot-pop 0.35s ease;
}
#stospn-bot[dir="rtl"] .sbot-teaser { margin: 0 auto 10px 0; padding: 8px 14px 8px 8px; }
#stospn-bot .sbot-teaser.is-on { display: flex; }
#stospn-bot.is-open .sbot-teaser { display: none; }
#stospn-bot .sbot-teaser-text { all: unset; cursor: pointer; color: var(--sbot-text); font-size: 14px; }
#stospn-bot .sbot-teaser-x { all: unset; cursor: pointer; color: var(--sbot-muted); font-size: 18px; padding: 0 6px; }

/* panel */
#stospn-bot .sbot-panel {
    display: none;
    flex-direction: column;
    width: 370px;
    height: min(580px, calc(100vh - 40px - var(--sbot-lift)));
    border-radius: 18px;
    overflow: hidden;
    background: var(--sbot-panel);
    border: 1px solid rgba(0, 240, 255, 0.45);
    box-shadow: 0 0 28px rgba(0, 240, 255, 0.22), 0 18px 40px rgba(0, 0, 0, 0.6);
    animation: sbot-pop 0.25s ease;
}
#stospn-bot.is-open .sbot-panel { display: flex; }
@keyframes sbot-pop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

#stospn-bot .sbot-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.14), rgba(168, 85, 247, 0.14));
    border-bottom: 1px solid rgba(0, 240, 255, 0.25);
}
#stospn-bot .sbot-head img { width: 34px; height: 34px; border-radius: 9px; }
#stospn-bot .sbot-who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#stospn-bot .sbot-who b { font-family: 'Orbitron', 'Segoe UI', sans-serif; font-size: 14px; letter-spacing: 0.04em; color: #fff; }
#stospn-bot .sbot-who small { color: var(--sbot-green); font-size: 12px; }
#stospn-bot .sbot-close { all: unset; cursor: pointer; font-size: 24px; line-height: 1; color: var(--sbot-muted); padding: 2px 6px; border-radius: 8px; }
#stospn-bot .sbot-close:hover, #stospn-bot .sbot-close:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.08); }

#stospn-bot .sbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 240, 255, 0.3) transparent;
}
#stospn-bot .sbot-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
#stospn-bot .sbot-bot { align-self: flex-start; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); border-end-start-radius: 4px; }
#stospn-bot .sbot-me { align-self: flex-end; background: linear-gradient(135deg, rgba(59, 130, 246, 0.55), rgba(168, 85, 247, 0.55)); color: #fff; border-end-end-radius: 4px; white-space: pre-wrap; }
#stospn-bot .sbot-text a { color: var(--sbot-cyan); text-decoration: underline; }
#stospn-bot .sbot-text strong { color: #fff; }
#stospn-bot .sbot-debug { margin-top: 6px; font-size: 11px; color: var(--sbot-muted); font-family: Consolas, monospace; }

#stospn-bot .sbot-typing { display: flex; gap: 4px; padding: 12px 14px; }
#stospn-bot .sbot-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--sbot-cyan); animation: sbot-blink 1.2s infinite ease-in-out; }
#stospn-bot .sbot-typing span:nth-child(2) { animation-delay: 0.2s; }
#stospn-bot .sbot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sbot-blink { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: none; } }

#stospn-bot .sbot-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
#stospn-bot .sbot-btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 240, 255, 0.5);
    background: transparent;
    color: var(--sbot-cyan);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}
#stospn-bot .sbot-btn:hover, #stospn-bot .sbot-btn:focus-visible { background: rgba(0, 240, 255, 0.12); outline: none; }
#stospn-bot .sbot-btn-main { background: linear-gradient(90deg, var(--sbot-cyan), var(--sbot-blue)); border-color: transparent; color: #06030a; font-weight: 600; }
#stospn-bot .sbot-btn-main:hover, #stospn-bot .sbot-btn-main:focus-visible { background: linear-gradient(90deg, #5ff6ff, #6aa0ff); }
#stospn-bot .sbot-btn:disabled { opacity: 0.5; cursor: default; }
#stospn-bot .sbot-rate { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; color: var(--sbot-muted); font-size: 12px; }
#stospn-bot .sbot-rate small { margin-inline-end: 4px; }
#stospn-bot .sbot-thumb { all: unset; cursor: pointer; padding: 2px 4px; border-radius: 6px; opacity: 0.7; font-size: 14px; }
#stospn-bot .sbot-thumb:hover, #stospn-bot .sbot-thumb:focus-visible { opacity: 1; background: rgba(255, 255, 255, 0.08); }

#stospn-bot .sbot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#stospn-bot .sbot-chip {
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(168, 85, 247, 0.55);
    background: rgba(168, 85, 247, 0.08);
    color: var(--sbot-text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
#stospn-bot .sbot-chip:hover, #stospn-bot .sbot-chip:focus-visible { background: rgba(168, 85, 247, 0.22); outline: none; }

/* sign-in card */
#stospn-bot .sbot-login {
    align-self: stretch;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(0, 255, 156, 0.45);
    background: rgba(0, 255, 156, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#stospn-bot .sbot-login-title { font-weight: 600; color: #fff; font-size: 14px; }
#stospn-bot .sbot-social, #stospn-bot .sbot-mail {
    display: block;
    text-align: center;
    padding: 9px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
#stospn-bot .sbot-social { background: #fff; color: #1f1f1f; }
#stospn-bot .sbot-social:hover, #stospn-bot .sbot-social:focus-visible { background: #e9f9ff; }
#stospn-bot .sbot-google { border: 2px solid #4285f4; }
#stospn-bot .sbot-mail { border: 1px solid rgba(255, 255, 255, 0.25); color: var(--sbot-text); font-weight: 400; }
#stospn-bot .sbot-mail:hover, #stospn-bot .sbot-mail:focus-visible { background: rgba(255, 255, 255, 0.06); }

#stospn-bot .sbot-ticket { align-self: stretch; padding: 10px; border-radius: 14px; border: 1px solid rgba(0, 240, 255, 0.35); background: rgba(0, 240, 255, 0.05); }
#stospn-bot .sbot-note, #stospn-bot .sbot-input {
    width: 100%;
    resize: none;
    font: inherit;
    font-size: 14px;
    color: var(--sbot-text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 8px 10px;
}
#stospn-bot .sbot-note:focus, #stospn-bot .sbot-input:focus { outline: none; border-color: var(--sbot-cyan); box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.2); }

#stospn-bot .sbot-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
#stospn-bot .sbot-input { flex: 1; max-height: 120px; min-height: 40px; }
#stospn-bot .sbot-send {
    flex: 0 0 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--sbot-cyan), var(--sbot-violet));
    color: #06030a;
    cursor: pointer;
    display: grid;
    place-items: center;
}
#stospn-bot[dir="rtl"] .sbot-send svg { transform: scaleX(-1); }
#stospn-bot .sbot-send:disabled { opacity: 0.5; cursor: default; }

/* phones: launcher smaller, panel as a bottom sheet */
/*
 * The theme gives every <button> a frame, background, glow and hover colours with !important
 * (stospn-custom.css). The chat's own buttons set theirs with !important too.
 */
#stospn-bot button, #stospn-bot a { backdrop-filter: none !important; text-shadow: none !important; text-transform: none !important; letter-spacing: normal !important; font-family: inherit !important; transition: background 0.15s ease, opacity 0.15s ease !important; }
#stospn-bot .sbot-launch, #stospn-bot .sbot-launch:hover, #stospn-bot .sbot-launch:focus-visible {
    background: var(--sbot-bg) !important;
    border: 1px solid rgba(0, 240, 255, 0.6) !important;
    border-radius: 50% !important;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.35), 0 8px 24px rgba(0, 0, 0, 0.55) !important;
}
#stospn-bot .sbot-launch:hover, #stospn-bot .sbot-launch:focus-visible { box-shadow: 0 0 26px rgba(0, 240, 255, 0.55), 0 8px 24px rgba(0, 0, 0, 0.55) !important; }
#stospn-bot .sbot-teaser-text, #stospn-bot .sbot-teaser-text:hover,
#stospn-bot .sbot-teaser-x, #stospn-bot .sbot-teaser-x:hover,
#stospn-bot .sbot-close, #stospn-bot .sbot-thumb {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
#stospn-bot .sbot-teaser-text, #stospn-bot .sbot-teaser-text:hover { color: var(--sbot-text) !important; }
#stospn-bot .sbot-teaser-x, #stospn-bot .sbot-close, #stospn-bot .sbot-thumb { color: var(--sbot-muted) !important; border-radius: 8px !important; }
#stospn-bot .sbot-close:hover, #stospn-bot .sbot-close:focus-visible,
#stospn-bot .sbot-thumb:hover, #stospn-bot .sbot-thumb:focus-visible { background: rgba(255, 255, 255, 0.08) !important; color: #fff !important; border: 0 !important; box-shadow: none !important; }
#stospn-bot .sbot-btn, #stospn-bot .sbot-btn:hover {
    border: 1px solid rgba(0, 240, 255, 0.5) !important;
    border-radius: 999px !important;
    color: var(--sbot-cyan) !important;
    box-shadow: none !important;
    background: transparent !important;
}
#stospn-bot .sbot-btn:hover, #stospn-bot .sbot-btn:focus-visible { background: rgba(0, 240, 255, 0.12) !important; }
#stospn-bot .sbot-btn-main, #stospn-bot .sbot-btn-main:hover {
    background: linear-gradient(90deg, var(--sbot-cyan), var(--sbot-blue)) !important;
    border-color: transparent !important;
    color: #06030a !important;
}
#stospn-bot .sbot-btn-main:hover, #stospn-bot .sbot-btn-main:focus-visible { background: linear-gradient(90deg, #5ff6ff, #6aa0ff) !important; }
#stospn-bot .sbot-chip, #stospn-bot .sbot-chip:hover {
    border: 1px solid rgba(168, 85, 247, 0.55) !important;
    border-radius: 999px !important;
    background: rgba(168, 85, 247, 0.08) !important;
    color: var(--sbot-text) !important;
    box-shadow: none !important;
}
#stospn-bot .sbot-chip:hover, #stospn-bot .sbot-chip:focus-visible { background: rgba(168, 85, 247, 0.22) !important; }
#stospn-bot .sbot-send, #stospn-bot .sbot-send:hover {
    background: linear-gradient(135deg, var(--sbot-cyan), var(--sbot-violet)) !important;
    border: 0 !important;
    border-radius: 10px !important;
    color: #06030a !important;
    box-shadow: none !important;
}
#stospn-bot .sbot-send:hover { opacity: 0.9; }

@media (max-width: 600px) {
    #stospn-bot { right: 14px; bottom: calc(14px + var(--sbot-lift)); }
    #stospn-bot[dir="rtl"] { left: 14px; }
    #stospn-bot .sbot-launch { width: 54px; height: 54px; }
    #stospn-bot .sbot-launch img { width: 36px; height: 36px; }
    #stospn-bot.is-open { left: 0; right: 0; bottom: 0; }
    #stospn-bot.is-open .sbot-panel { width: 100%; height: min(85vh, calc(100vh - 20px)); border-radius: 18px 18px 0 0; }
    #stospn-bot .sbot-msg { max-width: 92%; }
    #stospn-bot .sbot-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    #stospn-bot .sbot-panel, #stospn-bot .sbot-teaser, #stospn-bot .sbot-typing span { animation: none; }
}
