/* --- Container --- */
.chat-container {
    max-width: 700px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    background: #f9f9fb;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.chat-header {
    background: var(--primary, #7c75da);
    color: white;
    padding: 1.2rem;
    text-align: center;
}

.chat-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.chat-header p {
    margin: 0.2rem 0 0;
    opacity: 0.9;
}

/* --- Chat messages area --- */
.chat-box {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow-y: auto;
    height: 60vh;
    background: white;
}

/* --- Message bubbles --- */
.message {
    max-width: 75%;
    padding: 0.8rem 1rem;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background: var(--primary, #7c75da);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.ai {
    align-self: flex-start;
    background: var(--light-bg);
    color: #333;
    border-bottom-left-radius: 4px;
}

/* Optional: subtle fade-in animation */
.message {
    animation: fadeIn 0.3s ease;
}

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

/* --- Input form --- */
.chat-form {
    display: flex;
    padding: 1rem;
    background: #f1f1f5;
    border-top: 1px solid #ddd;
}

.chat-form input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 1rem;
    outline: none;
}

.chat-form input:focus {
    border-color: var(--primary, #7c75da);
}

.chat-form button {
    margin-left: 0.8rem;
    padding: 0.8rem 1.4rem;
    background: var(--primary, #7c75da);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-form button:hover {
    background: #675fd1;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .chat-container {
        margin: 1rem;
        height: 90vh;
    }

    .chat-box {
        height: 65vh;
    }
}
