:root {
    --bg-deep: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    overflow: hidden;
}

#app-container {
    width: 95vw;
    max-width: 1200px;
    height: 90vh;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

#new-chat-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

#new-chat-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

#history-list {
    flex: 1;
    margin-top: 24px;
    overflow-y: auto;
}

.history-item {
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.history-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name { font-size: 0.9rem; font-weight: 600; }
.user-status { font-size: 0.75rem; color: var(--primary); }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

header {
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 1.5rem; color: var(--primary); }
h1 { font-size: 1.25rem; font-weight: 700; }
h1 span { color: var(--primary); font-weight: 400; font-size: 0.9rem; margin-left: 4px; }

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    color: #10b981;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

#chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.welcome-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0.8;
}

.welcome-icon { font-size: 4rem; color: var(--primary); margin-bottom: 20px; }
.welcome-screen h2 { margin-bottom: 12px; }
.welcome-screen p { color: var(--text-muted); max-width: 400px; }

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

@keyframes slideUp {
    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: 14px 20px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.6;
}

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

.bot-message .message-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
}

/* Input Section */
.input-section {
    padding: 32px;
}

.input-container-glass {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 8px 16px;
    transition: all 0.3s;
}

.input-container-glass:focus-within {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.input-field-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

#user-input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    padding: 12px;
    outline: none;
    font-size: 1rem;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    transition: all 0.2s;
}

.action-btn:hover { color: var(--primary); transform: scale(1.1); }

.mic-btn.recording {
    color: #ef4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

#listening-status {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.9);
    padding: 10px 20px;
    border-radius: 30px;
    display: none;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
    z-index: 100;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    margin-right: 10px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
