@extends('layouts.public')

@section('title', 'SecureVision | Proteção Inteligente 24/7 — CCTV, Alarmes e Controlo de Acesso')
@section('meta_description', 'Câmeras IP 4K, alarmes conectados e monitoramento 24h para empresas e residências. Solicite o seu orçamento gratuito hoje.')

@section('content')

{{-- ======================================================
     1. HERO SECTION
====================================================== --}}
<section class="relative flex min-h-[90vh] items-center justify-center overflow-hidden pt-20">

    {{-- Cyber-Grid Overlay --}}
    <div class="absolute inset-0 cyber-grid pointer-events-none"></div>

    {{-- Glowing Background Orbs --}}
    <div class="absolute top-10 left-1/4 h-96 w-96 rounded-full blur-3xl animate-float pointer-events-none" style="background:rgba(59,130,246,0.2);"></div>
    <div class="absolute bottom-10 right-1/4 h-96 w-96 rounded-full blur-3xl pointer-events-none" style="background:rgba(16,185,129,0.2); animation: float 8s ease-in-out infinite reverse;"></div>

    <div class="relative z-10 mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 text-center" style="display:flex; flex-direction:column; align-items:center; gap:2rem;">

        <span class="badge-primary">
            <svg class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
            Líder em Segurança Eletrónica
        </span>

        <h1 class="text-4xl sm:text-6xl font-extrabold tracking-tight text-white leading-tight" style="max-width:900px;">
            Proteção Inteligente e<br>
            <span class="text-gradient">Segurança Sem Falhas 24/7</span>
        </h1>

        <p class="max-w-2xl text-base sm:text-lg leading-relaxed" style="color:#cbd5e1;">
            CCTV de alta performance, alarmes conectados e monitoramento avançado de acesso. Soluções integradas para habitações, comércios e indústrias.
        </p>

        <div class="flex flex-col sm:flex-row items-center justify-center gap-4 pt-2 w-full sm:w-auto">
            <a href="{{ route('quote.create') }}" class="btn-primary w-full sm:w-auto" style="gap:0.5rem;">
                Solicitar Orçamento Grátis
                <svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H3"/></svg>
            </a>
            <a href="#servicos" class="btn-secondary w-full sm:w-auto">
                Conhecer Serviços
            </a>
        </div>

        <div class="flex items-center justify-center gap-2 text-sm" style="color:#94a3b8;">
            <span class="h-2 w-2 rounded-full" style="background:#10b981; animation:pulse 2s cubic-bezier(0.4,0,0.6,1) infinite;"></span>
            <span>Especialistas em segurança disponíveis agora</span>
            <a href="https://wa.me/244976463372?text=Olá!%20Gostaria%20de%20um%20orçamento%20rápido."
               target="_blank" rel="noopener noreferrer"
               class="font-semibold transition-colors flex items-center gap-1"
               style="color:#10b981;">
                via WhatsApp
                <svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/></svg>
            </a>
        </div>
    </div>
</section>

{{-- ======================================================
     2. PARTNERS (Technology Partners Strip)
====================================================== --}}
<section class="py-12 border-y border-slate-800/50" style="background:linear-gradient(to right, rgba(26,31,46,0.3), rgba(36,45,61,0.2));">
    <div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
        <p class="text-center text-xs font-semibold uppercase tracking-wider" style="color:#6b7280;">Parceiros Oficiais de Tecnologia</p>
        <div class="mt-8 flex flex-wrap items-center justify-center gap-8 sm:gap-16" style="opacity:0.6;">
            @foreach(['Hikvision','Dahua','Ajax','Bosch','Honeywell','Axis'] as $partner)
                <span class="text-sm font-semibold tracking-wider" style="color:#94a3b8;">{{ $partner }}</span>
            @endforeach
        </div>
    </div>
</section>

{{-- ======================================================
     3. SERVICES GRID
====================================================== --}}
<section id="servicos" class="section-padding relative overflow-hidden">
    <div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
        <div class="text-center mb-16" style="display:flex;flex-direction:column;align-items:center;gap:1rem;">
            <h2 class="text-3xl sm:text-4xl font-bold tracking-tight text-white">Sistemas Integrados de Alta Performance</h2>
            <p class="max-w-2xl leading-relaxed" style="color:#94a3b8;">
                Desenvolvemos e instalamos tecnologia de ponta para garantir a sua tranquilidade a qualquer hora do dia ou da noite.
            </p>
        </div>

        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
            {{-- Card CCTV --}}
            <div class="card hover-lift hover-glow group">
                <div class="mb-4 inline-flex h-12 w-12 items-center justify-center rounded-lg transition-all duration-300" style="background:rgba(30,41,59,0.5);">
                    <svg class="h-8 w-8" style="color:#3b82f6;" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/></svg>
                </div>
                <h3 class="text-lg font-semibold mb-2 text-white">CCTV & Video Vigilância</h3>
                <p class="text-sm leading-relaxed mb-4" style="color:#94a3b8;">Câmeras IP 4K de alta definição com IA e visão noturna colorida. Veja tudo no seu telemóvel.</p>
                <a href="#" class="inline-flex items-center gap-1 text-sm font-semibold transition-colors duration-200" style="color:#3b82f6;">
                    Saber Mais <svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H3"/></svg>
                </a>
            </div>

            {{-- Card Alarmes --}}
            <div class="card hover-lift hover-glow group">
                <div class="mb-4 inline-flex h-12 w-12 items-center justify-center rounded-lg transition-all duration-300" style="background:rgba(30,41,59,0.5);">
                    <svg class="h-8 w-8" style="color:#10b981;" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/></svg>
                </div>
                <h3 class="text-lg font-semibold mb-2 text-white">Alarmes Inteligentes</h3>
                <p class="text-sm leading-relaxed mb-4" style="color:#94a3b8;">Sistemas anti-intrusão conectados 24h à central de monitoramento. Sensores pet-friendly.</p>
                <a href="#" class="inline-flex items-center gap-1 text-sm font-semibold transition-colors duration-200" style="color:#3b82f6;">
                    Saber Mais <svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H3"/></svg>
                </a>
            </div>

            {{-- Card Controlo de Acesso --}}
            <div class="card hover-lift hover-glow group">
                <div class="mb-4 inline-flex h-12 w-12 items-center justify-center rounded-lg transition-all duration-300" style="background:rgba(30,41,59,0.5);">
                    <svg class="h-8 w-8" style="color:#3b82f6;" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"/></svg>
                </div>
                <h3 class="text-lg font-semibold mb-2 text-white">Controle de Acesso</h3>
                <p class="text-sm leading-relaxed mb-4" style="color:#94a3b8;">Leitores biométricos, reconhecimento facial e cartões de proximidade para empresas.</p>
                <a href="#" class="inline-flex items-center gap-1 text-sm font-semibold transition-colors duration-200" style="color:#3b82f6;">
                    Saber Mais <svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H3"/></svg>
                </a>
            </div>

            {{-- Card Monitoramento --}}
            <div class="card hover-lift hover-glow group">
                <div class="mb-4 inline-flex h-12 w-12 items-center justify-center rounded-lg transition-all duration-300" style="background:rgba(30,41,59,0.5);">
                    <svg class="h-8 w-8" style="color:#10b981;" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/></svg>
                </div>
                <h3 class="text-lg font-semibold mb-2 text-white">Monitoramento 24h</h3>
                <p class="text-sm leading-relaxed mb-4" style="color:#94a3b8;">Central própria de monitoramento com resposta rápida e intervenção tática imediata.</p>
                <a href="#" class="inline-flex items-center gap-1 text-sm font-semibold transition-colors duration-200" style="color:#3b82f6;">
                    Saber Mais <svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H3"/></svg>
                </a>
            </div>
        </div>
    </div>
</section>

{{-- ======================================================
     4. STATS SECTION
====================================================== --}}
<section class="section-padding border-y border-slate-800/50" style="background:linear-gradient(to bottom, rgba(26,31,46,0.5), #0f1219);">
    <div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
        <div class="grid grid-cols-2 lg:grid-cols-4 gap-8 text-center">
            @foreach([
                ['value'=>'10K+',   'label'=>'Clientes Protegidos'],
                ['value'=>'25K+',   'label'=>'Câmeras Instaladas'],
                ['value'=>'99.9%',  'label'=>'Uptime da Central'],
                ['value'=>'15 Min', 'label'=>'Tempo Resposta Médio'],
            ] as $stat)
            <div class="space-y-2 py-8">
                <p class="text-4xl sm:text-5xl font-bold text-gradient">{{ $stat['value'] }}</p>
                <p class="text-sm font-medium" style="color:#94a3b8;">{{ $stat['label'] }}</p>
            </div>
            @endforeach
        </div>
    </div>
</section>

{{-- ======================================================
     5. PROJECTS PORTFOLIO
====================================================== --}}
<section id="projetos" class="section-padding">
    <div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
        <div class="flex flex-col sm:flex-row items-end justify-between gap-4 mb-16">
            <div>
                <span class="badge-primary inline-flex mb-2">Casos de Sucesso</span>
                <h2 class="text-3xl sm:text-4xl font-bold tracking-tight text-white">Nossos Projetos Recentes</h2>
            </div>
            <a href="#" class="inline-flex items-center gap-1 text-sm font-semibold transition-colors" style="color:#3b82f6;">
                Ver Portfólio Completo
                <svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H3"/></svg>
            </a>
        </div>

        <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
            @foreach([
                ['title'=>'Segurança Industrial Viana',   'cat'=>'CCTV & Acesso',                  'img'=>'https://images.unsplash.com/photo-1558494949-ef010cbdcc31?q=80&w=600&auto=format&fit=crop'],
                ['title'=>'Condomínio Privado Talatona',  'cat'=>'Alarmes & CCTV',                  'img'=>'https://images.unsplash.com/photo-1549576490-b0b4831da60a?q=80&w=600&auto=format&fit=crop'],
                ['title'=>'Escritórios Fintech Luanda',   'cat'=>'Controle de Acesso Biométrico',   'img'=>'https://images.unsplash.com/photo-1497366216548-37526070297c?q=80&w=600&auto=format&fit=crop'],
            ] as $proj)
            <div class="group overflow-hidden rounded-xl card hover-lift hover-glow" style="padding:0;">
                <div class="relative overflow-hidden" style="aspect-ratio:4/3; background:#1e293b;">
                    <img src="{{ $proj['img'] }}" alt="{{ $proj['title'] }}" class="h-full w-full object-cover transition-transform duration-500 group-hover:scale-110" style="height:100%;width:100%;object-fit:cover;">
                    <div class="absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300" style="background:linear-gradient(to top, rgba(15,18,25,0.9), rgba(15,18,25,0.4), transparent);"></div>
                </div>
                <div class="p-6">
                    <span class="badge-primary text-xs">{{ $proj['cat'] }}</span>
                    <h3 class="text-lg font-semibold mt-3 text-white group-hover:text-blue-400 transition-colors">{{ $proj['title'] }}</h3>
                </div>
            </div>
            @endforeach
        </div>
    </div>
</section>

{{-- ======================================================
     6. TESTIMONIALS
====================================================== --}}
<section class="section-padding border-t border-slate-800/50" style="background:linear-gradient(to bottom, rgba(26,31,46,0.5), #0f1219);">
    <div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
        <div class="text-center mb-16">
            <h2 class="text-3xl sm:text-4xl font-bold tracking-tight text-white">O que dizem os nossos clientes</h2>
            <p class="mt-3 leading-relaxed" style="color:#94a3b8;">A confiança e satisfação dos nossos parceiros é o nosso maior orgulho.</p>
        </div>

        <div class="grid grid-cols-1 md:grid-cols-2 gap-8 max-w-4xl mx-auto">
            @foreach([
                ['name'=>'Rui Barbosa',  'role'=>'Diretor de Operações - LogiTrans', 'content'=>'A instalação de câmeras IP e controle de acesso biométrico nos nossos armazéns reduziu as ocorrências a zero. O suporte técnico é exemplar.'],
                ['name'=>'Ana Martins',  'role'=>'Proprietária - Villa Talatona',     'content'=>'Excelente serviço! O alarme inteligente dá-me total tranquilidade enquanto viajo. Consigo ver tudo pelo telemóvel.'],
            ] as $t)
            <div class="card hover-lift">
                <div class="flex gap-1 mb-4">
                    @for($i=0;$i<5;$i++)
                        <svg class="h-5 w-5" style="color:#10b981; fill:#10b981;" viewBox="0 0 24 24"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
                    @endfor
                </div>
                <p class="leading-relaxed mb-6" style="color:#cbd5e1;">"{{ $t['content'] }}"</p>
                <div class="border-t border-slate-700/50 pt-4">
                    <h4 class="font-semibold text-white">{{ $t['name'] }}</h4>
                    <p class="text-xs mt-1" style="color:#94a3b8;">{{ $t['role'] }}</p>
                </div>
            </div>
            @endforeach
        </div>
    </div>
</section>

{{-- ======================================================
     7. CTA SECTION
====================================================== --}}
<section id="orcamento" class="section-padding relative overflow-hidden border-t border-slate-800/50">
    <div class="absolute inset-0 pointer-events-none" style="background:linear-gradient(to right, rgba(59,130,246,0.05), rgba(16,185,129,0.05), transparent);"></div>
    <div class="mx-auto max-w-4xl px-4 sm:px-6 lg:px-8 text-center relative z-10" style="display:flex;flex-direction:column;align-items:center;gap:2rem;">
        <div class="flex h-16 w-16 items-center justify-center rounded-2xl" style="background:rgba(59,130,246,0.1); border:1px solid rgba(59,130,246,0.2);">
            <svg class="h-8 w-8" style="color:#3b82f6;" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"/></svg>
        </div>
        <h2 class="text-3xl sm:text-4xl lg:text-5xl font-bold tracking-tight text-white">Pronto para garantir a sua segurança?</h2>
        <p class="max-w-2xl leading-relaxed" style="color:#cbd5e1;">
            Fale com um dos nossos engenheiros especialistas para desenvolver um projeto de segurança sob medida para as suas necessidades.
        </p>

        {{-- Quick Quote Form --}}
        <div class="w-full max-w-xl glass-card text-left" style="margin-top:1rem;">
            <h3 class="text-lg font-semibold text-white mb-4">Pedido de Orçamento Rápido</h3>
            @if(session('quote_success'))
                <div class="alert-success mb-4">{{ session('quote_success') }}</div>
            @endif
            <form method="POST" action="{{ route('quote.store') }}" class="space-y-4">
                @csrf
                <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
                    <div>
                        <input type="text" name="name" placeholder="O seu nome" required
                            class="w-full rounded-lg px-4 py-3 text-sm text-white placeholder-slate-500 focus:outline-none transition-colors"
                            style="background:rgba(30,41,59,0.6); border:1px solid #334155;"
                            onfocus="this.style.borderColor='#3b82f6'" onblur="this.style.borderColor='#334155'">
                    </div>
                    <div>
                        <input type="tel" name="phone" placeholder="Telefone / WhatsApp" required
                            class="w-full rounded-lg px-4 py-3 text-sm text-white placeholder-slate-500 focus:outline-none transition-colors"
                            style="background:rgba(30,41,59,0.6); border:1px solid #334155;"
                            onfocus="this.style.borderColor='#3b82f6'" onblur="this.style.borderColor='#334155'">
                    </div>
                </div>
                <select name="service_type" required
                    class="w-full rounded-lg px-4 py-3 text-sm text-white focus:outline-none transition-colors"
                    style="background:rgba(30,41,59,0.6); border:1px solid #334155; color:#94a3b8;"
                    onfocus="this.style.borderColor='#3b82f6'" onblur="this.style.borderColor='#334155'">
                    <option value="" disabled selected>Selecione o serviço</option>
                    <option value="cctv">CCTV & Video Vigilância</option>
                    <option value="alarme">Alarmes Inteligentes</option>
                    <option value="acesso">Controle de Acesso</option>
                    <option value="monitorizacao">Monitoramento 24h</option>
                    <option value="pacote">Solução Completa (Pacote)</option>
                </select>
                <textarea name="details" rows="3" placeholder="Descreva brevemente as suas necessidades..."
                    class="w-full rounded-lg px-4 py-3 text-sm text-white placeholder-slate-500 focus:outline-none transition-colors resize-none"
                    style="background:rgba(30,41,59,0.6); border:1px solid #334155;"
                    onfocus="this.style.borderColor='#3b82f6'" onblur="this.style.borderColor='#334155'"></textarea>
                <button type="submit" class="btn-primary w-full justify-center">
                    Enviar Pedido Gratuito
                    <svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"/></svg>
                </button>
            </form>
        </div>

        <div class="flex flex-col sm:flex-row items-center justify-center gap-4">
            <a href="{{ route('quote.create') }}" class="btn-primary">
                Abrir orçamento completo
            </a>
            <a href="{{ route('login') }}" class="btn-secondary">
                Aceder ao Portal do Cliente
            </a>
        </div>
    </div>
</section>

@endsection
