/* ══════════════════════════════════════════════════════════════
   Nexus Video Notes (Кружочки) v1.0
   ══════════════════════════════════════════════════════════════ */

/* v1.29.13 — Кнопка кружочка всегда видна (раньше только при hover на input-area
   что не работает на тач-устройствах и неинтуитивно на десктопе). */
#video-note-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, transform 0.1s;
}
#video-note-btn.recording {
    color: var(--color-text-danger, #ff3b30) !important;
    animation: nx-pulse 1s infinite;
}

/* Оверлей записи */
.vnote-overlay {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: nx-ep-fade 0.2s ease-out;
}
@media (max-width: 767px) {
    .vnote-overlay {
        bottom: 70px;
        right: 10px;
    }
}

.vnote-preview-wrap {
    position: relative;
    width: 160px;
    height: 160px;
}

.vnote-preview {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    background: #000;
    display: block;
}

.vnote-ring {
    position: absolute;
    inset: -4px;
    pointer-events: none;
}
.vnote-progress {
    width: 100%;
    height: 100%;
}
.vnote-progress-bg  { stroke: rgba(255,255,255,0.15); }
.vnote-progress-bar {
    stroke: var(--accent);
    transition: stroke-dashoffset 0.1s linear;
}

.vnote-timer {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}

.vnote-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}
.vnote-cancel-btn, .vnote-stop-btn {
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}
.vnote-cancel-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.12);
    color: var(--text-secondary);
}
.vnote-stop-btn {
    width: 52px;
    height: 52px;
    background: var(--accent);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.vnote-cancel-btn:hover { transform: scale(1.1); background: rgba(255,59,48,0.2); }
.vnote-stop-btn:hover   { transform: scale(1.08); }

/* Рендер кружочка в ленте */
.msg-video-note {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    flex-shrink: 0;
}
.msg-video-note video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.msg-video-note .vnote-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    transition: background 0.15s;
}
.msg-video-note:hover .vnote-play-overlay { background: rgba(0,0,0,0.15); }
.msg-video-note .vnote-play-icon {
    font-size: 40px;
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.msg-video-note.playing .vnote-play-overlay { background: transparent; }
.msg-video-note.playing .vnote-play-icon { display: none; }

/* Bubble для video note — прозрачный */
.msg-row:has(.msg-video-note) .msg-bubble {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}


/* ════════════════════════════════════════════════════════════════
   v1.29.14 — Video Note в чате: круг + плеер под ним
   ════════════════════════════════════════════════════════════════ */
.msg-bubble-vnote {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
}
.vnote-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 240px;
}
.vnote-msg-circle {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    overflow: hidden;
    background: #000;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}
.vnote-msg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.vnote-msg-play-overlay {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    backdrop-filter: blur(4px);
}
.vnote-msg-play-overlay:hover {
    transform: scale(1.08);
    background: rgba(0, 0, 0, 0.7);
}
.vnote-msg-play-overlay svg {
    margin-left: 4px;  /* визуальная центровка треугольника */
}
.vnote-msg.playing .vnote-msg-play-overlay {
    opacity: 0;
    pointer-events: none;
}
.vnote-msg-duration {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}

/* Контролы под кружком */
.vnote-msg-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-overlay, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 22px;
    padding: 6px 12px;
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
}
.vnote-msg-btn {
    background: transparent;
    border: none;
    color: var(--text-primary, #fff);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
    padding: 0;
}
.vnote-msg-btn:hover {
    background: var(--bg-base, rgba(255, 255, 255, 0.08));
}
.vnote-msg-btn:active {
    transform: scale(0.92);
}
.vnote-msg-playpause {
    background: var(--accent, #4f8aff);
    color: #fff;
}
.vnote-msg-playpause:hover {
    background: var(--accent, #4f8aff);
    filter: brightness(1.1);
}
.vnote-msg-mute[data-muted="0"] {
    color: var(--accent, #4f8aff);
}
.vnote-msg-progress {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    min-width: 60px;
}
.vnote-msg-progress-bar {
    height: 100%;
    background: var(--accent, #4f8aff);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}
.vnote-msg-time {
    font-size: 10.5px;
    color: var(--text-muted, #8e8e93);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 700px) {
    .vnote-msg-circle { width: 180px; height: 180px; }
    .vnote-msg-play-overlay { width: 56px; height: 56px; }
}

/* Для отправленных собственных кружочков — выравниваем по правому краю */
.msg-row.own .msg-bubble-vnote {
    margin-left: auto;
}
.msg-row.own .vnote-msg { align-items: flex-end; }

/* В bubble убираем стандартный max-width — кружок сам компактен */
.msg-bubble-vnote.msg-bubble {
    max-width: 240px !important;
}
