:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 1);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --accent-red: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

/* Header */
.app-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Avatar Section */
.avatar-section {
    flex: 2;
    position: relative;
    background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
}

model-viewer {
    width: 100%;
    height: 100%;
    --poster-color: transparent;
}

.status-indicator {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Chat Section */
.chat-section {
    flex: 3;
    background: #f9fafb;
    border-radius: 40px 40px 0 0;
    margin-top: -30px;
    z-index: 5;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.03);
    padding: 1.5rem;
    overflow-y: auto;
    /* Custom scrollbar */
    scrollbar-width: none;
}

.chat-section::-webkit-scrollbar {
    display: none;
}

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 100px;
}

.message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
}

.ai-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.bubble {
    padding: 1rem 1.25rem;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
}

.ai-message .bubble {
    background: white;
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    border: 1px solid #f1f5f9;
}

.user-message .bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

/* Controls */
.app-controls {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.record-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.record-btn:active {
    transform: scale(0.9);
}

.record-btn.recording {
    background: var(--accent-red);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.5;
    z-index: -1;
}

.recording .pulse-ring {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Toast */
.toast {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-size: 0.9rem;
    z-index: 100;
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 500px) {
    .app-container {
        max-width: 100%;
    }
}
