<template>
    <div class="chatHeader">
        <div class="chatHeader__info">
            <h2 class="chatHeader__title">{{ title }}</h2>
            <p class="chatHeader__subtitle">{{ subtitle }}</p>
        </div>
        <div class="chatHeader__actions">
            <button aria-label="Close Chat" class="chatHeader__closeButton" @click="toggleChat">
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Pro v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path d="M7.5 105c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l151 151 151-151c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-151 151 151 151c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-151-151-151 151c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l151-151-151-151z"/></svg>
            </button>
        </div>
    </div>
</template>

<script>
export default {
    name: 'chatHeader',
    props: {
        title: {
            type: String,
            default: 'Chat with Agent'
        },
        subtitle: {
            type: String,
            default: 'Ask me anything!'
        },
    },
    methods: {
        toggleChat() {
            this.$emit('toggle-chat');
        }
    }
}
</script>

<style lang="less" scoped>
.chatHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;

    &__info {
        display: flex;
        flex-direction: column;
    }

    &__title {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: #111827;
    }

    &__subtitle {
        margin: 0;
        font-size: 0.875rem;
        color: #6b7280;
    }

    &__actions {
        display: flex;
        align-items: center;
    }

    &__closeButton {
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        border-radius: 4px;
        transition: background-color 0.2s;

        &:hover {
            background-color: #f3f4f6;
        }

        svg {
            width: 16px;
            height: 16px;
            fill: #6b7280;
        }
    }
}

</style>
