/* ═══════════════════════════════════════════════════
   Community Chat Widget — ticker.guru
   ═══════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────── */
:root {
    --cc-bg:          #1f1f1f;
    --cc-bg-dark:     #171717;
    --cc-bg-input:    #171717;
    --cc-bg-hover:    #2a2a2a;
    --cc-bg-mine:     #2a2b4a;
    --cc-bg-other:    #242424;
    --cc-text:        #e8e8e8;
    --cc-text-muted:  #9a9a9a;
    --cc-border:      #303030;
    --cc-primary:     #7367f0;
    --cc-success:     #28c76f;
    --cc-danger:      #ff4c51;
    --cc-warning:     #ff9f43;
    --cc-radius:      12px;
    --cc-width:       380px;
    --cc-height:      620px;
}

/* ─── Widget container ──────────────────────────── */
/* Oculto por default — solo visible en rutas protegidas autenticadas (body.app-route-protected) */
.cc-widget {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1080;
    font-family: 'Public Sans', sans-serif;
}

body.app-route-protected .cc-widget {
    display: block;
}

/* Oculta el widget cuando hay un modal o offcanvas activo (evita que el bubble tape el diálogo) */
body.modal-open .cc-widget,
body:has(.offcanvas.show) .cc-widget {
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

/* ─── Floating bubble ───────────────────────────── */
.cc-bubble {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    /* Liquid morado animado: múltiples stops que se mueven con background-position */
    background:
        radial-gradient(circle at 20% 20%, #8b80ff 0%, transparent 55%),
        radial-gradient(circle at 80% 30%, #6258d6 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, #7d70f2 0%, transparent 60%),
        linear-gradient(135deg, #7367f0 0%, #7d70f2 100%);
    background-size: 180% 180%, 180% 180%, 180% 180%, 100% 100%;
    background-position: 0% 0%, 100% 0%, 50% 100%, 0% 0%;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.22),
        inset 0 0 0 1px rgba(255,255,255,.08),
        0 6px 22px rgba(115, 103, 240, .45);
    transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s;
    position: relative;
    animation: ccBubbleLiquid 9s ease-in-out infinite;
    /* El background queda recortado en círculo por border-radius + background-clip (default).
       Se omite overflow:hidden para que el badge de notificación pueda sobresalir. */
}
@keyframes ccBubbleLiquid {
    0%, 100% {
        background-position: 0% 0%, 100% 0%, 50% 100%, 0% 0%;
    }
    33% {
        background-position: 70% 60%, 20% 80%, 90% 20%, 0% 0%;
    }
    66% {
        background-position: 30% 90%, 90% 30%, 10% 50%, 0% 0%;
    }
}
.cc-bubble:hover {
    transform: scale(1.08);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.22),
        inset 0 0 0 1px rgba(255,255,255,.08),
        0 8px 28px rgba(115, 103, 240, .6);
}
.cc-bubble:active {
    transform: scale(.94);
}
/* Menú abierto: mismo liquid morado pero con acento un tono más profundo */
.cc-widget.cc-dial-open .cc-bubble {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.22),
        inset 0 0 0 1px rgba(255,255,255,.08),
        0 8px 28px rgba(81, 72, 180, .55);
    filter: saturate(1.15);
}

/* Icon swap (sparkles ↔ close) */
.cc-bubble-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s;
}
.cc-widget:not(.cc-dial-open) .cc-bubble-icon-open {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.5);
    pointer-events: none;
}
.cc-widget.cc-dial-open .cc-bubble-icon-idle {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.5);
    pointer-events: none;
}
/* When chat window is open, mantén el liquid pero con un leve shift de tono */
.cc-widget.cc-window-open .cc-bubble {
    filter: brightness(.92) saturate(1.1);
}

/* ─── Speed-dial (satellites) ───────────────────── */
.cc-dial {
    position: absolute;
    bottom: 68px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}
.cc-dial-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0;
    transform: translateY(14px) scale(.85);
    transition:
        opacity .22s ease,
        transform .28s cubic-bezier(.34,1.56,.64,1);
    pointer-events: none;
}
.cc-widget.cc-dial-open .cc-dial-btn {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
/* Staggered entrance: top button appears last for a natural "unfold" feel */
.cc-widget.cc-dial-open .cc-dial-btn:nth-child(3) { transition-delay: 0ms; }
.cc-widget.cc-dial-open .cc-dial-btn:nth-child(2) { transition-delay: 50ms; }
.cc-widget.cc-dial-open .cc-dial-btn:nth-child(1) { transition-delay: 100ms; }

.cc-dial-label {
    background: rgba(31, 31, 31, .95);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.06);
    backdrop-filter: blur(6px);
}
.cc-dial-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
    transition: transform .2s, box-shadow .2s, filter .2s;
    position: relative;
}
.cc-dial-badge {
    top: -4px;
    right: -4px;
}
.cc-dial-btn:hover .cc-dial-icon {
    transform: scale(1.12);
    filter: brightness(1.1);
}
.cc-dial-btn:active .cc-dial-icon {
    transform: scale(.94);
}
/* Satellite buttons — subtle glass highlight (top sheen + inset border) */
.cc-dial-ai .cc-dial-icon {
    background: linear-gradient(135deg, #8b80ff 0%, #7d70f2 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.18),
        inset 0 0 0 1px rgba(255,255,255,.08),
        0 4px 14px rgba(125, 112, 242, .35);
}
.cc-dial-watchlist .cc-dial-icon {
    background: linear-gradient(135deg, #7367f0 0%, #6258d6 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.18),
        inset 0 0 0 1px rgba(255,255,255,.08),
        0 4px 14px rgba(115, 103, 240, .35);
}
.cc-dial-community .cc-dial-icon {
    background: linear-gradient(135deg, #2a2b4a 0%, #1c1d33 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.12),
        inset 0 0 0 1px rgba(255,255,255,.06),
        0 4px 14px rgba(42, 43, 74, .4);
}

/* Hide dial entirely when community chat window is open */
.cc-widget.cc-window-open .cc-dial {
    display: none;
}

/* ─── Badge ─────────────────────────────────────── */
.cc-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--cc-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.cc-badge-mention {
    background: var(--cc-warning);
    animation: ccMentionPulse 1s ease infinite;
}
@keyframes ccMentionPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.2); }
}

/* ─── Chat window ───────────────────────────────── */
.cc-window {
    width: var(--cc-width);
    height: var(--cc-height);
    background: var(--cc-bg);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.45);
    position: absolute;
    bottom: 64px;
    right: 0;
    animation: ccSlideUp .25s ease-out;
}
@keyframes ccSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Header ────────────────────────────────────── */
.cc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--cc-bg-dark);
    border-bottom: 1px solid var(--cc-border);
    flex-shrink: 0;
}
.cc-header-left {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}
.cc-header-actions {
    display: flex;
    gap: 2px;
}
.cc-header-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--cc-text-muted);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.cc-header-btn:hover {
    background: var(--cc-bg-hover);
    color: #fff;
}
.cc-header-btn.muted {
    color: var(--cc-danger);
}

/* ─── Online badge ──────────────────────────────── */
.cc-online-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(40, 199, 111, .12);
    color: var(--cc-success);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}
.cc-online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cc-success);
    animation: ccPulse 2s infinite;
}
@keyframes ccPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .4; }
}

/* ─── Settings panel ────────────────────────────── */
.cc-settings-panel {
    padding: 8px 14px;
    background: var(--cc-bg-dark);
    border-bottom: 1px solid var(--cc-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cc-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--cc-text);
    cursor: pointer;
    padding: 4px 0;
}
.cc-settings-row span {
    display: flex;
    align-items: center;
}
.cc-toggle {
    position: relative;
    width: 34px;
    height: 18px;
}
.cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.cc-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--cc-border);
    border-radius: 9px;
    transition: background .2s;
    cursor: pointer;
}
.cc-toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}
.cc-toggle input:checked + .cc-toggle-slider {
    background: var(--cc-primary);
}
.cc-toggle input:checked + .cc-toggle-slider::before {
    transform: translateX(16px);
}

/* ─── Offline bubble state ──────────────────────── */
/* Active bubble (chat open) */
.cc-bubble.cc-bubble-active {
    transform: scale(.9);
    opacity: .7;
    box-shadow: 0 2px 10px rgba(115, 103, 240, .3);
}
.cc-bubble.cc-bubble-active:hover {
    transform: scale(.95);
    opacity: 1;
}

.cc-bubble.cc-offline {
    background: var(--cc-bg-hover);
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.cc-bubble.cc-offline:hover {
    box-shadow: 0 6px 28px rgba(0,0,0,.3);
}

/* ─── Online bar ────────────────────────────────── */
.cc-online-bar {
    padding: 6px 14px;
    background: var(--cc-bg-dark);
    border-bottom: 1px solid var(--cc-border);
    flex-shrink: 0;
    overflow: hidden;
}
.cc-online-avatars {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
}
.cc-online-overflow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cc-bg-hover);
    color: var(--cc-text-muted);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: default;
}
.cc-online-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    position: relative;
}
.cc-online-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
}
.cc-online-avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cc-online-avatar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    background: var(--cc-success);
    border-radius: 50%;
    border: 2px solid var(--cc-bg-dark);
    z-index: 1;
}

/* ─── Pinned message bar ────────────────────────── */
.cc-pinned-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(115, 103, 240, .08);
    border-bottom: 1px solid var(--cc-border);
    flex-shrink: 0;
    cursor: pointer;
    transition: background .15s;
}
.cc-pinned-bar:hover {
    background: rgba(115, 103, 240, .14);
}
.cc-pinned-icon {
    color: var(--cc-primary);
    font-size: 13px;
    flex-shrink: 0;
}
.cc-pinned-content {
    flex: 1;
    min-width: 0;
}
.cc-pinned-text {
    font-size: 11.5px;
    color: var(--cc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* ─── Message highlight (scroll to pinned) ──────── */
.cc-msg-highlight {
    animation: ccHighlight 1.5s ease;
}
@keyframes ccHighlight {
    0%, 30% { background: rgba(115, 103, 240, .15); }
    100% { background: transparent; }
}

/* ─── Messages area ─────────────────────────────── */
.cc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
}
.cc-msg-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cc-load-more {
    text-align: center;
    padding: 8px 0;
}

/* ─── Message bubble ────────────────────────────── */
.cc-msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: ccFadeIn .2s ease;
}
@keyframes ccFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cc-msg.cc-mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.cc-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-top: 2px;
    overflow: hidden;
}
.cc-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cc-msg-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.cc-msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    font-size: 11px;
}
.cc-msg-name {
    font-weight: 600;
    color: var(--cc-text);
}
.cc-msg-time {
    color: var(--cc-text-muted);
    font-size: 10px;
}
.cc-msg-level {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}
.cc-msg-level-elite {
    background: rgba(115, 103, 240, .15);
    color: var(--cc-primary);
}
.cc-msg-level-pro {
    background: rgba(255, 159, 67, .15);
    color: var(--cc-warning);
}
.cc-msg-level-starter {
    background: rgba(139, 143, 167, .15);
    color: var(--cc-text-muted);
}
.cc-msg-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--cc-text);
    background: var(--cc-bg-other);
    word-break: break-word;
    position: relative;
}
.cc-mine .cc-msg-bubble {
    background: var(--cc-bg-mine);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.cc-msg:not(.cc-mine) .cc-msg-bubble {
    border-bottom-left-radius: 4px;
}
.cc-mine .cc-msg-meta {
    flex-direction: row-reverse;
}

/* Hover actions on bubble */
.cc-msg-actions {
    display: none;
    position: absolute;
    top: -6px;
    right: 4px;
    gap: 2px;
    background: var(--cc-bg-dark);
    border: 1px solid var(--cc-border);
    border-radius: 6px;
    padding: 2px;
}
.cc-msg:hover .cc-msg-actions {
    display: flex;
}
.cc-msg-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--cc-text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}
.cc-msg-action-btn:hover {
    background: var(--cc-bg-hover);
    color: #fff;
}
.cc-msg-action-btn.danger:hover {
    color: var(--cc-danger);
}

/* ─── Quick reaction buttons in hover bar ────── */
.cc-react-btn {
    font-size: 13px !important;
    padding: 0 1px;
    line-height: 1;
}
.cc-react-btn:hover {
    transform: scale(1.3);
    background: transparent;
}
.cc-action-divider {
    width: 1px;
    height: 16px;
    background: var(--cc-border);
    align-self: center;
    margin: 0 1px;
}

/* ─── Reactions row below bubble ─────────────── */
.cc-msg-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: -8px;
    padding-left: 8px;
    position: relative;
    z-index: 1;
}
.cc-msg-reactions:empty {
    display: none;
}
.cc-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid var(--cc-border);
    background: var(--cc-bg);
    color: var(--cc-text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    line-height: 1.3;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.cc-reaction-pill:hover {
    background: var(--cc-bg-hover);
    border-color: var(--cc-text-muted);
}
.cc-reaction-pill.cc-reaction-active {
    border-color: var(--cc-primary);
    background: var(--cc-bg);
    color: var(--cc-primary);
}
.cc-reaction-count {
    font-size: 11px;
    font-weight: 600;
    min-width: 8px;
    text-align: center;
}
.cc-react-add {
    opacity: 0;
    border-style: dashed;
    transition: opacity .15s;
}
.cc-msg:hover .cc-react-add,
.cc-msg-news .cc-react-add {
    opacity: .5;
}
.cc-react-add:hover {
    opacity: 1 !important;
}
.cc-mine .cc-msg-reactions {
    justify-content: flex-end;
    padding-right: 8px;
    padding-left: 0;
}

/* ─── News card in chat ─────────────────────────── */
.cc-msg-news {
    max-width: 100%;
}
.cc-msg-news .cc-msg-avatar {
    flex-shrink: 0;
}
.cc-news-card {
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    background: var(--cc-bg-dark);
    overflow: visible;
    border-left: 3px solid var(--cc-primary);
    position: relative;
}
.cc-news-header {
    padding: 10px 12px;
    cursor: pointer;
    position: relative;
    transition: background .15s;
}
.cc-news-header:hover {
    background: rgba(115, 103, 240, .06);
}
.cc-news-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cc-text);
    line-height: 1.35;
    padding-right: 20px;
}
.cc-news-headline {
    font-size: 11.5px;
    color: var(--cc-text-muted);
    line-height: 1.35;
    margin-top: 3px;
    padding-right: 20px;
}
.cc-news-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}
.cc-news-tickers {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.cc-news-source {
    font-size: 10.5px;
    color: var(--cc-text-muted);
}
.cc-news-impact {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(255, 159, 67, .15);
    color: var(--cc-warning);
}
.cc-news-chevron {
    position: absolute;
    top: 12px;
    right: 10px;
    font-size: 14px;
    color: var(--cc-text-muted);
    transition: transform .2s;
}
.cc-news-chevron-open {
    transform: rotate(180deg);
}
/* Inline fields grid (price, vol, mkt cap, etc.) */
.cc-news-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 8px;
    margin-top: 6px;
}
.cc-news-field {
    display: flex;
    flex-direction: column;
}
.cc-news-field-name {
    font-size: 9.5px;
    color: var(--cc-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.cc-news-field-val {
    font-size: 11px;
    color: var(--cc-text);
    font-weight: 500;
}
/* Block fields (positives/negatives) */
.cc-news-field-block {
    margin-top: 8px;
}
.cc-news-field-block .cc-news-field-name {
    font-size: 10px;
    margin-bottom: 2px;
    display: block;
}
.cc-news-field-text {
    font-size: 11px;
    color: var(--cc-text-muted);
    line-height: 1.4;
}
.cc-news-body {
    padding: 0 12px 10px;
    border-top: 1px solid var(--cc-border);
}
.cc-news-desc {
    font-size: 12px;
    color: var(--cc-text-muted);
    line-height: 1.45;
    margin: 8px 0;
}
.cc-news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}
.cc-news-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(115, 103, 240, .1);
    color: var(--cc-primary);
}
.cc-news-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.cc-news-link {
    font-size: 11px;
    color: var(--cc-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.cc-news-link:hover {
    text-decoration: underline;
}
.cc-news-save {
    font-size: 11px;
    color: var(--cc-text-muted);
    background: none;
    border: 1px solid var(--cc-border);
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: color .15s, border-color .15s;
}
.cc-news-save:hover {
    color: var(--cc-warning);
    border-color: var(--cc-warning);
}
.cc-news-save:disabled {
    color: var(--cc-success);
    border-color: var(--cc-success);
    cursor: default;
}

/* ─── Reply preview inside bubble ───────────────── */
.cc-msg-reply {
    padding: 5px 8px;
    margin-bottom: 5px;
    border-left: 3px solid rgba(255,255,255,.5);
    background: rgba(0,0,0,.15);
    border-radius: 4px;
    font-size: 11px;
}
.cc-msg:not(.cc-mine) .cc-msg-reply {
    border-left-color: var(--cc-primary);
    background: rgba(255,255,255,.05);
}
.cc-msg-reply-name {
    font-weight: 600;
    color: rgba(255,255,255,.85);
}
.cc-msg:not(.cc-mine) .cc-msg-reply-name {
    color: var(--cc-primary);
}
.cc-msg-reply-text {
    color: rgba(255,255,255,.6);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.cc-msg:not(.cc-mine) .cc-msg-reply-text {
    color: var(--cc-text-muted);
}

/* ─── Mentions ──────────────────────────────────── */
.cc-mention-user {
    color: var(--cc-primary);
    font-weight: 600;
    cursor: pointer;
}
.cc-mention-ticker {
    color: var(--cc-success);
    font-weight: 600;
    cursor: pointer;
    background: rgba(40, 199, 111, .1);
    padding: 0 4px;
    border-radius: 4px;
}
.cc-mention-broadcast {
    color: var(--cc-warning);
    font-weight: 700;
    background: rgba(255, 159, 67, .12);
    padding: 0 4px;
    border-radius: 4px;
}

/* Mentions inside own bubbles */
.cc-mine .cc-mention-user,
.cc-mine .cc-mention-broadcast,
.cc-mine .cc-mention-ticker {
    color: #fff;
    background: rgba(255, 255, 255, .18);
    padding: 0 4px;
    border-radius: 4px;
}

/* ─── Image in message ──────────────────────────── */
.cc-msg-image {
    max-width: 220px;
    border-radius: 8px;
    margin-top: 4px;
    cursor: pointer;
    transition: opacity .15s;
}
.cc-msg-image:hover {
    opacity: .85;
}

/* ─── Typing indicator (fixed above input) ─────── */
.cc-typing {
    padding: 4px 14px;
    font-size: 11px;
    color: var(--cc-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--cc-bg);
    border-top: 1px solid var(--cc-border);
    flex-shrink: 0;
}
.cc-typing-dots {
    display: flex;
    gap: 3px;
}
.cc-typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cc-text-muted);
    animation: ccDotBounce 1.4s infinite;
}
.cc-typing-dots span:nth-child(2) { animation-delay: .2s; }
.cc-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes ccDotBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%           { transform: translateY(-4px); }
}

/* ─── Reply bar ─────────────────────────────────── */
.cc-reply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: var(--cc-bg-dark);
    border-top: 1px solid var(--cc-border);
    font-size: 12px;
    color: var(--cc-text-muted);
    flex-shrink: 0;
}
.cc-reply-preview {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.cc-reply-cancel {
    border: none;
    background: transparent;
    color: var(--cc-text-muted);
    cursor: pointer;
    padding: 2px;
}
.cc-reply-cancel:hover { color: #fff; }

/* ─── Image preview ─────────────────────────────── */
.cc-image-preview {
    padding: 8px 14px;
    background: var(--cc-bg-dark);
    border-top: 1px solid var(--cc-border);
    position: relative;
    flex-shrink: 0;
}
.cc-image-preview img {
    max-height: 120px;
    border-radius: 8px;
}
.cc-image-cancel {
    position: absolute;
    top: 4px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--cc-danger);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Input area ────────────────────────────────── */
.cc-input-area {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    background: var(--cc-bg-dark);
    border-top: 1px solid var(--cc-border);
    flex-shrink: 0;
}
.cc-input-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--cc-text-muted);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.cc-input-btn:hover {
    color: var(--cc-primary);
    background: rgba(115, 103, 240, .1);
}
.cc-input-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}
.cc-input {
    width: 100%;
    border: 1px solid var(--cc-border);
    background: var(--cc-bg-input);
    color: var(--cc-text);
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 13px;
    resize: none;
    outline: none;
    line-height: 1.4;
    max-height: 80px;
    overflow-y: auto;
    font-family: inherit;
    transition: border-color .15s;
}
.cc-input::placeholder {
    color: var(--cc-text-muted);
}
.cc-input:focus {
    border-color: var(--cc-primary);
}
.cc-send-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: var(--cc-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity .15s, transform .15s;
}
.cc-send-btn:disabled {
    opacity: .35;
    cursor: default;
}
.cc-send-btn:not(:disabled):hover {
    transform: scale(1.08);
}

/* ─── Upload spinner ────────────────────────────── */
.cc-upload-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ccSpin .6s linear infinite;
}
@keyframes ccSpin {
    to { transform: rotate(360deg); }
}

/* ─── Toast ─────────────────────────────────────── */
.cc-toast-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.cc-toast {
    background: var(--cc-bg-dark, #171717);
    color: var(--cc-text, #e8e8e8);
    border: 1px solid var(--cc-border, #303030);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 12px;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s, transform .3s;
    pointer-events: auto;
}
.cc-toast-show {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Emoji picker ──────────────────────────────── */
.cc-emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 10px;
    z-index: 10;
}
.cc-emoji-picker emoji-picker {
    --background: var(--cc-bg);
    --border-color: var(--cc-border);
    --input-border-color: var(--cc-border);
    --input-font-color: var(--cc-text);
    --indicator-color: var(--cc-primary);
    --category-font-color: var(--cc-text-muted);
    --num-columns: 8;
    height: 300px;
}

/* ─── Lightbox ──────────────────────────────────── */
.cc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cc-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.8);
}
.cc-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}
.cc-lightbox-content img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}
.cc-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--cc-danger);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── System message ────────────────────────────── */
.cc-msg-system {
    text-align: center;
    font-size: 11px;
    color: var(--cc-text-muted);
    padding: 4px 0;
    max-width: 100%;
}
.cc-msg-system .cc-msg-bubble {
    background: transparent;
    padding: 4px 12px;
    font-style: italic;
}

/* ─── Deleted message ───────────────────────────── */
.cc-msg-deleted .cc-msg-bubble {
    opacity: .4;
    font-style: italic;
}

/* ─── Responsive ────────────────────────────────── */
@media (max-width: 480px) {
    .cc-window {
        width: calc(100vw - 16px);
        height: calc(100vh - 100px);
        right: -12px;
        bottom: 60px;
        border-radius: 12px 12px 0 0;
    }
}

/* ─── Tribute.js autocomplete dropdown ──────────── */
.tribute-container {
    background: #1f1f1f !important;
    border: 1px solid #303030 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.5) !important;
    overflow: hidden !important;
    z-index: 10000 !important;
    max-height: 200px;
    overflow-y: auto;
    margin-top: -4px;
    font-family: 'Public Sans', sans-serif;
}
.tribute-container ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 4px !important;
}
.tribute-container li {
    padding: 8px 12px !important;
    font-size: 13px !important;
    color: #e8e8e8 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: background .15s !important;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tribute-container li:hover,
.tribute-container li.highlight {
    background: #2a2a2a !important;
}
.tribute-container li.highlight {
    color: #fff !important;
}
