/* BPL Cargo shipment tracking modern layout.
   Added for /track-shipment/ result page. */

:root {
    --bpl-blue: #2b54a3;
    --bpl-blue-dark: #17366f;
    --bpl-orange: #d9782d;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --border: #e5e7eb;
    --success-bg: #e9f7ef;
    --success-text: #137a3a;
    --danger-bg: #fff4f4;
    --danger-border: #f0b7b7;
    --danger-text: #8a1f1f;
    --shadow: 0 18px 45px rgba(20, 35, 70, .10);
    --radius-lg: 22px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Lato', Arial, Helvetica, sans-serif;
    color: var(--text-main);
    background: radial-gradient(circle at top left, rgba(43, 84, 163, .10), transparent 28rem), linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
}

h1,
h2,
h3,
.eyebrow,
.section-title,
.summary-card .label,
.summary-card .value,
.search-box button,
.btn,
th,
.view-btn,
.timeline-status,
.box-badge,
.tracking-error,
.tracking-empty {
    font-family: 'Poppins', Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.site-header {
    text-align: center;
    margin-bottom: 28px;
}

.logo {
    width: 152px;
    max-width: 45vw;
    height: auto;
    margin: 0 auto 12px;
    display: block;
}

.eyebrow {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin: 0;
}

.hero-card {
    background: linear-gradient(135deg, var(--bpl-blue), var(--bpl-blue-dark));
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(217, 120, 45, .30);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 22px;
    align-items: end;
}

h1 {
    margin: 0 0 8px;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -.04em;
}

.hero-copy {
    margin: 0;
    color: rgba(255, 255, 255, .84);
    font-size: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 18px;
    padding: 10px;
    min-width: min(500px, 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
    overflow: hidden;
}

.search-box input[type="text"] {
    border: 0;
    outline: 0;
    padding: 0 16px;
    flex: 1;
    min-width: 160px;
    min-height: 46px;
    font-size: 15px;
    color: var(--text-main);
    background: transparent;
    border-radius: 12px;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.search-box button,
.btn {
    border: 0;
    border-radius: 14px;
    background: var(--bpl-orange);
    color: #ffffff;
    font-weight: 700;
    padding: 14px 24px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover,
.btn:hover {
    background: #c86b25;
}

.section {
    margin-top: 26px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.section-title::before {
    content: "";
    width: 7px;
    height: 28px;
    border-radius: 999px;
    background: var(--bpl-orange);
    display: inline-block;
    flex: 0 0 auto;
}

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

.summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: 0 10px 26px rgba(20, 35, 70, .05);
}

.summary-card .label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 8px;
}

.summary-card .value {
    color: var(--text-main);
    font-size: 16px;
    font-weight: 800;
    word-break: break-word;
}

.wide-card,
.timeline-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

th {
    background: #f2f5fb;
    color: #344054;
    text-align: left;
    padding: 15px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    color: #374151;
    font-size: 14px;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: 0;
}

.tracking-row-active td {
    background: rgba(43, 84, 163, .06);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: none;
    white-space: nowrap;
    line-height: 1.2;
    background: var(--success-bg);
    color: var(--success-text);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 800;
    font-size: 12px;
    text-transform: capitalize;
}

.status-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.view-btn {
    background: var(--bpl-blue);
    color: #ffffff;
    border: 0;
    border-radius: 999px;
    padding: 12px 22px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
    text-align: center;
    min-width: 124px;
}

.view-btn:hover {
    background: var(--bpl-blue-dark);
}

table th:nth-child(5),
table td:nth-child(5) {
    min-width: 240px;
}

table th:nth-child(7),
table td:nth-child(7) {
    min-width: 160px;
    text-align: center;
}

.timeline-card {
    padding: 24px;
    overflow: visible;
}

.tracking-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 18px;
}

.tracking-head p {
    margin: 6px 0 0;
    color: var(--text-muted);
}

.box-badge {
    display: inline-flex;
    border: 1px solid rgba(43, 84, 163, .18);
    background: rgba(43, 84, 163, .08);
    color: var(--bpl-blue);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 800;
    white-space: nowrap;
}

.timeline {
    position: relative;
    display: grid;
    gap: 16px;
    padding-left: 30px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 7px;
    bottom: 7px;
    width: 2px;
    background: #b7e4c7;
}

.timeline-item {
    position: relative;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -26px;
    top: 19px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #198754;
    box-shadow: 0 0 0 4px rgba(25, 135, 84, .16);
}

.timeline-status {
    color: var(--bpl-blue);
    font-weight: 900;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.timeline-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.timeline-meta span {
    word-break: break-word;
}

.tracking-error,
.tracking-empty {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
    padding: 16px 18px;
    border-radius: var(--radius-md);
    margin-top: 22px;
    box-shadow: 0 10px 26px rgba(20, 35, 70, .04);
}

.tracking-empty {
    background: #f8fafc;
    border-color: var(--border);
    color: var(--text-muted);
}

.footer-actions {
    margin-top: 32px;
    text-align: center;
}

.btn.secondary {
    background: var(--bpl-blue);
    min-height: 52px;
    padding-left: 28px;
    padding-right: 28px;
}

.btn.secondary:hover {
    background: var(--bpl-blue-dark);
}

@media (max-width: 920px) {
    .hero-content {
        grid-template-columns: 1fr;
    }

    .search-box {
        width: 100%;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .timeline-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .page {
        width: min(100% - 24px, 1120px);
        padding-top: 22px;
    }

    .hero-card {
        padding: 22px;
        border-radius: 18px;
    }

    .search-box {
        border-radius: 16px;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .search-box input[type="text"] {
        width: 100%;
        min-height: 44px;
    }

    .search-box button {
        width: 100%;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .tracking-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .box-badge {
        white-space: normal;
    }

    .timeline-meta {
        grid-template-columns: 1fr;
    }
}
