@extends('layouts.app')

@section('content')
<div class="row mb-4">
    <div class="col-md-12">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb mb-1">
                <li class="breadcrumb-item"><a href="{{ route('dashboard') }}" class="text-decoration-none text-muted small">Dashboard</a></li>
                <li class="breadcrumb-item"><a href="{{ route('chatbot.index') }}" class="text-decoration-none text-muted small">Chatbot</a></li>
                <li class="breadcrumb-item active text-primary small fw-semibold" aria-current="page">Create</li>
            </ol>
        </nav>
        <h2 class="fw-bold text-dark">Add Chatbot Question</h2>
        <p class="text-secondary small">Create a guided response visitors can select from the portfolio chatbot.</p>
    </div>
</div>

<div class="row">
    <div class="col-lg-8">
        <div class="card border-0 shadow-lg rounded-4 overflow-hidden">
            <div class="card-header bg-white border-0 py-3 px-4 mt-2">
                <h6 class="m-0 fw-bold text-dark"><i class="bi bi-chat-left-text me-2 text-primary"></i> Question Details</h6>
            </div>
            <div class="card-body p-4 pt-2">
                <form action="{{ route('chatbot.store') }}" method="POST">
                    @csrf

                    @include('chatbot._form')

                    <hr class="my-4 opacity-50">

                    <div class="d-flex align-items-center justify-content-between flex-wrap gap-3">
                        <a href="{{ route('chatbot.index') }}" class="btn btn-link text-decoration-none text-secondary fw-semibold">
                            <i class="bi bi-arrow-left me-1"></i> Back to List
                        </a>
                        <div class="d-flex gap-2">
                            <button type="reset" class="btn btn-light rounded-3 px-4 fw-semibold text-secondary">Reset</button>
                            <button type="submit" class="btn btn-primary rounded-3 px-5 fw-bold shadow-sm">
                                <i class="bi bi-send-fill me-2"></i> Save Question
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="col-lg-4 mt-4 mt-lg-0">
        <div class="card border-0 bg-primary text-white rounded-4 shadow-lg p-3">
            <div class="card-body">
                <h5 class="fw-bold mb-3">Response Checklist</h5>
                <div class="d-flex mb-3">
                    <i class="bi bi-check2-circle me-3 fs-5"></i>
                    <p class="small mb-0">Keep each answer direct, helpful, and easy to scan.</p>
                </div>
                <div class="d-flex mb-3">
                    <i class="bi bi-link-45deg me-3 fs-5"></i>
                    <p class="small mb-0">Use action buttons only when the answer needs a clear next step.</p>
                </div>
                <div class="d-flex">
                    <i class="bi bi-sort-numeric-down me-3 fs-5"></i>
                    <p class="small mb-0">Lower sort order values appear earlier in the chatbot list.</p>
                </div>
            </div>
        </div>

        <div class="card border-0 shadow-sm rounded-4 mt-4 p-2 bg-white">
            <div class="card-body d-flex align-items-center">
                <div class="bg-info-subtle text-info rounded-circle p-3 me-3">
                    <i class="bi bi-info-circle-fill fs-4"></i>
                </div>
                <div>
                    <h6 class="fw-bold text-dark mb-1">Visitor Experience</h6>
                    <p class="text-secondary small mb-0">Active questions are intended for the frontend chatbot flow.</p>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

@section('styles')
<style>
    .input-group-text { border: none !important; }
    textarea.form-control { min-height: 150px; padding: 0.8rem; }
    .bg-info-subtle { background-color: #ecfeff !important; }
    .text-info { color: #0891b2 !important; }
</style>
@endsection
