/*
 * Overall summary:
 * This stylesheet controls the full visual design of the bicycle theft website.
 * It defines the colour palette, header, forms, cards, police tables, map frame,
 * and responsive behaviour for mobile screens.
 */

:root {
    /* CSS custom properties keep colours and common sizes consistent across pages. */
    --ink: #18202b;
    --muted: #657083;
    --panel: #ffffff;
    --page: #f5f7f2;
    --line: #d8dfd2;
    --green: #1f6f5b;
    --green-dark: #154b40;
    --amber: #f1b434;
    --red: #b4232c;
    --radius: 8px;
    --shadow: 0 12px 30px rgba(24, 32, 43, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--green-dark);
}

.site-header {
    /* The sticky header keeps the navigation available while users move through longer pages. */
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px clamp(18px, 4vw, 48px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.brand-logo {
    /* Fixed logo dimensions stop the large source image from stretching the header. */
    width: 46px;
    height: 56px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fff;
    background: var(--green);
    border-radius: 50%;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.primary-nav a,
.nav-toggle {
    padding: 9px 12px;
    color: var(--ink);
    text-decoration: none;
    border-radius: var(--radius);
}

.primary-nav a:hover,
.nav-toggle:hover {
    background: #e7eee6;
}

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: #fff;
}

.page-shell {
    /* The page shell keeps content readable on wide screens without touching the viewport edges. */
    width: min(1120px, calc(100% - 32px));
    min-height: calc(100vh - 156px);
    margin: 0 auto;
    padding: 36px 0 56px;
}

.hero {
    /* The homepage uses a two-column hero on larger screens to introduce the project clearly. */
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    gap: 28px;
    align-items: stretch;
    padding: clamp(34px, 6vw, 70px) 0 28px;
}

.hero h1,
.section-heading h1,
.form-page h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1.06;
}

.hero-panel,
.form-card,
.bike-card,
.report-card,
.stat-card,
.empty-state,
.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-panel {
    align-self: center;
    padding: 24px;
    border-top: 5px solid var(--amber);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--green-dark);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.lead {
    margin-top: 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.action-row,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.button {
    /* Buttons share one base style so links and form buttons feel consistent. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button.primary {
    color: #fff;
    background: var(--green);
}

.button.secondary {
    color: var(--green-dark);
    background: #eef5ef;
    border-color: #c8d9ce;
}

.button.danger {
    color: #fff;
    background: var(--red);
}

.button.small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.92rem;
}

.content-grid,
.stat-grid,
.bike-grid,
.two-column {
    display: grid;
    gap: 18px;
}

.content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 28px;
}

.stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 20px 0;
}

.stat-card {
    padding: 20px;
}

.stat-card strong {
    display: block;
    color: var(--green-dark);
    font-size: 2.2rem;
}

.form-page {
    width: min(860px, 100%);
    margin: 0 auto;
}

.form-page.narrow {
    width: min(520px, 100%);
}

.form-card {
    /* Form cards use CSS grid so labels and controls remain evenly spaced. */
    display: grid;
    gap: 16px;
    padding: 22px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #bbc7b7;
    border-radius: var(--radius);
    font: inherit;
}

textarea {
    resize: vertical;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid transparent;
}

.flash-success {
    background: #e8f5ec;
    border-color: #aad2b7;
}

.flash-error {
    background: #fff0f1;
    border-color: #e8a5aa;
}

.bike-grid {
    /* auto-fit lets the bicycle cards wrap naturally as the screen gets narrower. */
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.bike-card {
    overflow: hidden;
}

.bike-card img,
.report-card img {
    /* object-fit crops uploaded photos neatly without distorting the bicycle image. */
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #dbe4d8;
}

.bike-card-body {
    padding: 18px;
}

.bike-card h2,
.report-card h2 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.image-placeholder {
    display: grid;
    height: 180px;
    place-items: center;
    color: var(--muted);
    background: #dbe4d8;
}

.detail-list {
    display: grid;
    gap: 8px;
    margin: 0 0 16px;
}

.detail-list div {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
}

.detail-list.compact div {
    grid-template-columns: 130px minmax(0, 1fr);
}

dt {
    color: var(--muted);
    font-weight: 700;
}

dd {
    margin: 0;
}

.report-list {
    display: grid;
    gap: 16px;
}

.report-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    padding: 16px;
}

.report-card img {
    height: 160px;
    border-radius: var(--radius);
}

.status-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.status-badge {
    /* Status badges make investigation progress easy to scan in public and police pages. */
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 5px 10px;
    color: var(--green-dark);
    background: #e8f5ec;
    border: 1px solid #b7d6bf;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
}

.note,
.muted {
    color: var(--muted);
}

.empty-state {
    padding: 24px;
    text-align: center;
}

.filter-bar {
    /* The police filter sits in one row on desktop so officers can work quickly. */
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(180px, 260px) auto;
    gap: 14px;
    align-items: end;
    margin: 20px 0;
}

.table-wrap {
    /* Large police tables can scroll horizontally on smaller screens instead of breaking the layout. */
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 13px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--green-dark);
    background: #edf3eb;
}

.two-column {
    grid-template-columns: minmax(300px, 0.8fr) minmax(420px, 1.2fr);
    align-items: start;
}

.map-frame {
    overflow: hidden;
    margin: 18px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.map-frame iframe {
    /* The embedded Google map is framed at a predictable height for the theft report page. */
    display: block;
    width: 100%;
    height: 280px;
    border: 0;
}

.site-footer {
    padding: 22px;
    color: var(--muted);
    text-align: center;
    border-top: 1px solid var(--line);
    background: #fff;
}

@media (max-width: 760px) {
    /* On mobile, the navigation collapses and multi-column layouts become single-column. */
    .nav-toggle {
        display: inline-flex;
    }

    .primary-nav {
        display: none;
        position: absolute;
        right: 16px;
        top: 72px;
        width: min(280px, calc(100vw - 32px));
        padding: 10px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .primary-nav.is-open {
        display: grid;
    }

    .hero,
    .content-grid,
    .stat-grid,
    .field-row,
    .report-card,
    .filter-bar,
    .two-column {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 24px;
    }

    .detail-list div,
    .detail-list.compact div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}
