/**
 * CuraFile Avatar Panel — Stacked Layout (full width, above messages)
 */

/* ─── Avatar Panel (full width, fixed height on top) ─────────── */
.curafile-avatar-panel {
    position: relative;
    width: 100%;
    height: 160px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a73e8 0%, #6c3fc5 100%);
    overflow: hidden;
}

/* ─── Canvas Container ──────────────────────────────────────── */
.curafile-avatar-canvas-wrap {
    width: 100%;
    height: 120px;
    position: relative;
    overflow: hidden;
}

.curafile-avatar-canvas-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ─── Controls (bottom strip, 40px) ─────────────────────────── */
.curafile-avatar-controls {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0,0,0,0.12);
}

/* ─── Speaking Indicator (animated bars) ────────────────────── */
.curafile-speaking-indicator {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    opacity: 0;
    transition: opacity 0.3s;
}

.curafile-avatar-panel.speaking .curafile-speaking-indicator {
    opacity: 1;
}

.curafile-speaking-indicator span {
    width: 3px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    animation: cfSpeakBar 0.8s ease-in-out infinite alternate;
}

.curafile-speaking-indicator span:nth-child(1) { height: 6px; animation-delay: 0s; }
.curafile-speaking-indicator span:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.curafile-speaking-indicator span:nth-child(3) { height: 8px; animation-delay: 0.3s; }
.curafile-speaking-indicator span:nth-child(4) { height: 14px; animation-delay: 0.45s; }

@keyframes cfSpeakBar {
    0%   { height: 4px; }
    100% { height: 16px; }
}

/* ─── Mute Button (small circle icon, absolute top-right) ───── */
.curafile-avatar-mute-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
    z-index: 2;
}

.curafile-avatar-mute-btn:hover {
    background: rgba(255,255,255,0.30);
}

.curafile-avatar-mute-btn svg {
    width: 16px;
    height: 16px;
}

/* Hide the "Sound" label text */
.cf-mute-label {
    display: none;
}

/* ─── Loading Spinner ───────────────────────────────────────── */
.curafile-avatar-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.cf-avatar-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cfAvatarSpin 0.8s linear infinite;
}

@keyframes cfAvatarSpin {
    to { transform: rotate(360deg); }
}

/* ─── Mobile: Hide Avatar Panel ─────────────────────────────── */
@media (max-width: 768px) {
    .curafile-avatar-panel {
        display: none !important;
    }
}
