:root {
    --bg-dark: #000000;
    --primary-glow: #8f73ff;
    --secondary-glow: #8f73ff;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    height: 100dvh;
    overflow: hidden;
    position: relative;
}

/* Background Video */
#cameraFeed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.5s ease;
    transform: scaleX(-1);
    /* Mirror effect */
}

/* Dark overlay for readability */
.overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.9) 100%);
    backdrop-filter: blur(10px) saturate(150%);
    z-index: 1;
    pointer-events: none;
}

/* Main UI */
.live-container {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

/* Header */
.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(20px) saturate(150%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.25);
}

.status-pill {
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-glow);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Visualizer (The Orb) */
.visualizer-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.orb {
    width: 150px;
    height: 150px;
    position: relative;
    transition: all 0.5s ease;
}

.orb-core {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), var(--primary-glow) 40%, var(--secondary-glow));
    filter: blur(5px);
    box-shadow: 0 0 60px var(--primary-glow);
    animation: breathe 4s infinite ease-in-out;
}

.orb-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0.5;
    filter: blur(20px);
    pointer-events: none;
}

/* Orb States */
.orb.state-listening .orb-core {
    animation: listen-pulse 1.5s infinite ease-in-out;
    background: radial-gradient(circle at 30% 30%, #fff, #ef4444 60%);
    box-shadow: 0 0 80px #ef4444;
}

.orb.state-thinking .orb-core {
    animation: think-spin 2s infinite linear;
    background: conic-gradient(from 0deg, var(--secondary-glow), var(--primary-glow), var(--secondary-glow));
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

.orb.state-speaking .orb-core {
    animation: speak-wobble 0.5s infinite alternate;
    box-shadow: 0 0 100px var(--primary-glow);
}

/* Animations */
@keyframes breathe {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes listen-pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.4;
    }

    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

@keyframes think-spin {
    0% {
        transform: rotate(0deg) scale(0.9);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes speak-wobble {
    0% {
        transform: scale(1.05) translateY(-5px);
    }

    100% {
        transform: scale(0.95) translateY(5px);
    }
}

/* Footer / Mic */
.live-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding-bottom: 30px;
}

.mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    border: none;
    color: black;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.mic-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.2);
}

.mic-btn.active {
    background: #ef4444;
    color: white;
    transform: scale(0.95);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.6);
}

.hint-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.8;
}

.transcription-box {
    margin-top: 40px;
    text-align: center;
    width: 100%;
    max-width: 600px;
    transition: opacity 0.3s;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

.text-user {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.text-ai {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
}