<script setup lang="ts">
import MainLayout from "@/Layouts/MainLayout.vue";
import { Head } from '@inertiajs/vue3';
import { Flight } from "@/Types/types";
import AirlineLogo from "@/Components/FlightsGoneBy/AirlineLogo.vue";
import FlightClassBadge from "@/Components/FlightsGoneBy/FlightClassBadge.vue";
import FlightListTable from "@/Components/FlightsGoneBy/FlightListTable.vue";

defineOptions({
    layout: MainLayout
})

defineProps<{
    user: {
        id: number
        name: string
        email: string
    }
    flights: Flight[]
}>()

</script>

<template>
    <Head :title="`${user.name}'s Flights`" />

    <div class="board-wrapper">
        <div class="board-header">
            <div class="board-title-group">
                <span class="board-eyebrow">FLIGHT HISTORY</span>
                <h1 class="board-title">{{ user.name }}</h1>
            </div>
            <div class="board-count">
                <span class="count-number">{{ flights.length }}</span>
                <span class="count-label">FLIGHTS</span>
            </div>
        </div>

        <FlightListTable :flights="flights" />
    </div>
</template>

<style scoped>
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Barlow:wght@400;500;600&family=Barlow+Condensed:wght@500;700&display=swap');

/* ── Wrapper ── */
.board-wrapper {
    min-height: 100dvh;
    background: #0d0f14;
    padding: 2.5rem 2rem;
    font-family: 'Barlow', sans-serif;
    width:100%;
}

/* ── Header ── */
.board-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255,193,7,0.2);
    padding-bottom: 1.25rem;
}

.board-eyebrow {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: #ffc107;
    margin-bottom: 0.25rem;
}

.board-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #f0f2f5;
    letter-spacing: 0.04em;
    line-height: 1;
    margin: 0;
}

.board-count {
    text-align: right;
    line-height: 1;
}

.count-number {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 2rem;
    color: #ffc107;
}

.count-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    color: #556;
}


</style>
