/* ============================================================
   Voice Call Bar — compact in-conversation call controls
   Used by static/js/components/voice-call.js
   ============================================================ */

/* Call bar — floats at top of chat area */
#voice-call-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: color-mix(in srgb, var(--bg-secondary, #f8f9fa) 70%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid color-mix(in srgb, var(--border-color, #e0e0e0) 60%, transparent);
    border-radius: 16px;
    margin: 8px auto;
    max-width: 560px;
    width: calc(100% - 32px);
    align-self: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1),
                0 4px 12px rgba(0, 0, 0, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s cubic-bezier(0.23, 1, 0.320, 1), transform 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    position: sticky;
    top: 0;
    z-index: 100;
    cursor: grab;
}
#voice-call-bar.vcb-dragging {
    cursor: grabbing;
    position: fixed;
    z-index: 10000;
    transition: none;
    width: 560px;
    max-width: 560px;
}
#voice-call-bar.vcb-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Left — avatar + name + status */
.vcb-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.vcb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: vcb-pulse 2s ease-in-out infinite;
}
.vcb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
@keyframes vcb-pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
    50%       { box-shadow: 0 4px 18px rgba(16, 185, 129, 0.55); }
}
.vcb-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.vcb-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color, #111);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vcb-status {
    font-size: 12px;
    color: var(--text-secondary, #666);
    white-space: nowrap;
}

/* Center — waveform + timer */
.vcb-center {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    justify-content: center;
    min-width: 0;
}
.vcb-center canvas {
    border-radius: 4px;
    flex-shrink: 1;
    min-width: 40px;
    max-width: 80px;
}
.vcb-timer {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent-color, #10b981);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Tool activity */
.vcb-tool-activity {
    flex-shrink: 0;
}
.vcb-tool-activity:empty {
    display: none;
}
.vcb-tool-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--accent-color, #10b981);
    padding: 4px 8px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--accent-color, #10b981) 10%, transparent);
    white-space: nowrap;
}
.vcb-tool-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid color-mix(in srgb, var(--accent-color, #10b981) 30%, transparent);
    border-top-color: var(--accent-color, #10b981);
    border-radius: 50%;
    animation: vcb-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes vcb-spin {
    to { transform: rotate(360deg); }
}

/* Right — buttons */
.vcb-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.vcb-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color, #e0e0e0);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.320, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.vcb-btn:hover {
    transform: translateY(-2px);
}
.vcb-btn:active {
    transform: scale(0.95);
}
.vcb-mute {
    background: var(--bg-tertiary, #f0f0f0);
    color: var(--text-color, #111);
}
.vcb-mute:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.vcb-mute.vcb-muted {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: #ef4444;
}
.vcb-mute.vcb-muted:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}
.vcb-end {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.vcb-end:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}
.vcb-start {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}
.vcb-start:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

/* Voice message indicator — small mic icon on voice-transcribed messages */
.vc-voice-message {
    position: relative;
}
.vc-voice-message::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 4px;
    background: var(--text-tertiary, #666);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z'/%3E%3Cpath d='M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z'/%3E%3Cpath d='M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z'/%3E%3C/svg%3E") no-repeat center;
    vertical-align: middle;
}
.vc-streaming .content {
    opacity: 0.7;
}

/* System messages for call start/end */
.message.system.vc-voice-message {
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary, #666);
    padding: 4px 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--border-color, #333) 30%, transparent);
    margin: 8px auto;
    width: fit-content;
}
.message.system.vc-voice-message::before {
    display: none;
}

/* Mobile responsive */
@media (max-width: 600px) {
    #voice-call-bar {
        gap: 8px;
        padding: 8px 12px;
    }
    .vcb-center canvas {
        display: none;
    }
    .vcb-center {
        flex: 0;
        min-width: auto;
    }
    .vcb-timer {
        font-size: 11px;
    }
    .vcb-name {
        max-width: 80px;
    }
    .vcb-tool-activity {
        display: none;
    }
}
