/* Manga Freight - Tracking */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 16px;
    color: #090302;
    line-height: 1.6;
    background: #F2F2F2;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #F44B22;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ─── Layout ─── */
.tracking-container {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
}

.tracking-wrapper {
    width: 100%;
    max-width: 800px;
}

/* ─── Search Box ─── */
.tracking-search {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 1.25rem;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: #888888;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    flex: 1;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 1px solid #d9d9d9;
    border-radius: 27px;
    font-size: 1rem;
    font-family: inherit;
    color: #090302;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.search-input:focus {
    outline: none;
    border-color: #F44B22;
    box-shadow: 0 0 0 3px rgba(244, 75, 34, 0.1);
}

.search-input::placeholder {
    color: #888888;
}

.search-button {
    flex-shrink: 0;
    background: #F44B22;
    color: #ffffff;
    border: none;
    border-radius: 27px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.search-button:hover {
    background: #d9401c;
}

/* ─── Loading Spinner ─── */
.loading-spinner {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    gap: 1rem;
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #e5e5e5;
    border-top-color: #F44B22;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: #555555;
    font-size: 0.9375rem;
}

/* ─── Results Card ─── */
.tracking-results {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    margin-top: 1rem;
    display: none;
}

/* ─── Tracking Header Info ─── */
.tracking-header-info {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e5e5;
}

.tracking-header-info h5 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #090302;
    margin-bottom: 0.25rem;
}

.tracking-header-info p {
    color: #555555;
    font-size: 0.9375rem;
    margin: 0;
    text-align: left;
}

/* ─── Timeline ─── */
.tracking-timeline {
    position: relative;
}

.tracking-box {
    position: relative;
    padding-left: 2.25rem;
    padding-bottom: 1.25rem;
}

.tracking-box:last-child {
    padding-bottom: 0;
}

/* Timeline dot */
.tracking-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.375rem;
    width: 14px;
    height: 14px;
    background: #F44B22;
    border: 3px solid rgba(244, 75, 34, 0.15);
    border-radius: 50%;
    z-index: 1;
}

.tracking-box:first-child::before {
    width: 16px;
    height: 16px;
    border-width: 4px;
}

/* Delivered status - green */
.tracking-box.status-delivered::before {
    background: #2C7E3F;
    border-color: rgba(44, 126, 63, 0.15);
}

.tracking-box.status-delivered .tracking-location {
    background: #E8F6EA;
}

.tracking-box.status-delivered .event-title {
    color: #2C7E3F;
}

/* Timeline line */
.tracking-box:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 1.25rem;
    bottom: 0;
    width: 2px;
    background: #e5e5e5;
}

.tracking-time-box {
    margin-bottom: 0.375rem;
}

.tracking-time {
    font-weight: 700;
    color: #090302;
    font-size: 0.9375rem;
}

.tracking-time-box p {
    color: #888888;
    font-size: 0.875rem;
    margin: 0;
    text-align: left;
}

.tracking-location {
    background: #F2F2F2;
    padding: 0.875rem 1rem;
    border-radius: 8px;
}

.event-title {
    display: block;
    color: #090302;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.event-description {
    color: #555555;
    font-size: 0.9375rem;
    margin: 0;
    line-height: 1.5;
}

/* ─── External Tracking ─── */
.external-tracking {
    display: none;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    margin-top: 1rem;
}

/* ─── Validation hint ─── */
.search-hint {
    color: #B40C1C;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
    display: none;
}

/* ─── Disabled state ─── */
.search-input:disabled {
    background: #f5f5f5;
    color: #888888;
    cursor: not-allowed;
}

.search-button:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
}

/* ─── Error State ─── */
.error-message {
    text-align: left;
    color: #B40C1C;
    background: #FCEDEE;
    padding: 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
}

.error-message .event-title {
    color: #B40C1C;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.error-message .event-description {
    color: #555555;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* ─── No Results ─── */
.tracking-results p {
    font-size: 1rem;
    color: #555555;
    text-align: left;
    padding: 1rem 0;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .tracking-container {
        padding: 1rem 0.75rem;
    }

    .tracking-search {
        padding: 1rem;
    }

    .search-input-wrapper {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-icon {
        top: 50%;
        transform: translateY(-50%);
    }

    .search-input {
        padding: 0.875rem 1rem 0.875rem 3rem;
        font-size: 16px;
    }

    .search-button {
        width: 100%;
        justify-content: center;
        padding: 0.875rem;
    }

    .tracking-results {
        padding: 1.25rem;
    }

    .tracking-box {
        padding-left: 1.75rem;
    }

    .tracking-box::before {
        width: 12px;
        height: 12px;
    }

    .tracking-box:first-child::before {
        width: 14px;
        height: 14px;
    }

    .tracking-box:not(:last-child)::after {
        left: 5px;
    }

    .tracking-location {
        padding: 0.75rem;
    }
}
