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

:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #141416;
    --bg-tertiary: #1c1c1f;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: rgba(255, 255, 255, 0.08);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 40px 24px 20px;
    text-align: center;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

/* Main content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 24px 24px;
}

/* Conversation area */
.conversation {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 300px;
    max-height: calc(100vh - 320px);
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-muted);
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}

.empty-state p {
    font-size: 0.875rem;
    max-width: 200px;
}

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 85%;
    animation: messageIn 0.3s ease;
    font-size: 0.9375rem;
}

@keyframes messageIn {
    from { 
        opacity: 0; 
        transform: translateY(8px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.message-user {
    background: var(--accent);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message-assistant {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    margin-right: auto;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

/* Voice control area */
.voice-control {
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Transcript */
.transcript {
    min-height: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
    padding: 0 20px;
    opacity: 0.8;
}

/* Orb container */
.orb-container {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pulsing rings - only visible in idle state */
.orb-rings {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(100, 180, 255, 0.15);
    animation: ringPulse 3s ease-in-out infinite;
}

.ring-1 {
    width: 90px;
    height: 90px;
    animation-delay: 0s;
}

.ring-2 {
    width: 120px;
    height: 120px;
    animation-delay: 0.5s;
}

.ring-3 {
    width: 150px;
    height: 150px;
    animation-delay: 1s;
}

@keyframes ringPulse {
    0%, 100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Hide rings when active */
.orb-container.active .orb-rings {
    display: none;
}

/* Voice button - Glass orb effect */
.voice-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(
        135deg,
        rgba(100, 180, 255, 0.1) 0%,
        rgba(60, 120, 200, 0.05) 50%,
        rgba(100, 180, 255, 0.15) 100%
    );
    backdrop-filter: blur(10px);
    color: rgba(150, 200, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 
        0 0 30px rgba(100, 180, 255, 0.1),
        inset 0 0 20px rgba(100, 180, 255, 0.05),
        0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(100, 180, 255, 0.2);
    overflow: hidden;
}

/* Inner glow effect */
.orb-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(150, 200, 255, 0.3) 0%,
        transparent 50%
    );
    pointer-events: none;
}

.voice-btn:hover {
    transform: scale(1.08);
    box-shadow: 
        0 0 40px rgba(100, 180, 255, 0.2),
        inset 0 0 25px rgba(100, 180, 255, 0.1),
        0 4px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(100, 180, 255, 0.4);
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn svg {
    width: 28px;
    height: 28px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.voice-btn .stop-icon {
    display: none;
}

/* Active state - listening */
.voice-btn.active {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.3) 0%,
        rgba(59, 130, 246, 0.1) 50%,
        rgba(59, 130, 246, 0.2) 100%
    );
    border-color: rgba(59, 130, 246, 0.5);
    color: white;
    box-shadow: 
        0 0 50px rgba(59, 130, 246, 0.3),
        inset 0 0 30px rgba(59, 130, 246, 0.1),
        0 4px 30px rgba(0, 0, 0, 0.4);
    animation: activePulse 2s ease-in-out infinite;
}

.voice-btn.active .mic-icon {
    display: none;
}

.voice-btn.active .stop-icon {
    display: block;
}

.voice-btn.active .orb-glow {
    background: radial-gradient(
        circle at 30% 30%,
        rgba(100, 150, 255, 0.4) 0%,
        transparent 50%
    );
}

/* Speaking state */
.voice-btn.speaking {
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.3) 0%,
        rgba(34, 197, 94, 0.1) 50%,
        rgba(34, 197, 94, 0.2) 100%
    );
    border-color: rgba(34, 197, 94, 0.5);
    color: white;
    box-shadow: 
        0 0 50px rgba(34, 197, 94, 0.3),
        inset 0 0 30px rgba(34, 197, 94, 0.1),
        0 4px 30px rgba(0, 0, 0, 0.4);
    animation: speakingPulse 1s ease-in-out infinite;
}

/* Thinking state */
.voice-btn.thinking {
    background: linear-gradient(
        135deg,
        rgba(245, 158, 11, 0.3) 0%,
        rgba(245, 158, 11, 0.1) 50%,
        rgba(245, 158, 11, 0.2) 100%
    );
    border-color: rgba(245, 158, 11, 0.5);
    color: white;
    box-shadow: 
        0 0 50px rgba(245, 158, 11, 0.3),
        inset 0 0 30px rgba(245, 158, 11, 0.1),
        0 4px 30px rgba(0, 0, 0, 0.4);
    animation: thinkingPulse 0.8s ease-in-out infinite;
}

/* Error state */
.voice-btn.error {
    background: linear-gradient(
        135deg,
        rgba(239, 68, 68, 0.3) 0%,
        rgba(239, 68, 68, 0.1) 50%,
        rgba(239, 68, 68, 0.2) 100%
    );
    border-color: rgba(239, 68, 68, 0.5);
    color: white;
    box-shadow: 
        0 0 50px rgba(239, 68, 68, 0.3),
        inset 0 0 30px rgba(239, 68, 68, 0.1),
        0 4px 30px rgba(0, 0, 0, 0.4);
}

@keyframes activePulse {
    0%, 100% { 
        box-shadow: 
            0 0 50px rgba(59, 130, 246, 0.3),
            inset 0 0 30px rgba(59, 130, 246, 0.1),
            0 4px 30px rgba(0, 0, 0, 0.4);
    }
    50% { 
        box-shadow: 
            0 0 70px rgba(59, 130, 246, 0.4),
            inset 0 0 40px rgba(59, 130, 246, 0.15),
            0 4px 40px rgba(0, 0, 0, 0.5);
    }
}

@keyframes speakingPulse {
    0%, 100% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.05);
    }
}

@keyframes thinkingPulse {
    0%, 100% { 
        opacity: 1;
    }
    50% { 
        opacity: 0.7;
    }
}

/* Status */
.status {
    text-align: center;
}

.status-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 480px) {
    .header {
        padding: 30px 20px 16px;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .main {
        padding: 0 20px 20px;
    }
    
    .voice-btn {
        width: 64px;
        height: 64px;
    }
    
    .voice-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* Scrollbar */
.conversation::-webkit-scrollbar {
    width: 4px;
}

.conversation::-webkit-scrollbar-track {
    background: transparent;
}

.conversation::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.conversation::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
