@extends('website.webLayouts.master')

@section('content')
<style>
    .gw-page-header {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        color: #ffffff;
        padding: 60px 0;
        text-align: center;
    }
    .gw-page-header h1 {
        font-size: clamp(28px, 4vw, 44px);
        font-weight: 800;
        letter-spacing: -0.02em;
        margin-bottom: 12px;
    }
    .gw-page-header p {
        color: #94a3b8;
        font-size: 16px;
        max-width: 600px;
        margin: 0 auto;
    }
    .gw-contact-section {
        padding: 60px 0 80px;
        background: #f8fafc;
    }
    .gw-contact-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        padding: 28px 24px;
        box-shadow: 0 4px 15px -2px rgba(15, 23, 42, 0.05);
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .gw-contact-icon {
        width: 52px;
        height: 52px;
        border-radius: 14px;
        display: grid;
        place-items: center;
        font-size: 22px;
        margin-bottom: 16px;
    }
    .gw-contact-form-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 20px;
        padding: 36px 32px;
        box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
    }
    .gw-form-label {
        font-size: 13.5px;
        font-weight: 600;
        color: #1e293b;
        margin-bottom: 6px;
    }
    .gw-form-control {
        width: 100%;
        padding: 11px 14px;
        border: 1px solid #cbd5e1;
        border-radius: 10px;
        font-size: 14px;
        outline: none;
        transition: all 0.2s ease;
    }
    .gw-form-control:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }
</style>

<!-- Header -->
<section class="gw-page-header">
    <div class="container">
        <span class="badge bg-primary px-3 py-2 rounded-pill mb-3" style="font-weight: 700;">WE ARE HERE TO HELP</span>
        <h1>Get in Touch with Our SMS Team</h1>
        <p>Have questions about API integration, bulk carrier rates, or Android gateway setup? Reach out to our 24/7 support.</p>
    </div>
</section>

<section class="gw-contact-section">
    <div class="container">

        @if(isset($successMessage) || session('successMessage'))
            <div class="alert alert-success d-flex align-items-center mb-4 rounded-3 shadow-sm">
                <i class="fa fa-check-circle fa-2x me-3"></i>
                <div>
                    <strong>Message Received!</strong>
                    <div>{{ $successMessage ?? session('successMessage') }}</div>
                </div>
            </div>
        @endif

        <!-- 3 Contact Cards -->
        <div class="row g-4 mb-5">
            <div class="col-md-4">
                <div class="gw-contact-card">
                    <div class="gw-contact-icon" style="background:#eff6ff; color:#2563eb;">
                        <i class="fa fa-envelope"></i>
                    </div>
                    <h3 style="font-size:17px; font-weight:700; color:#0f172a; margin-bottom:8px;">Email Support</h3>
                    <p class="text-muted" style="font-size:13.5px; margin-bottom:12px;">Quick responses within 1-2 hours</p>
                    <a href="mailto:admin@tmss-ict.com" style="color:#2563eb; font-weight:600; text-decoration:none;">admin@tmss-ict.com</a>
                    <a href="mailto:support@tmss-ict.com" style="color:#2563eb; font-weight:600; text-decoration:none;">support@tmss-ict.com</a>
                </div>
            </div>

            <div class="col-md-4">
                <div class="gw-contact-card">
                    <div class="gw-contact-icon" style="background:#ecfdf5; color:#059669;">
                        <i class="fa fa-phone"></i>
                    </div>
                    <h3 style="font-size:17px; font-weight:700; color:#0f172a; margin-bottom:8px;">Phone &amp; WhatsApp</h3>
                    <p class="text-muted" style="font-size:13.5px; margin-bottom:12px;">Direct hotline for emergency support</p>
                    @if(!empty($phone))
                        <a href="tel:{{ $phone }}" style="color:#059669; font-size:16px; font-weight:700; text-decoration:none;">{{ $phone }}</a>
                    @else
                        <span style="color:#059669; font-weight:700;">+880 1700-000000</span>
                    @endif
                </div>
            </div>

            <div class="col-md-4">
                <div class="gw-contact-card">
                    <div class="gw-contact-icon" style="background:#f5f3ff; color:#7c3aed;">
                        <i class="fa fa-map-marker"></i>
                    </div>
                    <h3 style="font-size:17px; font-weight:700; color:#0f172a; margin-bottom:8px;">Office Location</h3>
                    <p class="text-muted" style="font-size:13.5px; margin-bottom:0;">
                        {{ $address ?? 'TMSS ICT LTD, Dhaka, Bangladesh' }}
                    </p>
                </div>
            </div>
        </div>

        <!-- Form & Help Split -->
        <div class="row justify-content-center">
            <div class="col-lg-8">
                <div class="gw-contact-form-card">
                    <div class="text-center mb-4">
                        <h2 style="font-size:24px; font-weight:800; color:#0f172a;">Send Us an Inquiry</h2>
                        <p class="text-muted" style="font-size:14.5px;">Fill out the form below and an account manager will get back to you promptly.</p>
                    </div>

                    <form action="{{ route('message.from.website') }}" method="post">
                        @csrf
                        <div class="row g-3">
                            <div class="col-md-6">
                                <label class="gw-form-label" for="name">Your Name *</label>
                                <input type="text" id="name" class="gw-form-control" name="name" placeholder="Mahmudul Hasan" required value="{{ old('name') }}">
                                @error('name') <div class="text-danger small mt-1">{{ $message }}</div> @enderror
                            </div>

                            <div class="col-md-6">
                                <label class="gw-form-label" for="email">Work Email *</label>
                                <input type="email" id="email" class="gw-form-control" name="email" placeholder="you@company.com" required value="{{ old('email') }}">
                                @error('email') <div class="text-danger small mt-1">{{ $message }}</div> @enderror
                            </div>

                            <div class="col-md-6">
                                <label class="gw-form-label" for="phone">Phone Number *</label>
                                <input type="tel" id="phone" class="gw-form-control" name="phone" placeholder="+88017XXXXXXXX" required value="{{ old('phone') }}">
                                @error('phone') <div class="text-danger small mt-1">{{ $message }}</div> @enderror
                            </div>

                            <div class="col-md-6">
                                <label class="gw-form-label" for="subject">Subject</label>
                                <input type="text" id="subject" class="gw-form-control" name="subject" placeholder="e.g. Sender ID Masking Request" value="{{ old('subject') }}">
                            </div>

                            <div class="col-12">
                                <label class="gw-form-label" for="message">Message *</label>
                                <textarea id="message" class="gw-form-control" name="message" rows="4" placeholder="Tell us about your estimated SMS volume, desired integration, or questions..." required>{{ old('message') }}</textarea>
                                @error('message') <div class="text-danger small mt-1">{{ $message }}</div> @enderror
                            </div>

                            <div class="col-12 text-end mt-4">
                                <button type="submit" class="btn btn-primary px-4 py-2" style="font-weight:700; border-radius:10px;">
                                    <i class="fa fa-paper-plane me-1"></i> Send Inquiry
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

    </div>
</section>
@endsection