/* =========================================================
   THE WEB SHIPMENT TRACKER
   Professional Frontend Styles
   ========================================================= */


/* =========================================================
   TRACKING FORM
   ========================================================= */

.tw-shipping-tracker {
    width: 100%;
    margin: 30px auto;
}

.tw-tracker-form-card {
    overflow: hidden;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

.tw-tracker-form-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 26px 30px;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #007bff 0%,
        #0056b3 100%
    );
}

.tw-tracker-form-icon {
    width: 58px;
    height: 58px;
    min-width: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    font-size: 25px;
}

.tw-tracker-form-header h2 {
    margin: 2px 0 5px;
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
}

.tw-tracker-form-header p {
    margin: 0;
    color: rgba(255,255,255,0.82);
    font-size: 14px;
}

.tw-tracker-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    opacity: 0.85;
}

.tw-tracker-form-body {
    padding: 28px 30px;
}

.tw-tracking-input-wrap {
    margin-bottom: 18px;
}

.tw-tracking-input-wrap label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.tw-input-with-icon {
    position: relative;
}

.tw-input-with-icon > i {
    position: absolute;
    z-index: 2;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.tw-input-with-icon input {
    height: 52px;
    padding-left: 46px !important;
    border: 1px solid #d1d5db;
    border-radius: 10px !important;
    box-shadow: none !important;
    font-size: 15px;
}

.tw-input-with-icon input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.10) !important;
}

.tw-track-button {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    background: #28a745;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.tw-track-button:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(40,167,69,0.20);
}

.tw-track-button:disabled {
    opacity: 0.7;
    cursor: wait;
}


/* =========================================================
   LOADING
   ========================================================= */

.tw-tracker-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px 20px;
    color: #6b7280;
}

.tw-loading-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #e5e7eb;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: twSpin 0.8s linear infinite;
}

.tw-loading-text {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
}

@keyframes twSpin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   ALERTS
   ========================================================= */

.tw-tracker-alert {
    margin-top: 25px;
    padding: 15px 18px;
    border-radius: 10px;
    font-size: 14px;
}

.tw-tracker-alert i {
    margin-right: 8px;
}

.tw-tracker-alert-danger {
    color: #842029;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
}


/* =========================================================
   RESULT WRAPPER
   ========================================================= */

.tw-shipment-tracker-result {
    margin-top: 28px;
    color: #1f2937;
}


/* =========================================================
   RESULT HEADER
   ========================================================= */

.tw-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 25px 28px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(15,23,42,0.06);
    animation: twFadeUp 0.45s ease both;
}

.tw-result-eyebrow {
    margin-bottom: 5px;
    color: var(--tw-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.tw-result-header h2 {
    margin: 0 0 7px;
    color: #111827;
    font-size: 25px;
    font-weight: 750;
}

.tw-result-tracking-code {
    display: inline-block;
    padding: 6px 10px;
    color: #374151;
    background: #f3f4f6;
    border-radius: 7px;
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tw-barcode-container {
    min-width: 250px;
    padding: 8px;
    background: #ffffff;
    border-radius: 8px;
}

.tw-shipment-barcode {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto !important;
    margin: 0 auto;
}


/* =========================================================
   ROUTE
   ========================================================= */

.tw-route-summary {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-top: 18px;
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    animation: twFadeUp 0.5s ease both;
}

.tw-route-point {
    flex: 1;
    min-width: 0;
}

.tw-route-point strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 17px;
}

.tw-route-point small {
    display: block;
    margin-top: 3px;
    color: #6b7280;
}

.tw-route-label {
    color: #6b7280;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.tw-route-destination {
    text-align: right;
}

.tw-route-line {
    position: relative;
    flex: 0 0 100px;
    height: 2px;
    background: #d1d5db;
}

.tw-route-line span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    color: #ffffff;
    background: var(--tw-primary);
    border-radius: 50%;
    box-shadow: 0 5px 12px rgba(0,0,0,0.12);
}


/* =========================================================
   CURRENT STATUS
   ========================================================= */

.tw-current-status-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 20px;
    padding: 22px 25px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 5px solid var(--tw-status-color);
    border-radius: 13px;
    box-shadow: 0 9px 25px rgba(15,23,42,0.07);
    animation:
        twFadeUp 0.55s ease both,
        twStatusPulse 2.5s ease-in-out 0.7s 2;
}

.tw-current-status-icon {
    width: 58px;
    height: 58px;
    min-width: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--tw-status-color);
    border-radius: 50%;
    font-size: 22px;
}

.tw-current-status-content {
    flex: 1;
    min-width: 0;
}

.tw-current-status-label {
    color: #6b7280;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.tw-current-status-title {
    margin-top: 3px;
    color: #111827;
    font-size: 20px;
    font-weight: 750;
}

.tw-current-status-location {
    margin-top: 5px;
    color: #6b7280;
    font-size: 13px;
}

.tw-current-status-location i {
    margin-right: 5px;
    color: var(--tw-status-color);
}

.tw-current-status-date {
    padding-left: 20px;
    color: #6b7280;
    border-left: 1px solid #e5e7eb;
    font-size: 12px;
    line-height: 2;
}

.tw-current-status-date i {
    width: 16px;
    margin-right: 4px;
    color: var(--tw-status-color);
}

@keyframes twStatusPulse {
    0%, 100% {
        box-shadow: 0 9px 25px rgba(15,23,42,0.07);
    }

    50% {
        box-shadow:
            0 12px 35px rgba(15,23,42,0.12),
            0 0 0 5px rgba(40,167,69,0.05);
    }
}


/* =========================================================
   SECTION HEADINGS
   ========================================================= */

.tw-section-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 32px 0 15px;
}

.tw-section-heading-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--tw-primary);
    border-radius: 10px;
}

.tw-section-heading h3 {
    margin: 0;
    color: #111827;
    font-size: 19px;
    font-weight: 750;
}

.tw-section-heading p {
    margin: 2px 0 0;
    color: #6b7280;
    font-size: 12px;
}


/* =========================================================
   TIMELINE
   ========================================================= */

.tw-timeline-wrapper {
    position: relative;
    padding: 10px 0 5px;
}

.tw-shipment-tracker-result .timeline {
    position: relative;
    margin: 0;
    padding: 5px 0 20px;
    list-style: none;
    background: transparent;
}

.tw-shipment-tracker-result .timeline::before {
    content: "";
    position: absolute;
    z-index: 0;
    left: 25px;
    top: 5px;
    bottom: 25px;
    width: 4px;
    background: var(--tw-timeline-line);
    border-radius: 999px;
    transform-origin: top;
    animation: twTimelineGrow 1.1s ease-out forwards;
}

@keyframes twTimelineGrow {
    from {
        transform: scaleY(0);
    }

    to {
        transform: scaleY(1);
    }
}


/* Date */

.tw-shipment-tracker-result .timeline .time-label {
    position: relative;
    z-index: 2;
    margin: 0 0 8px 60px;
}

.tw-shipment-tracker-result .timeline .time-label span {
    display: inline-block;
    padding: 6px 11px;
    color: #ffffff;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0,0,0,0.10);
}


/* Timeline event */

.tw-timeline-event {
    position: relative;
    z-index: 1;
    margin: 0 0 22px 60px;
    opacity: 0;
    animation:
        twTimelineEventIn 0.45s ease forwards;
    animation-delay: var(--tw-event-delay);
}

@keyframes twTimelineEventIn {
    from {
        opacity: 0;
        transform: translateX(15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* Icon */

.tw-timeline-event > .tw-timeline-icon {
    position: absolute;
    left: -60px;
    top: 8px;
    z-index: 3;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--tw-status-color);
    border: 4px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.14);
    font-size: 16px;
}


/* Timeline card */

.tw-shipment-tracker-result .timeline-item {
    position: relative;
    margin: 0;
    padding: 0;
    background: var(--tw-timeline-background);
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--tw-status-color);
    border-radius: 10px;
    box-shadow: 0 5px 17px rgba(15,23,42,0.055);
    overflow: hidden;
}

.tw-shipment-tracker-result .timeline-item .time {
    float: right;
    padding: 13px 15px 0;
    color: #6b7280;
    font-size: 11px;
}

.tw-shipment-tracker-result .timeline-item .time i {
    margin-right: 4px;
}

.tw-shipment-tracker-result .timeline-header {
    margin: 0;
    padding: 14px 15px;
    padding-right: 145px;
    color: #111827;
    border-bottom: 1px solid #eef0f2;
    font-size: 15px;
    font-weight: 700;
}

.tw-status-name {
    display: inline-block;
}

.tw-status-location {
    display: inline-block;
    margin-left: 8px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}

.tw-status-location i {
    color: var(--tw-status-color);
}

.tw-shipment-tracker-result .timeline-body {
    padding: 13px 15px;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.6;
}


/* Origin */

.tw-timeline-origin {
    position: relative;
    z-index: 2;
    margin: 0 0 0 60px;
}

.tw-origin-icon {
    position: absolute;
    left: -60px;
    top: 8px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #6c757d;
    border: 4px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}

.tw-timeline-origin .timeline-item {
    background: #ffffff;
}


/* =========================================================
   MAP
   ========================================================= */

.tw-shipment-map,
#shipmentMap {
    width: 100%;
    height: 400px;
    margin-top: 25px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 7px 20px rgba(15,23,42,0.06);
}

.tw-shipment-map:empty {
    display: none;
}


/* =========================================================
   NO HISTORY
   ========================================================= */

.tw-no-history {
    margin-top: 20px;
    padding: 35px 25px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
}

.tw-no-history-icon {
    width: 55px;
    height: 55px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 21px;
}

.tw-no-history h3 {
    margin: 0;
    color: #111827;
    font-size: 18px;
}

.tw-no-history p {
    margin: 7px 0 0;
    color: #6b7280;
    font-size: 13px;
}


/* =========================================================
   INFORMATION CARDS
   ========================================================= */

.tw-information-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.tw-information-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    box-shadow: 0 6px 20px rgba(15,23,42,0.055);
    animation: twFadeUp 0.55s ease both;
}

.tw-information-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.tw-information-card-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--tw-primary);
    border-radius: 9px;
}

.tw-information-card-header span {
    display: block;
    color: #6b7280;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.tw-information-card-header h3 {
    margin: 2px 0 0;
    color: #111827;
    font-size: 17px;
    font-weight: 750;
}

.tw-information-card-body {
    padding: 5px 20px 10px;
}

.tw-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 0;
    border-bottom: 1px solid #f0f1f3;
}

.tw-detail-row:last-child {
    border-bottom: 0;
}

.tw-detail-row > span {
    min-width: 105px;
    color: #6b7280;
    font-size: 12px;
}

.tw-detail-row > span i {
    width: 17px;
    margin-right: 4px;
    color: var(--tw-primary);
}

.tw-detail-row > strong {
    color: #1f2937;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}


/* =========================================================
   PACKAGE
   ========================================================= */

.tw-package-card {
    margin-top: 18px;
}

.tw-package-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 20px;
}

.tw-package-detail {
    min-height: 80px;
    padding: 10px 18px;
    border-right: 1px solid #e5e7eb;
}

.tw-package-detail:first-child {
    padding-left: 0;
}

.tw-package-detail:last-child {
    border-right: 0;
}

.tw-package-detail > span {
    display: block;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
}

.tw-package-detail > span i {
    margin-right: 5px;
    color: var(--tw-primary);
}

.tw-package-detail > strong {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.tw-package-description {
    grid-column: 1 / -1;
    margin-top: 15px;
    padding: 15px 0 0;
    border-top: 1px solid #e5e7eb;
}

.tw-package-description strong {
    color: #4b5563;
    font-weight: 500;
    line-height: 1.6;
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes twFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 767px) {

    .tw-tracker-form-header {
        padding: 22px 20px;
    }

    .tw-tracker-form-body {
        padding: 22px 20px;
    }

    .tw-tracker-form-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .tw-tracker-form-header h2 {
        font-size: 20px;
    }

    .tw-result-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .tw-barcode-container {
        width: 100%;
        min-width: 0;
    }

    .tw-shipment-barcode {
        max-width: 100%;
    }

    .tw-route-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .tw-route-destination {
        text-align: left;
    }

    .tw-route-line {
        width: 100%;
        flex-basis: auto;
    }

    .tw-current-status-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .tw-current-status-date {
        width: 100%;
        padding: 12px 0 0 76px;
        border-left: 0;
        border-top: 1px solid #e5e7eb;
    }

    .tw-information-grid {
        grid-template-columns: 1fr;
    }

    .tw-package-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .tw-package-detail {
        padding: 13px 0;
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .tw-package-detail:first-child {
        padding-left: 0;
    }

    .tw-package-detail:last-child {
        border-bottom: 0;
    }

    .tw-package-description {
        margin-top: 0;
        border-top: 0;
    }

    .tw-detail-row {
        flex-direction: column;
        gap: 5px;
    }

    .tw-detail-row > strong {
        text-align: left;
    }

    .tw-shipment-tracker-result .timeline-item .time {
        float: none;
        display: block;
        padding: 12px 15px 0;
    }

    .tw-shipment-tracker-result .timeline-header {
        padding-right: 15px;
    }

    .tw-status-location {
        display: block;
        margin: 5px 0 0;
    }

    .tw-shipment-map,
    #shipmentMap {
        height: 300px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .tw-shipment-tracker-result *,
    .tw-shipping-tracker *,
    .tw-tracker-form-card {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}


/* =========================================================
   COMPACT PROFESSIONAL TYPOGRAPHY
   ========================================================= */

.tw-tracker-form-header h2 {
    font-size: 20px;
}

.tw-tracker-form-header p {
    font-size: 12px;
}

.tw-result-header h2 {
    font-size: 20px;
}

.tw-result-eyebrow {
    font-size: 10px;
}

.tw-result-tracking-code {
    font-size: 12px;
}

.tw-route-point strong {
    font-size: 14px;
}

.tw-route-point small {
    font-size: 11px;
}

.tw-route-label {
    font-size: 9px;
}

.tw-current-status-title {
    font-size: 16px;
}

.tw-current-status-label {
    font-size: 9px;
}

.tw-current-status-location {
    font-size: 12px;
}

.tw-current-status-date {
    font-size: 11px;
}

.tw-section-heading h3 {
    font-size: 16px;
}

.tw-section-heading p {
    font-size: 11px;
}

.tw-shipment-tracker-result .timeline .time-label span {
    font-size: 10px;
}

.tw-shipment-tracker-result .timeline-item .time {
    font-size: 10px;
}

.tw-shipment-tracker-result .timeline-header {
    font-size: 13px;
}

.tw-status-location {
    font-size: 11px;
}

.tw-shipment-tracker-result .timeline-body {
    font-size: 12px;
}

.tw-information-card-header span {
    font-size: 8px;
}

.tw-information-card-header h3 {
    font-size: 15px;
}

.tw-detail-row > span {
    font-size: 11px;
}

.tw-detail-row > strong {
    font-size: 11px;
}

.tw-package-detail > span {
    font-size: 10px;
}

.tw-package-detail > strong {
    font-size: 12px;
}

.tw-package-description strong {
    font-size: 12px;
}


/* =========================================================
   COMPACT SPACING
   ========================================================= */

.tw-result-header {
    padding: 20px 22px;
}

.tw-route-summary {
    padding: 16px 20px;
}

.tw-current-status-card {
    padding: 17px 20px;
}

.tw-current-status-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    font-size: 18px;
}

.tw-section-heading {
    margin: 25px 0 12px;
}

.tw-section-heading-icon {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.tw-information-card-header {
    padding: 14px 17px;
}

.tw-information-card-body {
    padding: 3px 17px 7px;
}

.tw-detail-row {
    padding: 10px 0;
}

.tw-package-grid {
    padding: 15px;
}

.tw-package-detail {
    min-height: 65px;
}

.tw-timeline-event {
    margin-bottom: 16px;
}

.tw-shipment-tracker-result .timeline-header {
    padding-top: 11px;
    padding-bottom: 11px;
}

.tw-shipment-tracker-result .timeline-body {
    padding-top: 10px;
    padding-bottom: 10px;
}