/* Voice Mode - Premium Orb UI with WebGL */
.vm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: radial-gradient(ellipse 80% 60% at 50% 45%, #0a1628 0%, #050a12 50%, #020408 100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    user-select: none;
}

.vm-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Top Bar */
.vm-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    z-index: 10;
}

.vm-window-controls {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
}

.vm-window-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.vm-window-dot:hover { opacity: 1; }
.vm-window-dot--close { background: #ff5f57; }
.vm-window-dot--minimize { background: #ffbd2e; }
.vm-window-dot--maximize { background: #28c940; }

.vm-logo {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.02em;
}

.vm-close-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.vm-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.vm-close-btn svg {
    width: 16px;
    height: 16px;
}

/* Canvas Layers */
.vm-canvas-bg,
.vm-canvas-orb,
.vm-canvas-fx {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.vm-canvas-bg { z-index: 1; }
.vm-canvas-orb { z-index: 2; }
.vm-canvas-fx { z-index: 3; pointer-events: auto; cursor: pointer; }

/* Status Label */
.vm-status {
    position: absolute;
    left: 50%;
    top: calc(50% + min(18vw, 180px) + 40px);
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.vm-status-text {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 400;
    color: rgba(200, 220, 255, 0.8);
    letter-spacing: 0.08em;
    margin: 0;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s;
}

.vm-overlay.active .vm-status-text {
    opacity: 1;
    transform: translateY(0);
}

/* Bottom Control Bar */
.vm-controlbar {
    position: absolute;
    bottom: clamp(24px, 5vh, 48px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(10, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.vm-overlay.active .vm-controlbar {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.vm-ctrl {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.vm-ctrl svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.vm-ctrl:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.vm-ctrl--primary {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(80, 140, 255, 0.25), rgba(120, 80, 255, 0.2));
    border: 1px solid rgba(120, 160, 255, 0.3);
    color: #fff;
    margin: 0 8px;
}

.vm-ctrl--primary svg {
    width: 24px;
    height: 24px;
}

.vm-ctrl--primary:hover {
    background: linear-gradient(135deg, rgba(80, 140, 255, 0.35), rgba(120, 80, 255, 0.3));
    transform: scale(1.05);
}

.vm-ctrl--primary.active {
    background: linear-gradient(135deg, rgba(80, 200, 255, 0.4), rgba(100, 180, 255, 0.35));
    box-shadow: 0 0 30px rgba(80, 160, 255, 0.4);
}

.vm-ctrl.muted {
    color: rgba(255, 100, 100, 0.9);
}

.vm-divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

/* State-specific styles */
.vm-overlay[data-state="listening"] .vm-status-text { color: rgba(120, 200, 255, 0.9); }
.vm-overlay[data-state="thinking"] .vm-status-text { color: rgba(180, 140, 255, 0.9); }
.vm-overlay[data-state="speaking"] .vm-status-text { color: rgba(255, 180, 120, 0.9); }

/* Responsive */
@media (max-width: 640px) {
    .vm-topbar {
        height: 52px;
        padding: 0 12px;
        padding-top: env(safe-area-inset-top, 0);
    }
    .vm-window-controls { display: none; }

    .vm-close-btn {
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .vm-controlbar {
        padding: 8px 16px;
        gap: 4px;
        bottom: max(24px, env(safe-area-inset-bottom, 24px));
    }

    .vm-ctrl {
        width: 44px;
        height: 44px;
    }

    .vm-ctrl svg {
        width: 22px;
        height: 22px;
    }

    .vm-ctrl--primary {
        width: 52px;
        height: 52px;
        margin: 0 4px;
    }

    .vm-ctrl--primary svg {
        width: 26px;
        height: 26px;
    }

    .vm-status {
        top: calc(50% + min(25vw, 140px) + 32px);
    }
}
