body {
    background-color: #050505;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.vr-container {
    --bg-color: #050505;
    --primary-neon: #00f2ff;
    --secondary-neon: #7000ff;
    --text-color: #e0e0e0;
    --glass-bg: rgba(20, 20, 20, 0.8);
    --bubble-sent: #2a2a2a;
    --bubble-received: #1a1a1a;
    --danger: #ff0055;
    --active-glow: 0 0 20px rgba(0, 242, 255, 0.3);
    
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    height: 700px; /* Fixed height for embedding */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.vr-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

h1, .logo {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
}

.hidden {
    display: none !important;
}

/* Main App Layout */
#app {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 10;
}

.neon-text {
    color: var(--primary-neon);
    text-shadow: 0 0 10px var(--primary-neon);
}

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

#room-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 1px;
    opacity: 0.8;
}

#connection-status {
    width: 6px;
    height: 6px;
    background: #555;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

/* Chat Stream - WhatsApp Style */
#chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
    background: linear-gradient(rgba(5, 5, 5, 0.9), rgba(5, 5, 5, 0.9)), url('https://www.transparenttextures.com/patterns/dark-matter.png');
}

/* Custom Scrollbar */
#chat-stream::-webkit-scrollbar {
    width: 4px;
}
#chat-stream::-webkit-scrollbar-thumb {
    background: var(--primary-neon);
    border-radius: 10px;
}

.message-wrapper {
    display: flex;
    width: 100%;
}

.message-wrapper.sent {
    justify-content: flex-end;
}

.message-wrapper.received {
    justify-content: flex-start;
}

.voice-bubble {
    max-width: 80%;
    min-width: 200px;
    padding: 12px;
    border-radius: 15px;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    transition: all 0.3s ease;
}

.message-wrapper.sent .voice-bubble {
    border-bottom-right-radius: 2px;
    border-left: 3px solid var(--primary-neon);
}

.message-wrapper.received .voice-bubble {
    border-bottom-left-radius: 2px;
    border-left: 3px solid var(--secondary-neon);
}

.voice-bubble.playing {
    border-color: var(--primary-neon);
    box-shadow: var(--active-glow);
    transform: scale(1.02);
}

.bubble-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.65rem;
    font-family: 'Orbitron', sans-serif;
    opacity: 0.6;
}

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

.play-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-neon);
}

.playing .play-icon {
    background: var(--primary-neon);
    color: black;
}

.progress-container {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--primary-neon);
    box-shadow: 0 0 10px var(--primary-neon);
}

/* Footer Controls */
.controls {
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
}

.mic-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--secondary-neon), var(--primary-neon));
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

.mic-btn.recording {
    background: var(--danger);
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 0, 85, 0.5);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(255, 0, 85, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0); }
}

.rec-timer {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    color: var(--danger);
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 10px var(--danger);
}

.visualizer-overlay {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 100%;
    height: 100px;
    pointer-events: none;
    opacity: 0.5;
    z-index: 5;
}

#visualizer {
    width: 100%;
    height: 100%;
}
