:root {

    --bg: #f0f4f8;
    --primary: rgb(190, 0, 190);
    --accent: #f9a8d4;
    --text: purple;
    --bot-bg: #e0e7ff;
    --user-bg: #d1fae5;
    --radius: 18px;
}

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

body {
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.chat-container {
    background: #ffffff;
    width: 100%;
    max-width: 450px;
    height: 90vh;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.chat-header {
    background: var(--primary);
    color: white;
    padding: 1.2rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chat-box {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease forwards;
}

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

.message.bot .bubble {
    background: var(--bot-bg);
}

.message.user .bubble {
    background: var(--user-bg);
}

.bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
}

.chat-input {
    display: flex;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.chat-input input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
}

.chat-input button {
    background: var(--primary);
    color: white;
    border: none;
    margin-left: 0.5rem;
    padding: 0 1.2rem;
    font-size: 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-input button:hover {
    background: purple;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .chat-header {
        font-size: 1.2rem;
    }

    .chat-input input {
        font-size: 0.95rem;
    }

    .chat-input button {
        font-size: 0.95rem;
    }

    .bubble {
        font-size: 0.9rem;
    }
}