:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --user-bubble: #6366f1;
    --ai-bubble: #334155;
    --border: rgba(255, 255, 255, 0.1);
}

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

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

.app-container {
    width: 100%;
    max-width: 900px;
    height: 90vh;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin: 20px;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    position: relative;
    box-shadow: 0 0 15px var(--primary);
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.status {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

main {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

main::-webkit-scrollbar {
    width: 6px;
}

main::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 10px;
}

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

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

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

.message.system {
    align-self: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

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

.ai .bubble {
    background: var(--ai-bubble);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border);
}

#chat-form {
    display: flex;
    gap: 16px;
}

#user-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 20px;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

#user-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

#send-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

#send-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

#send-btn:active {
    transform: translateY(0);
}

.typing-indicator {
    font-style: italic;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

@media (max-width: 640px) {
    .app-container {
        height: 100vh;
        margin: 0;
        border-radius: 0;
        border: none;
    }
}
