/* ================================================================
   GFS Tracking Page — Full Stylesheet
   ================================================================ */

.gfs-tracking-section {
    padding: 60px 0 40px;
    background: #f8fafc;
}

/* ── Search Form Card ── */

.gfs-tracking-form-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 40px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
}

.gfs-tracking-form { width: 100%; }

.gfs-tracking-input-group {
    display: flex;
    gap: 0;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.gfs-tracking-input-group:focus-within { border-color: #090b52; }

.gfs-tracking-input-group input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    background: transparent;
    color: #1a1a2e;
}
.gfs-tracking-input-group input::placeholder { color: #94a3b8; }

.gfs-tracking-input-group button {
    padding: 16px 32px;
    background: #090b52;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}
.gfs-tracking-input-group button:hover { background: #0d1066; }
.gfs-tracking-input-group button:disabled { opacity: 0.7; cursor: not-allowed; }

.gfs-tracking-hint {
    margin: 10px 0 0;
    font-size: 13px;
    color: #94a3b8;
}

.gfs-tracking-error {
    margin-top: 16px;
    padding: 14px 18px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
}

/* ── Results Container ── */

.gfs-tracking-results {
    margin-top: 32px;
    animation: gfsFadeIn 0.4s ease;
}

@keyframes gfsFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Shipment Overview Card ── */

.gfs-shipment-overview {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.gfs-shipment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: #090b52;
    color: #fff;
    flex-wrap: wrap;
    gap: 12px;
}

.gfs-shipment-number .label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 4px;
}
.gfs-shipment-number .value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1.5px;
}

/* Status badges */
.gfs-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}
.gfs-status-badge.status-pending          { background: #fef3c7; color: #92400e; }
.gfs-status-badge.status-picked_up        { background: #dbeafe; color: #1e40af; }
.gfs-status-badge.status-in_transit       { background: #e0e7ff; color: #3730a3; }
.gfs-status-badge.status-out_for_delivery { background: #fce7f3; color: #9d174d; }
.gfs-status-badge.status-delivered        { background: #d1fae5; color: #065f46; }
.gfs-status-badge.status-exception        { background: #fee2e2; color: #991b1b; }
.gfs-status-badge.status-returned         { background: #fee2e2; color: #991b1b; }
.gfs-status-badge.status-cancelled        { background: #f1f5f9; color: #475569; }
.gfs-status-badge.status-on_hold          { background: #fff7ed; color: #9a3412; }

/* ── Progress Bar ── */

.gfs-progress-bar {
    display: flex;
    align-items: center;
    padding: 28px 32px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
}

.gfs-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.gfs-progress-step .step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 3px solid #e2e8f0;
    transition: all 0.3s;
    position: relative;
}
.gfs-progress-step .step-dot::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 10px; height: 10px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.3s;
}

.gfs-progress-step.completed .step-dot {
    background: #090b52;
    border-color: #090b52;
}
.gfs-progress-step.completed .step-dot::after {
    background: #fff;
    width: 8px; height: 8px;
    border-radius: 2px;
    background: transparent;
    /* checkmark via unicode is not reliable; use solid fill */
    background: #fff;
    border-radius: 50%;
    width: 10px; height: 10px;
}

.gfs-progress-step.active .step-dot {
    background: #fff;
    border-color: #090b52;
    box-shadow: 0 0 0 4px rgba(9, 11, 82, 0.15);
}
.gfs-progress-step.active .step-dot::after {
    background: #090b52;
}

.gfs-progress-step.error .step-dot {
    background: #ef4444;
    border-color: #ef4444;
}

.gfs-progress-step .step-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.gfs-progress-step.completed .step-label,
.gfs-progress-step.active .step-label { color: #090b52; }
.gfs-progress-step.error .step-label { color: #ef4444; }

.gfs-progress-connector {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    min-width: 24px;
    margin: 0 4px;
    border-radius: 2px;
    overflow: hidden;
    align-self: flex-start;
    margin-top: 13px;
}
.gfs-progress-connector .connector-fill {
    height: 100%;
    width: 0;
    background: #090b52;
    transition: width 0.4s ease;
    border-radius: 2px;
}
.gfs-progress-connector .connector-fill.error { background: #ef4444; }

/* ── Key Details Summary ── */

.gfs-key-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid #e2e8f0;
}

.gfs-key-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 24px;
    border-right: 1px solid #e2e8f0;
}
.gfs-key-item:last-child { border-right: none; }

.gfs-key-item .key-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.gfs-key-item .key-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 3px;
}
.gfs-key-item .key-value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

/* ── Cards (sender/receiver, details, etc.) ── */

.gfs-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.gfs-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.gfs-full-card {
    margin-top: 20px;
}

.gfs-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}
.gfs-card-title svg { color: #090b52; flex-shrink: 0; }

.gfs-card-body { padding: 20px 24px; }

/* Address card content */
.gfs-address-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}
.gfs-address-line {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}
.gfs-contact-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
}
.gfs-contact-row svg { color: #94a3b8; flex-shrink: 0; }

/* ── Shipment Details Grid ── */

.gfs-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.gfs-detail-cell {
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}
.gfs-detail-cell:nth-child(3n+2) { padding-left: 20px; padding-right: 20px; }
.gfs-detail-cell.wide { grid-column: 1 / -1; }
.gfs-detail-cell .cell-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 4px;
}
.gfs-detail-cell .cell-value {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}
.gfs-detail-cell.highlight .cell-value {
    color: #dc2626;
    font-weight: 600;
}

/* ── Packages Table ── */

.gfs-packages-table-wrap { overflow-x: auto; }

.gfs-packages-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.gfs-packages-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.gfs-packages-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}
.gfs-packages-table tr:last-child td { border-bottom: none; }

.gfs-pkg-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.gfs-pkg-status.status-pending    { background: #fef3c7; color: #92400e; }
.gfs-pkg-status.status-in_transit { background: #e0e7ff; color: #3730a3; }
.gfs-pkg-status.status-delivered  { background: #d1fae5; color: #065f46; }
.gfs-pkg-status.status-exception  { background: #fee2e2; color: #991b1b; }

/* ── Route Map ── */

#gfs-route-map { background: #e2e8f0; }

/* ── Timeline ── */

.gfs-timeline-section {
    margin-top: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    padding: 28px 32px;
}

.gfs-timeline-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 24px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}
.gfs-timeline-section h3 svg { color: #090b52; }

.gfs-tracking-timeline {
    position: relative;
    padding-left: 44px;
}
.gfs-tracking-timeline::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 16px;
    bottom: 16px;
    width: 2px;
    background: #e2e8f0;
}

.gfs-timeline-item {
    position: relative;
    padding-bottom: 28px;
}
.gfs-timeline-item:last-child { padding-bottom: 0; }

.gfs-timeline-dot {
    position: absolute;
    left: -36px;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.gfs-timeline-item.latest .gfs-timeline-dot {
    background: #090b52;
    border-color: #090b52;
    box-shadow: 0 0 0 4px rgba(9, 11, 82, 0.12);
}

.gfs-timeline-content { padding-top: 4px; }

.gfs-timeline-status {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 3px;
}

.gfs-timeline-desc {
    font-size: 14px;
    color: #475569;
    margin-bottom: 4px;
    line-height: 1.5;
}

.gfs-timeline-notes {
    font-size: 13px;
    color: #64748b;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 3px solid #e2e8f0;
    font-style: italic;
}

.gfs-timeline-meta {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.gfs-timeline-meta .meta-location::before,
.gfs-timeline-meta .meta-branch::before {
    content: '·';
    margin-right: 6px;
}

.gfs-no-events {
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* ── Documents ── */

.gfs-documents-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gfs-doc-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    transition: background 0.2s;
}
.gfs-doc-item:hover { background: #f1f5f9; }

.gfs-doc-item .doc-icon { font-size: 22px; flex-shrink: 0; }
.gfs-doc-item .doc-info { display: flex; flex-direction: column; }
.gfs-doc-item .doc-name { font-size: 14px; font-weight: 500; color: #1e293b; }
.gfs-doc-item .doc-meta { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* ── Responsive ── */

@media (max-width: 1024px) {
    .gfs-key-details { grid-template-columns: repeat(2, 1fr); }
    .gfs-key-item:nth-child(2) { border-right: none; }
    .gfs-key-item:nth-child(3),
    .gfs-key-item:nth-child(4) { border-top: 1px solid #e2e8f0; }

    .gfs-detail-grid { grid-template-columns: repeat(2, 1fr); }
    .gfs-detail-cell:nth-child(3n+2) { padding-left: 0; padding-right: 0; }
}

@media (max-width: 768px) {
    .gfs-tracking-section { padding: 40px 0 24px; }

    .gfs-tracking-form-card {
        padding: 24px 16px;
        margin-top: -24px;
    }

    .gfs-tracking-input-group {
        flex-direction: column;
        border-radius: 8px;
    }
    .gfs-tracking-input-group button {
        justify-content: center;
        border-radius: 0;
    }

    .gfs-shipment-header { padding: 20px; }
    .gfs-shipment-number .value { font-size: 18px; }

    .gfs-progress-bar { padding: 20px 16px; gap: 2px; }
    .gfs-progress-step .step-label { font-size: 9px; }
    .gfs-progress-step .step-dot { width: 22px; height: 22px; }
    .gfs-progress-connector { margin-top: 10px; min-width: 12px; }

    .gfs-key-details { grid-template-columns: 1fr; }
    .gfs-key-item { border-right: none; border-bottom: 1px solid #e2e8f0; }
    .gfs-key-item:last-child { border-bottom: none; }

    .gfs-cards-row { grid-template-columns: 1fr; gap: 16px; }

    .gfs-detail-grid { grid-template-columns: 1fr; }

    .gfs-timeline-section { padding: 20px 16px; }
    .gfs-tracking-timeline { padding-left: 40px; }
    .gfs-timeline-dot { left: -34px; width: 28px; height: 28px; font-size: 12px; }
    .gfs-tracking-timeline::before { left: 12px; }

    .gfs-card-body { padding: 16px; }
    .gfs-card-title { padding: 14px 16px; font-size: 14px; }
}

@media (max-width: 480px) {
    .gfs-progress-bar {
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    .gfs-progress-step .step-label { font-size: 8px; max-width: 50px; text-align: center; line-height: 1.2; }
}
