:root {
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-color: #38bdf8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --bot-msg-bg: rgba(51, 65, 85, 0.5);
    --user-msg-bg: rgba(56, 189, 248, 0.2);
    --error-color: #ef4444;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    z-index: -1;
}

.app-container {
    width: 90%;
    max-width: 800px;
    height: 85vh;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
}

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

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

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

.logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.pulse {
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(56, 189, 248, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(56, 189, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.status-badge {
    padding: 6px 12px;
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

#chat-window::-webkit-scrollbar {
    width: 6px;
}

#chat-window::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

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

.message.user-message .content {
    background: var(--user-msg-bg);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 18px 4px 18px 18px;
}

.avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.content {
    background: var(--bot-msg-bg);
    padding: 12px 16px;
    border-radius: 4px 18px 18px 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}

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

.input-container {
    display: flex;
    gap: 12px;
    background: rgba(15, 23, 42, 0.5);
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 1rem;
}

input:focus {
    outline: none;
}

button {
    background: var(--accent-color);
    color: #000;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

button:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}

button svg {
    width: 20px;
    height: 20px;
}

.error-msg {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 8px;
    height: 1rem;
    text-align: center;
    font-weight: 500;
}
