:root {
    --bg-color: #0f111a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --user-msg: #3b82f6;
    --bot-msg: rgba(255, 255, 255, 0.06);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.layout-container {
    display: flex;
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    gap: 20px;
}

/* Dashboard Sidebar */
.dashboard-sidebar {
    width: 280px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    padding: 25px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dashboard-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
}

.status-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.status-item {
    background: rgba(0,0,0,0.2);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.status-position {
    font-weight: 500;
    font-size: 0.95rem;
}

.status-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-learning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge-testing { background: rgba(99, 102, 241, 0.2); color: var(--primary); }
.badge-maintenance { background: rgba(16, 185, 129, 0.2); color: var(--success); }

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--card-border);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

/* Main App Container */
.app-container {
    flex-grow: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Avatar Section */
.avatar-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
    position: relative;
}

.listening-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.recording-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.hidden { display: none !important; }

.avatar-ring {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    padding: 3px;
    box-shadow: 0 0 20px var(--primary-glow);
    transition: all 0.3s ease;
}

.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #1e1e2f;
}

.bot-name {
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 700;
}

.status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); transform: scale(1); }
    50% { box-shadow: 0 0 0 15px rgba(99, 102, 241, 0); transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); transform: scale(1); }
}

@keyframes talkingbounce {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-3px) scale(1.02); }
    50% { transform: translateY(2px) scale(0.98); }
    75% { transform: translateY(-2px) scale(1.01); }
}

.idle { animation: float 4s ease-in-out infinite; }
.thinking { animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.talking { animation: talkingbounce 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; box-shadow: 0 0 30px var(--primary-glow); }

/* Chat Window */
.chat-window {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-window::-webkit-scrollbar { width: 6px; }
.chat-window::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }

.message {
    display: flex;
    max-width: 80%;
    animation: fadeIn 0.3s ease-out;
}

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

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

.message-content {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.user-message .message-content {
    background: var(--user-msg);
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: var(--bot-msg);
    border: 1px solid var(--card-border);
    border-bottom-left-radius: 4px;
}

/* Input Area */
.input-area {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--card-border);
    align-items: center;
}

#user-input {
    flex-grow: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: white;
    padding: 12px 18px;
    border-radius: 100px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

#user-input:focus { border-color: var(--primary); }

#send-btn, #live-session-btn {
    border: none;
    color: white;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background 0.2s;
}

#send-btn { background: var(--primary); }
#send-btn:hover { transform: scale(1.05); background: #4f46e5; }
#send-btn:active { transform: scale(0.95); }

#live-session-btn { background: var(--card-bg); border: 1px solid var(--card-border); color: var(--text-muted); }
#live-session-btn:hover { background: rgba(255, 255, 255, 0.1); color: white; }
#live-session-btn.active { background: rgba(239, 68, 68, 0.2); border-color: var(--danger); color: var(--danger); box-shadow: 0 0 15px rgba(239, 68, 68, 0.3); }
