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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-message-user: #2a4a6a;
    --bg-message-sara: #1a1a24;
    --text-primary: #e8e8ed;
    --text-secondary: #888899;
    --accent: #5a8ab4;
    --accent-soft: rgba(90, 138, 180, 0.15);
    --border: #252530;
    --online: #4ade80;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 768px;
    margin: 0 auto;
    background: var(--bg-secondary);
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.avatar {
    position: relative;
    width: 44px;
    height: 44px;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7ab4d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: white;
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--online);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.header-info h1 {
    font-size: 16px;
    font-weight: 600;
}

.status-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    animation: fadeIn 0.2s ease;
}

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

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

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

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.45;
    font-size: 15px;
}

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

.message.sara .message-bubble {
    background: var(--bg-message-sara);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.message-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 0 4px;
}

.message.user .message-time {
    text-align: right;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-message-sara);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
    width: fit-content;
}

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

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* Input area */
.chat-input-area {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.chat-input-area form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 12px 18px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
}

#message-input::placeholder {
    color: var(--text-secondary);
}

#message-input:focus {
    outline: none;
    border-color: var(--accent);
}

#send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.1s;
}

#send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#send-btn:not(:disabled):hover {
    opacity: 0.9;
}

#send-btn:not(:disabled):active {
    transform: scale(0.95);
}

#send-btn svg {
    width: 20px;
    height: 20px;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .chat-header {
        padding: 12px 16px;
    }

    .chat-messages {
        padding: 16px;
    }

    .chat-input-area {
        padding: 12px 16px;
    }

    .message {
        max-width: 88%;
    }
}
