/* Qubble Chat — security indicator badge (always-visible, animates on crypto activity) */

.qsec-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px 0 8px;
    margin-right: 6px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(20,241,149,0.10), rgba(123,47,247,0.10));
    border: 1px solid rgba(20,241,149,0.35);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: #14f195;
    cursor: pointer;
    user-select: none;
    transition: box-shadow 160ms ease, border-color 160ms ease;
    white-space: nowrap;
}
.qsec-badge:hover {
    border-color: rgba(20,241,149,0.6);
    box-shadow: 0 0 12px rgba(20,241,149,0.18);
}
.qsec-badge .qsec-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #14f195;
    box-shadow: 0 0 8px rgba(20,241,149,0.8);
    transition: background-color 220ms ease, box-shadow 220ms ease;
}
.qsec-badge .qsec-label {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #14f195;
}
.qsec-badge .qsec-fp {
    color: #c9c5e2;
    opacity: 0.75;
    letter-spacing: 0.06em;
}

/* idle state — no room joined yet */
.qsec-badge.qsec-idle {
    border-color: rgba(150,150,180,0.3);
    color: #8a86a8;
    background: linear-gradient(90deg, rgba(150,150,180,0.06), rgba(150,150,180,0.06));
}
.qsec-badge.qsec-idle .qsec-dot { background: #8a86a8; box-shadow: none; }
.qsec-badge.qsec-idle .qsec-label { color: #8a86a8; }

/* pulse animation — fires for ~700ms each time a message is encrypted or decrypted */
.qsec-badge.qsec-pulse .qsec-dot {
    animation: qsec-pulse-dot 700ms ease-out;
}
.qsec-badge.qsec-pulse {
    animation: qsec-pulse-glow 700ms ease-out;
}
@keyframes qsec-pulse-dot {
    0%   { background: #14f195;            box-shadow: 0 0 8px rgba(20,241,149,0.8); }
    40%  { background: #00d4ff;            box-shadow: 0 0 16px rgba(0,212,255,0.95), 0 0 28px rgba(123,47,247,0.6); transform: scale(1.5); }
    100% { background: #14f195;            box-shadow: 0 0 8px rgba(20,241,149,0.8); transform: scale(1); }
}
@keyframes qsec-pulse-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(20,241,149,0); }
    40%      { box-shadow: 0 0 18px rgba(0,212,255,0.4); }
}

/* compact mode for tight mobile headers */
@media (max-width: 540px) {
    .qsec-badge { padding: 0 8px; font-size: 9px; }
    .qsec-badge .qsec-fp { display: none; }
}

/* ───── Per-message verify ⓘ icon + popover ───── */
.bubble { position: relative; }
.bubble .qsec-verify {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(123,47,247,0.18);
    border: 1px solid rgba(123,47,247,0.45);
    color: #c9c5e2;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    /* Always visible — the security-verify capability IS the launch
       differentiator; hover-only hides it from users who don't know to look.
       Bubbles also have a bob animation that made hover-reveal flaky. */
    opacity: 0.55;
    transition: opacity 140ms ease, transform 140ms ease;
    z-index: 4;
    font-family: var(--font-mono, ui-monospace, monospace);
    user-select: none;
}
.bubble:hover .qsec-verify,
.bubble:focus-within .qsec-verify { opacity: 0.9; }
.bubble .qsec-verify:hover { opacity: 1; transform: scale(1.12); background: rgba(20,241,149,0.18); border-color: rgba(20,241,149,0.6); color: #14f195; }

.qsec-popover {
    position: fixed;
    z-index: 9999;
    min-width: 260px;
    max-width: 340px;
    padding: 12px 14px;
    background: rgba(10,10,15,0.98);
    border: 1px solid rgba(123,47,247,0.5);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 24px rgba(123,47,247,0.18);
    color: #c9c5e2;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11px;
    line-height: 1.5;
    backdrop-filter: blur(6px);
}
.qsec-popover .qsec-pop-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(123,47,247,0.25);
}
.qsec-popover .qsec-pop-title {
    color: #14f195;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 10px;
}
.qsec-popover .qsec-pop-close {
    background: transparent;
    border: none;
    color: #8a86a8;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    line-height: 1;
}
.qsec-popover .qsec-pop-close:hover { color: #f472b6; }
.qsec-popover .qsec-pop-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0;
}
.qsec-popover .qsec-pop-label {
    color: #8a86a8;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.1em;
    white-space: nowrap;
}
.qsec-popover .qsec-pop-value {
    color: #c9c5e2;
    word-break: break-all;
    text-align: right;
}
.qsec-popover .qsec-pop-value.ok      { color: #14f195; }
.qsec-popover .qsec-pop-value.mono    { font-family: var(--font-mono, ui-monospace, monospace); }
.qsec-popover .qsec-pop-foot {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(123,47,247,0.25);
    font-size: 10px;
    color: #8a86a8;
    line-height: 1.4;
}
