:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --chat-bg: #1e293b;
    --user-msg: #3b82f6;
    --bot-msg: #334155;
    --error-color: #ef4444;
}

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

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

.container {
    width: 100%;
    max-width: 800px;
    height: 95vh;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

header {
    padding: 20px;
    text-align: center;
    background: linear-gradient(to right, #1e293b, #0f172a);
    border-bottom: 1px solid #334155;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    background: -webkit-linear-gradient(#60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 0.9rem;
    color: #94a3b8;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-track {
    background: #1e293b;
}

.messages::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

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

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

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

.bubble {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

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

.message.bot .bubble {
    background-color: var(--bot-msg);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.typing .bubble {
    color: #94a3b8;
    font-style: italic;
}

.error-banner {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.input-area {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

textarea {
    flex: 1;
    background-color: #0f172a;
    border: 1px solid #334155;
    color: white;
    border-radius: 12px;
    padding: 12px;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    height: 50px;
    min-height: 50px;
    max-height: 120px;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 20px;
    height: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-family: inherit;
}

button:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

button:disabled {
    background-color: #475569;
    cursor: not-allowed;
    color: #94a3b8;
}

.btn-reset {
    background-color: #334155;
    padding: 0 15px;
    font-size: 1.2rem;
}

.btn-reset:hover:not(:disabled) {
    background-color: #475569;
}
