/* FloatChat — floating bubble chat widget (modern theme).
   All selectors namespaced with .fc- to avoid clashing with the host site.
   Dark, glassy, gradient-accented. Responsive (full-width on mobile). */

.fc-root {
    --fc-accent: #7c5cff;
    --fc-accent-2: #b06bff;
    --fc-grad: linear-gradient(135deg, #7c5cff, #b06bff);
    --fc-bg: rgba(17, 18, 26, 0.92);
    --fc-bg-solid: #11121a;
    --fc-bg-2: rgba(30, 32, 44, 0.85);
    --fc-surface: rgba(255, 255, 255, 0.04);
    --fc-surface-2: rgba(255, 255, 255, 0.07);
    --fc-border: rgba(255, 255, 255, 0.08);
    --fc-text: #eef0f6;
    --fc-muted: #9aa0bb;
    --fc-danger: #ff5c7a;
    --fc-ok: #35d6a0;
    --fc-gold: #ffcf6b;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147483000;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.fc-root * { box-sizing: border-box; }

/* ---- Floating bubble ---- */
.fc-bubble {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--fc-grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(124, 92, 255, 0.45), 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease;
}
.fc-bubble::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(124, 92, 255, 0.5);
    animation: fc-ring 2.4s ease-out infinite;
}
@keyframes fc-ring {
    0% { transform: scale(1); opacity: .6; }
    100% { transform: scale(1.5); opacity: 0; }
}
.fc-bubble:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 16px 38px rgba(124, 92, 255, 0.55); }
.fc-bubble svg { width: 27px; height: 27px; position: relative; z-index: 1; }
.fc-root.fc-open .fc-bubble::after { display: none; }

.fc-badge {
    position: absolute;
    top: -3px; right: -3px;
    min-width: 20px; height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--fc-danger);
    color: #fff;
    font-size: 11px; line-height: 20px;
    text-align: center; font-weight: 800;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
    z-index: 2;
}

/* ---- Panel ---- */
.fc-panel {
    position: absolute;
    right: 0; bottom: 78px;
    width: 374px;
    max-width: calc(100vw - 44px);
    height: 520px;
    max-height: calc(100vh - 130px);
    background: var(--fc-bg);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid var(--fc-border);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
}
.fc-root.fc-open .fc-panel { display: flex; animation: fc-pop .22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes fc-pop {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fc-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(124,92,255,.14), rgba(124,92,255,0));
    border-bottom: 1px solid var(--fc-border);
}
.fc-header h3 { margin: 0; font-size: 16px; color: #fff; font-weight: 800; letter-spacing: .2px; }
.fc-header .fc-live { font-size: 11px; color: var(--fc-ok); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.fc-live::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fc-ok);
    box-shadow: 0 0 0 0 rgba(53,214,160,.6); animation: fc-live 1.8s infinite;
}
@keyframes fc-live { 0%{box-shadow:0 0 0 0 rgba(53,214,160,.5);} 70%{box-shadow:0 0 0 6px rgba(53,214,160,0);} 100%{box-shadow:0 0 0 0 rgba(53,214,160,0);} }
.fc-close { background: none; border: none; color: var(--fc-muted); cursor: pointer; font-size: 22px; line-height: 1; padding: 2px 4px; border-radius: 8px; transition: .15s; }
.fc-close:hover { color: #fff; background: var(--fc-surface-2); }

/* ---- Messages ---- */
.fc-messages {
    flex: 1; overflow-y: auto; padding: 14px 14px 8px;
    display: flex; flex-direction: column; gap: 4px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.fc-messages::-webkit-scrollbar { width: 7px; }
.fc-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 4px; }

.fc-msg {
    display: flex; gap: 10px; padding: 7px 8px; border-radius: 12px;
    animation: fc-msg-in .22s ease;
    transition: background .15s;
}
.fc-msg:hover { background: var(--fc-surface); }
@keyframes fc-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.fc-avatar {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 15px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
    user-select: none;
}
.fc-avatar.fc-clickable { cursor: pointer; }
.fc-msg-content { min-width: 0; flex: 1; }
.fc-msg-head { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; flex-wrap: wrap; }
.fc-msg-user { font-size: 13.5px; font-weight: 700; color: var(--fc-accent-2); -webkit-user-select: none; user-select: none; }
.fc-msg-user.fc-role-admin { color: #ff7a8f; }
.fc-msg-user.fc-role-staff { color: var(--fc-gold); }
.fc-msg-user.fc-clickable { cursor: pointer; }
.fc-msg-user.fc-clickable:hover { text-decoration: underline; }
.fc-msg-time { font-size: 10px; color: var(--fc-muted); margin-left: auto; }
.fc-msg-body { font-size: 13.5px; color: var(--fc-text); line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere; }
.fc-msg-body a { color: var(--fc-accent-2); text-decoration: none; }
.fc-msg-body a:hover { text-decoration: underline; }

/* ---- Role/license badges ---- */
.fc-badge-role {
    font-size: 9px; font-weight: 800; letter-spacing: .6px;
    padding: 2px 6px; border-radius: 6px; text-transform: uppercase;
    color: #fff; line-height: 1.3;
}
.fc-badge-admin { background: linear-gradient(135deg, #ff5c7a, #ff3d6e); }
.fc-badge-client { background: linear-gradient(135deg, #ffcf6b, #f5a623); color: #4a2d00; }

.fc-system { text-align: center; font-size: 12px; color: var(--fc-muted); padding: 10px 0; }

/* ---- Footer / input ---- */
.fc-footer { border-top: 1px solid var(--fc-border); padding: 12px; background: rgba(0,0,0,.15); }
.fc-notice { font-size: 12px; color: var(--fc-danger); margin-bottom: 8px; display: none; }
.fc-notice.fc-show { display: block; }
.fc-inputrow { display: flex; gap: 9px; }
.fc-input {
    flex: 1; background: var(--fc-surface-2); border: 1px solid var(--fc-border);
    border-radius: 12px; padding: 11px 14px; color: var(--fc-text); font-size: 13.5px; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.fc-input::placeholder { color: var(--fc-muted); }
.fc-input:focus { border-color: var(--fc-accent); box-shadow: 0 0 0 3px rgba(124,92,255,.18); }
.fc-input:disabled { opacity: .5; cursor: not-allowed; }
.fc-send {
    border: none; border-radius: 12px; padding: 0 15px; background: var(--fc-grad); color: #fff;
    cursor: pointer; display: flex; align-items: center; transition: transform .12s, filter .12s;
}
.fc-send:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.fc-send:disabled { opacity: .5; cursor: not-allowed; }
.fc-send svg { width: 18px; height: 18px; }

/* ---- Hover mini-profile ---- */
.fc-hovercard {
    position: fixed; z-index: 2147483001;
    width: 210px; padding: 12px;
    background: var(--fc-bg-solid);
    border: 1px solid var(--fc-border); border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,.55);
    transform: translateY(-100%);
    pointer-events: none;
    animation: fc-msg-in .14s ease;
}
.fc-hc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fc-hc-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.fc-hc-id { min-width: 0; }
.fc-hc-name { font-size: 14px; font-weight: 700; color: #fff; }
.fc-hc-badge { margin-top: 3px; }
.fc-hc-member { font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--fc-muted); }
.fc-hc-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; padding: 3px 0; }
.fc-hc-row span { color: var(--fc-muted); }
.fc-hc-row b { color: var(--fc-text); font-weight: 600; }

/* ---- Moderation popover (admin) ---- */
.fc-modpop {
    position: absolute; inset: 0; background: var(--fc-bg-solid); z-index: 6;
    flex-direction: column; padding: 16px; gap: 12px; overflow-y: auto;
    animation: fc-msg-in .16s ease;
}
.fc-mod-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--fc-border); padding-bottom: 12px; }
.fc-mod-head strong { color: #fff; font-size: 16px; }
.fc-mod-close { background: none; border: none; color: var(--fc-muted); font-size: 21px; line-height: 1; cursor: pointer; }
.fc-mod-close:hover { color: #fff; }
.fc-mod-loading, .fc-mod-error { color: var(--fc-muted); font-size: 13px; padding: 8px 0; }
.fc-mod-error { color: var(--fc-danger); }
.fc-mod-body { display: flex; flex-direction: column; gap: 9px; }
.fc-mod-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }
.fc-mod-row span { color: var(--fc-muted); }
.fc-mod-row b { color: var(--fc-text); font-weight: 600; text-align: right; word-break: break-word; }
.fc-mod-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.fc-mod-btn { border: 1px solid var(--fc-border); background: var(--fc-surface-2); color: var(--fc-text); border-radius: 10px; padding: 8px 13px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s; }
.fc-mod-btn:hover { border-color: var(--fc-accent); transform: translateY(-1px); }
.fc-mod-btn.fc-mod-danger { color: var(--fc-danger); border-color: rgba(255,92,122,.35); }
.fc-mod-btn.fc-mod-danger:hover { background: rgba(255,92,122,.14); }
.fc-mod-btn.fc-mod-ok { color: var(--fc-ok); border-color: rgba(53,214,160,.35); }
.fc-mod-btn.fc-mod-ok:hover { background: rgba(53,214,160,.14); }
.fc-mod-notice { font-size: 12px; color: var(--fc-muted); min-height: 16px; }

/* ---- Header controls (online + sound) ---- */
.fc-head-left { display: flex; align-items: center; gap: 10px; }
.fc-head-right { display: flex; align-items: center; gap: 6px; }
.fc-online {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--fc-surface-2); border: 1px solid var(--fc-border);
    color: var(--fc-text); border-radius: 20px; padding: 4px 10px;
    font-size: 12px; font-weight: 700; cursor: pointer; transition: .15s;
}
.fc-online:hover { border-color: var(--fc-accent); }
.fc-online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fc-ok); box-shadow: 0 0 6px var(--fc-ok); }
.fc-sound { background: none; border: none; cursor: pointer; font-size: 16px; padding: 2px 5px; border-radius: 8px; line-height: 1; transition: .15s; }
.fc-sound:hover { background: var(--fc-surface-2); }

/* ---- Online list dropdown ---- */
.fc-onlinelist {
    position: absolute; top: 58px; right: 12px; z-index: 7;
    width: 194px; max-height: 260px; overflow-y: auto;
    background: var(--fc-bg-solid); border: 1px solid var(--fc-border);
    border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); padding: 8px;
}
.fc-ol-head { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--fc-muted); padding: 4px 6px 8px; }
.fc-ol-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; font-size: 13px; color: var(--fc-text); border-radius: 8px; }
.fc-ol-item:hover { background: var(--fc-surface); }
.fc-ol-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.fc-ol-guest { color: var(--fc-muted); font-size: 12px; }

/* ---- Typing indicator ---- */
.fc-typing { padding: 3px 16px 7px; font-size: 11.5px; color: var(--fc-muted); font-style: italic; }

/* ---- Mentions ---- */
.fc-mention { color: var(--fc-accent-2); font-weight: 600; }
.fc-mention-me { background: rgba(124, 92, 255, .22); border-radius: 5px; padding: 0 3px; color: #fff; }

/* ---- Emoji ---- */
.fc-emoji-btn { flex: 0 0 auto; background: var(--fc-surface-2); border: 1px solid var(--fc-border); color: var(--fc-muted); border-radius: 12px; width: 44px; font-size: 18px; cursor: pointer; transition: .15s; }
.fc-emoji-btn:hover { color: var(--fc-text); border-color: var(--fc-accent); }
.fc-emojis { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 10px; max-height: 168px; overflow-y: auto; background: var(--fc-surface); border: 1px solid var(--fc-border); border-radius: 12px; padding: 8px; }
.fc-emoji { background: none; border: none; cursor: pointer; font-size: 20px; width: 34px; height: 34px; border-radius: 8px; transition: transform .1s, background .1s; }
.fc-emoji:hover { background: var(--fc-surface-2); transform: scale(1.18); }

/* ---- Message hover tools (reply / react) ---- */
.fc-msg { position: relative; }
.fc-msg-tools {
    position: absolute; top: 2px; right: 6px; display: none; gap: 2px;
    background: var(--fc-bg-solid); border: 1px solid var(--fc-border);
    border-radius: 8px; padding: 2px; box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.fc-msg:hover .fc-msg-tools { display: flex; }
.fc-tool { background: none; border: none; color: var(--fc-muted); cursor: pointer; font-size: 14px; width: 26px; height: 24px; border-radius: 6px; line-height: 1; }
.fc-tool:hover { background: var(--fc-surface-2); color: var(--fc-text); }

/* ---- Reply quote inside a message ---- */
.fc-quote {
    border-left: 3px solid var(--fc-accent); background: var(--fc-surface);
    border-radius: 0 8px 8px 0; padding: 4px 8px; margin: 2px 0 5px; cursor: pointer; max-width: 100%;
}
.fc-quote:hover { background: var(--fc-surface-2); }
.fc-quote-user { display: block; font-size: 11px; font-weight: 700; color: var(--fc-accent-2); }
.fc-quote-body { display: block; font-size: 12px; color: var(--fc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Reactions ---- */
.fc-reactions { display: none; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.fc-reaction {
    display: inline-flex; align-items: center; gap: 3px;
    background: var(--fc-surface-2); border: 1px solid var(--fc-border);
    border-radius: 12px; padding: 2px 8px; font-size: 12px; color: var(--fc-text); cursor: pointer; transition: .12s;
}
.fc-reaction:hover { border-color: var(--fc-accent); }
.fc-reaction-mine { background: rgba(124, 92, 255, .22); border-color: var(--fc-accent); }

/* ---- Reply bar (above input) ---- */
.fc-replybar {
    display: none; align-items: center; justify-content: space-between; gap: 8px;
    background: var(--fc-surface-2); border-left: 3px solid var(--fc-accent);
    border-radius: 8px; padding: 6px 10px; margin-bottom: 8px;
}
.fc-replybar-txt { min-width: 0; }
.fc-replybar-txt b { display: block; font-size: 11px; color: var(--fc-accent-2); }
.fc-replybar-txt span { display: block; font-size: 12px; color: var(--fc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-replybar-x { background: none; border: none; color: var(--fc-muted); cursor: pointer; font-size: 18px; line-height: 1; }
.fc-replybar-x:hover { color: var(--fc-text); }

/* ---- Reaction picker popup ---- */
.fc-reactpicker {
    position: fixed; z-index: 2147483002; display: none; gap: 2px;
    background: var(--fc-bg-solid); border: 1px solid var(--fc-border);
    border-radius: 12px; padding: 5px; box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.fc-rp { background: none; border: none; cursor: pointer; font-size: 20px; width: 32px; height: 32px; border-radius: 8px; transition: transform .1s, background .1s; }
.fc-rp:hover { background: var(--fc-surface-2); transform: scale(1.2); }

/* ---- Flash highlight (jump to replied message) ---- */
.fc-flash { animation: fc-flash 1.2s ease; }
@keyframes fc-flash { 0%, 100% { background: transparent; } 30% { background: rgba(124, 92, 255, .22); } }

/* ---- Pinned announcement ---- */
.fc-announce {
    display: none; padding: 10px 14px; font-size: 12.5px; color: var(--fc-text);
    background: linear-gradient(180deg, rgba(124, 92, 255, .16), rgba(124, 92, 255, .05));
    border-bottom: 1px solid var(--fc-border);
    white-space: pre-wrap; word-break: break-word;
}
.fc-announce::before { content: "📌 "; }

/* ---- Room tabs ---- */
.fc-rooms {
    display: none; gap: 6px; padding: 8px 12px; overflow-x: auto;
    border-bottom: 1px solid var(--fc-border); background: rgba(0, 0, 0, .12);
    scrollbar-width: none;
}
.fc-rooms::-webkit-scrollbar { display: none; }
.fc-room {
    flex: 0 0 auto; background: var(--fc-surface-2); border: 1px solid var(--fc-border);
    color: var(--fc-muted); border-radius: 20px; padding: 5px 12px; font-size: 12px;
    font-weight: 600; cursor: pointer; white-space: nowrap; transition: .15s;
}
.fc-room:hover { color: var(--fc-text); border-color: var(--fc-accent); }
.fc-room-active { background: var(--fc-grad); color: #fff; border-color: transparent; }

/* ---- System / bot messages ---- */
.fc-msg-user.fc-role-system { color: var(--fc-ok); }
.fc-badge-system { background: linear-gradient(135deg, #35d6a0, #23b4d8); color: #04231a; }
.fc-botline {
    align-self: center; max-width: 92%; margin: 4px 0;
    background: var(--fc-surface-2); border: 1px dashed var(--fc-border);
    border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--fc-muted);
    white-space: pre-wrap; word-break: break-word;
}

@media (max-width: 480px) {
    .fc-root { right: 14px; bottom: 14px; }
    .fc-panel { width: calc(100vw - 20px); height: calc(100vh - 92px); right: -4px; }
}
