/* =========================================================
   Navicon Track & Trace – Frontend Styles
   Brand navy:  #10263e   Red accent: #ed1c24
   Font: Geologica (matches navicon-group.com)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Geologica:wght@300;400;500;600;700&display=swap');

:root {
    --ntt-primary:   #10263e;   /* Navy – main brand */
    --ntt-primary-dk:#0a1a2c;   /* deeper navy */
    --ntt-primary-lt:#e6edf3;   /* light navy tint */
    --ntt-accent:    #ed1c24;   /* Red – CTA / action */
    --ntt-accent-dk: #c41019;   /* darker red for hover */
    --ntt-timeline:  #2f4c80;   /* Timeline blue – matches web app */
    --ntt-muted:     #6c8096;
    --ntt-border:    #ccd6e0;
    --ntt-radius:    10px;
    --ntt-font:      'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Wrapper ───────────────────────────────────────────── */
.ntt-wrap {
    font-family: var(--ntt-font);
    width: 100%;
    color: #333;
}

/* ── Search Box ────────────────────────────────────────── */
.ntt-search-box {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.ntt-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ntt-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--ntt-border);
    border-radius: var(--ntt-radius) var(--ntt-radius) 0 0;
    font-size: 1rem;
    font-family: var(--ntt-font);
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s;
    color: #333;
}

.ntt-input:focus {
    border-color: var(--ntt-primary);
    z-index: 1;
    position: relative;
}

.ntt-button {
    background: var(--ntt-primary);
    color: #fff;
    border: none;
    border-radius: 0 0 var(--ntt-radius) var(--ntt-radius);
    padding: 14px;
    font-size: .95rem;
    font-weight: 700;
    font-family: var(--ntt-font);
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s;
}

.ntt-button:hover {
    background: var(--ntt-accent);
}

.ntt-error {
    margin-top: 14px;
    background: #fff3f3;
    border: 1px solid #f5c6cb;
    color: #c0392b;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: .9rem;
}

/* ── Results – Header ──────────────────────────────────── */
.ntt-results {
    margin-top: 28px;
}

.ntt-result-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    background: #10263e;
    color: #fff;
    border-radius: var(--ntt-radius);
    padding: 18px 24px;
    margin-bottom: 20px;
}

.ntt-result-ref {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ntt-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .75;
}

.ntt-value {
    font-size: 1rem;
    font-weight: 600;
}

/* ── Route Bar ─────────────────────────────────────────── */
.ntt-route {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid var(--ntt-border);
    border-radius: var(--ntt-radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,.04);
}

.ntt-port {
    flex: 1;
    text-align: center;
}

.ntt-port-icon {
    font-size: 1.4rem;
    color: var(--ntt-primary);
    margin-bottom: 4px;
}

.ntt-port-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ntt-muted);
    margin-bottom: 6px;
}

.ntt-port-place {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ntt-primary-dk);
}

.ntt-port-port {
    font-size: .85rem;
    color: var(--ntt-muted);
}

.ntt-port-date {
    font-size: .8rem;
    color: var(--ntt-primary);
    font-weight: 600;
    margin-top: 4px;
}

/* ── Date Pills ────────────────────────────────────────── */
.ntt-dates-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ntt-date-pill {
    flex: 1;
    min-width: 140px;
    background: var(--ntt-primary-lt);
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ntt-date-pill .ntt-label {
    color: var(--ntt-primary);
}

.ntt-date-pill .ntt-value {
    color: var(--ntt-primary-dk);
}

/* ── Vertical Timeline ─────────────────────────────────── */
.ntt-timeline-card {
    background: #fff;
    border: 1px solid var(--ntt-border);
    border-radius: var(--ntt-radius);
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,.04);
}

.ntt-timeline-heading,
.ntt-section-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ntt-primary-dk);
    margin: 0 0 20px;
}

.ntt-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

/* vertical connecting line – base (pending/default) */
.ntt-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ccc;
}

.ntt-tl-item {
    display: flex;
    gap: 18px;
    padding-bottom: 28px;
    position: relative;
    align-items: flex-start;
}

.ntt-tl-item:last-child {
    padding-bottom: 0;
}

/* dot */
.ntt-tl-dot {
    width: 14px;
    height: 14px;
    min-width: 14px;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    border: 2px solid #ccc;
    background: #fff;
    margin-top: 3px;
}

/* status variants – match web app (web/shipments/bookings/view) */
.ntt-tl-item.completed .ntt-tl-dot {
    background: var(--ntt-timeline);
    border-color: var(--ntt-timeline);
    color: #fff;
}

.ntt-tl-item.active .ntt-tl-dot {
    background: #fff;
    border-color: var(--ntt-timeline);
    color: var(--ntt-timeline);
    box-shadow: 0 0 0 4px rgba(47,76,128,.18);
}

.ntt-tl-item.skipped .ntt-tl-dot {
    background: #fff;
    border-color: #ccc;
    color: #ccc;
}

.ntt-tl-item.pending .ntt-tl-dot {
    background: #fff;
    border-color: #ccc;
    color: transparent;
}

/* connector line colour overrides – match web app */
.ntt-tl-item.completed::before,
.ntt-tl-item.skipped::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 14px;
    bottom: 0;
    width: 2px;
    background: var(--ntt-timeline);
    z-index: 0;
}

.ntt-tl-item.active::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 14px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(var(--ntt-timeline), var(--ntt-border));
    z-index: 0;
}

.ntt-tl-body {
    flex: 1;
    padding-top: 4px;
}

.ntt-tl-title {
    font-weight: 700;
    font-size: .95rem;
    color: #333;
    margin-bottom: 2px;
}

.ntt-tl-item.pending .ntt-tl-title,
.ntt-tl-item.skipped .ntt-tl-title {
    color: var(--ntt-muted);
}

.ntt-tl-date {
    font-size: .78rem;
    color: var(--ntt-muted);
    margin-bottom: 4px;
}

.ntt-tl-desc {
    font-size: .85rem;
    color: #555;
}

.ntt-tl-item.pending .ntt-tl-desc {
    color: #bbb;
}

.ntt-tl-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    padding: 2px 8px;
    margin-left: 8px;
    vertical-align: middle;
}

.ntt-tl-item.completed .ntt-tl-badge { background: #dce4f0; color: var(--ntt-timeline); }
.ntt-tl-item.active    .ntt-tl-badge { background: #e6edf8; color: var(--ntt-timeline); }
.ntt-tl-item.skipped   .ntt-tl-badge { background: #f8f9fa; color: #888; }
.ntt-tl-item.pending   .ntt-tl-badge { background: #f8f9fa; color: #bbb; }

/* ── Containers Table ──────────────────────────────────── */
.ntt-containers-wrap {
    background: #fff;
    border: 1px solid var(--ntt-border);
    border-radius: var(--ntt-radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.ntt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.ntt-table th {
    background: var(--ntt-primary-lt);
    color: var(--ntt-primary-dk);
    font-weight: 700;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid var(--ntt-border);
}

.ntt-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--ntt-border);
    color: #444;
}

.ntt-table tr:last-child td {
    border-bottom: none;
}

/* ── Back Button ───────────────────────────────────────── */
.ntt-back-btn {
    background: none;
    border: 1px solid var(--ntt-border);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    color: var(--ntt-primary);
    font-size: .9rem;
    font-weight: 600;
    transition: background .2s;
}

.ntt-back-btn:hover {
    background: var(--ntt-primary-lt);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .ntt-route { 
        flex-direction: column; 
        gap: 20px; 
        padding: 20px 16px;
    }
    
    .ntt-result-header { 
        grid-template-columns: 1fr 1fr; 
        padding: 16px 18px;
    }
    
    .ntt-dates-row {
        flex-direction: column;
    }
    
    .ntt-date-pill {
        min-width: 100%;
    }
    
    .ntt-timeline-card {
        padding: 18px 16px;
    }
    
    /* Containers table – make it scrollable on small screens */
    .ntt-containers-wrap {
        overflow-x: auto;
        padding: 16px;
    }
    
    .ntt-table {
        font-size: .82rem;
        min-width: 400px; /* Prevent extreme squashing */
    }
    
    .ntt-table th,
    .ntt-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .ntt-input {
        font-size: .95rem;
        padding: 12px 14px;
    }
    
    .ntt-button {
        font-size: .88rem;
        padding: 12px;
    }
    
    .ntt-result-header {
        grid-template-columns: 1fr; /* Stack on very small screens */
        gap: 10px;
    }
    
    .ntt-value {
        font-size: .95rem;
    }
    
    .ntt-port-place {
        font-size: .98rem;
    }
}
