@extends('layouts.app')

@section('page_title', 'View Card Type')

@section('content')
<div class="container-fluid py-4">
    <div class="row justify-content-center">
        <div class="card">
            <div class="card-header border-0 bg-transparent">
                <h5 class="mb-0">View Card Type</h5>
            </div>
            <div class="card-body">
                @if (session('success'))
                    <div class="alert alert-success alert-dismissible fade show" role="alert">
                        {{ session('success') }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                    </div>
                @endif
                @if (session('error'))
                    <div class="alert alert-danger alert-dismissible fade show" role="alert">
                        {{ session('error') }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                    </div>
                @endif
                <div class="mb-3">
                    <label class="form-label">Card Type Description</label>
                    <input type="text" class="form-control" value="{{ $cardType['cardTypeDescription'] }}" readonly>
                </div>
                <div class="mb-3">
                    <label class="form-label">Card Code</label>
                    <input type="text" class="form-control" value="{{ $cardType['cardCode'] }}" readonly>
                </div>
                <div class="mb-3">
                    <label class="form-label">Type</label>
                    <input type="text" class="form-control" value="{{ $cardType['type'] }}" readonly>
                </div>
                <div class="mb-3">
                    <label class="form-label">Short Description</label>
                    <input type="text" class="form-control" value="{{ $cardType['cardTypeShortDescription'] }}" readonly>
                </div>
                <div class="mb-3">
                    <label class="form-label">Card Image</label>
                    @if ($cardType['cardTypeImage'])
                        <input type="text" class="form-control" value="{{ $cardType['cardTypeImage'] }}" readonly>
                        <a href="{{ $cardType['cardTypeImage'] }}" target="_blank" class="mt-2 d-inline-block">View Image</a>
                    @else
                        <input type="text" class="form-control" value="No image available" readonly>
                    @endif
                </div>
                <div class="mb-3">
                    <label class="form-label">Font Color</label>
                    <input type="text" class="form-control" value="{{ $cardType['virtualCardFontColor'] }}" readonly>
                </div>
                <div class="mb-3">
                    <label class="form-label">Cover Image</label>
                    @if ($cardType['cardTypeCoverImage'])
                        <input type="text" class="form-control" value="{{ $cardType['cardTypeCoverImage'] }}" readonly>
                        <a href="{{ $cardType['cardTypeCoverImage'] }}" target="_blank" class="mt-2 d-inline-block">View Image</a>
                    @else
                        <input type="text" class="form-control" value="No image available" readonly>
                    @endif
                </div>
                <div class="mb-3">
                    <label class="form-label">ID Number Required</label>
                    <input type="text" class="form-control" value="{{ $cardType['idNumberRequired'] }}" readonly>
                </div>
                <div class="mb-3">
                    <label class="form-label">ID Number Description</label>
                    <input type="text" class="form-control" value="{{ $cardType['idNumberDescription'] ?: 'N/A' }}" readonly>
                </div>
                <div class="mb-3">
                    <label class="form-label">Terms and Conditions</label>
                    <textarea class="form-control" readonly>{{ $cardType['termsAndConditions'] }}</textarea>
                </div>
                <div class="mb-3">
                    <label class="form-label">FAQs</label>
                    <textarea class="form-control" readonly>{{ $cardType['faqs'] }}</textarea>
                </div>
                <div class="text-end">
                    <a href="{{ route('card-types') }}" class="btn btn-primary">Back</a>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection