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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f0f;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #e0e0e0;
}

/* ===== Chat Container ===== */
.chat-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    max-height: 720px;
    background: #1a1a1a;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

@media (max-width: 520px) {
    .chat-container {
        max-height: 100vh;
        border-radius: 0;
    }
}

/* Header */
.chat-header {
    background: #1e1e1e;
    padding: 14px 20px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.bot-avatar {
    width: 40px;
    height: 40px;
    background: #1e3a5f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chat-header h1 {
    font-size: 16px;
    font-weight: 600;
    color: #f0f0f0;
}

.status {
    font-size: 12px;
    color: #888;
}

.status.online {
    color: #4ade80;
}

.status.error {
    color: #f87171;
}

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

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

/* Message bubbles */
.message {
    display: flex;
    gap: 8px;
    max-width: 88%;
    animation: fadeIn 0.2s ease;
}

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

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

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

.message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-line;
}

.message.user .message-bubble {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot .message-bubble {
    background: #2a2a2a;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-bubble strong {
    font-weight: 600;
    color: #fff;
}

/* Image in bot message */
.message-image {
    max-width: 250px;
    border-radius: 12px;
    margin-top: 8px;
}

/* Buttons from bot */
.message-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.message-buttons button {
    padding: 6px 14px;
    border: 1px solid #3b82f6;
    border-radius: 20px;
    background: transparent;
    color: #3b82f6;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.message-buttons button:hover {
    background: #3b82f6;
    color: white;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #2a2a2a;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    animation: blink 1.2s infinite;
}

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

@keyframes blink {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Input area */
.chat-input-area {
    padding: 14px 20px;
    background: #1e1e1e;
    border-top: 1px solid #2a2a2a;
}

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

#user-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #333;
    border-radius: 24px;
    background: #2a2a2a;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

#user-input:focus {
    border-color: #3b82f6;
}

#user-input::placeholder {
    color: #666;
}

#send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

#send-btn:hover {
    background: #2563eb;
}

#send-btn:disabled {
    background: #333;
    cursor: not-allowed;
}
