/**
 * FNF Shiprocket Tracking — Visual Timeline
 * Uses brand kit CSS variables from teapoz-child.
 */

/* ── Wrapper ── */
.fnf-track-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 0;
}

/* ── Form Card ── */
.fnf-track-form-card {
    background: var(--fnf-white, #fff);
    border: 1px solid var(--fnf-leaf-border, #cee0b8);
    border-radius: 14px;
    padding: 28px 24px;
    margin-bottom: 20px;
}

.fnf-track-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--fnf-green-deep, #2c4a18);
    margin: 0 0 6px;
}

.fnf-track-subtitle {
    font-size: 14px;
    color: var(--fnf-muted, #7a8570);
    margin: 0 0 18px;
}

/* ── Input Row ── */
.fnf-track-input-row {
    display: flex;
    gap: 10px;
}

.fnf-track-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--fnf-subtle-border, #dde5d4);
    border-radius: 10px;
    font-size: 15px;
    color: var(--fnf-ink, #1a2410);
    outline: none;
    transition: border-color 0.18s;
}

.fnf-track-input:focus {
    border-color: var(--fnf-green, #568f31);
}

.fnf-track-btn {
    padding: 12px 28px;
    background: var(--fnf-green, #568f31);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
    white-space: nowrap;
}

.fnf-track-btn:hover {
    background: var(--fnf-green-dark, #3f6a23);
}

.fnf-track-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fnf-track-hint {
    font-size: 12px;
    color: var(--fnf-muted, #7a8570);
    margin: 10px 0 0;
}

/* ── Error ── */
.fnf-track-error {
    background: #fdecea;
    color: #9c2a1f;
    border: 1px solid #f5b5b0;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ── Loading ── */
.fnf-track-loading {
    text-align: center;
    padding: 30px;
    color: var(--fnf-muted, #7a8570);
    font-size: 14px;
}

.fnf-track-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--fnf-leaf-border, #cee0b8);
    border-top-color: var(--fnf-green, #568f31);
    border-radius: 50%;
    animation: fnf-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes fnf-spin {
    to { transform: rotate(360deg); }
}

/* ── Result ── */
.fnf-track-result {
    background: var(--fnf-white, #fff);
    border: 1px solid var(--fnf-leaf-border, #cee0b8);
    border-radius: 14px;
    padding: 24px;
}

/* ── Status Header ── */
.fnf-track-status-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fnf-track-status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-delivered {
    background: var(--fnf-leaf-light, #e8f0dd);
    color: var(--fnf-green-deep, #2c4a18);
}

.status-in-transit {
    background: #e8f4fd;
    color: #1a5276;
}

.status-out-for-delivery {
    background: var(--fnf-honey-bg, #fdf6e6);
    color: var(--fnf-honey-dark, #a87a2c);
}

.status-processing {
    background: #f0f0f0;
    color: #555;
}

.status-exception {
    background: #fdecea;
    color: #9c2a1f;
}

.fnf-track-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--fnf-muted, #7a8570);
}

.fnf-track-meta span {
    white-space: nowrap;
}

/* ── Timeline ── */
.fnf-track-timeline {
    padding: 10px 0 0;
}

.fnf-tl-item {
    display: flex;
    gap: 16px;
    position: relative;
    padding-bottom: 24px;
}

/* Vertical connecting line */
.fnf-tl-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 20px;
    bottom: 0;
    width: 2px;
    background: var(--fnf-leaf-border, #cee0b8);
}

/* Active item's line is green */
.fnf-tl-active:not(:last-child)::before {
    background: var(--fnf-green, #568f31);
}

/* Dot */
.fnf-tl-dot {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-top: 2px;
    z-index: 1;
}

.fnf-dot-done {
    background: var(--fnf-green, #568f31);
    border: 3px solid var(--fnf-leaf-light, #e8f0dd);
}

.fnf-dot-active {
    background: var(--fnf-honey, #c8943e);
    border: 3px solid var(--fnf-honey-bg, #fdf6e6);
    box-shadow: 0 0 0 3px var(--fnf-honey, #c8943e);
    animation: fnf-pulse 2s ease-in-out infinite;
}

@keyframes fnf-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(200, 148, 62, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(200, 148, 62, 0.1); }
}

/* Content */
.fnf-tl-content {
    flex: 1;
    min-width: 0;
}

.fnf-tl-status {
    font-size: 14px;
    font-weight: 600;
    color: var(--fnf-ink, #1a2410);
    margin-bottom: 2px;
}

.fnf-tl-active .fnf-tl-status {
    color: var(--fnf-honey-dark, #a87a2c);
    font-size: 15px;
}

.fnf-tl-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--fnf-muted, #7a8570);
    flex-wrap: wrap;
}

.fnf-track-empty {
    text-align: center;
    color: var(--fnf-muted, #7a8570);
    font-size: 14px;
    padding: 20px;
}

/* ── Mobile ── */
@media (max-width: 560px) {
    .fnf-track-wrap {
        padding: 10px 0;
    }

    .fnf-track-form-card {
        padding: 20px 16px;
    }

    .fnf-track-input-row {
        flex-direction: column;
    }

    .fnf-track-btn {
        width: 100%;
    }

    .fnf-track-title {
        font-size: 19px;
    }

    .fnf-track-result {
        padding: 18px 14px;
    }

    .fnf-track-status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
