/* =========================================================
   SERVICE 04 — TRUCK SHARE / ROUTE POOLING
   VISUAL + ANIMATION
========================================================= */


/* =========================================================
   SHIPMENT CARD
========================================================= */

.shiftify-service .pool-shipment-card {

    width: 100%;
    max-width: 310px;

    margin: 18px auto 14px;

    padding: 13px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #ffffff;

    box-shadow:
        0 8px 20px rgba(15,23,42,.05);

}


/* ROUTE */

.shiftify-service .pool-route {

    display: grid;

    grid-template-columns: auto 1fr auto;

    align-items: center;

    gap: 9px;
}


.shiftify-service .pool-location {

    display: flex;

    align-items: center;

    gap: 6px;

    min-width: 0;
}


.shiftify-service .pool-location-dot {

    width: 8px;
    height: 8px;

    flex: 0 0 8px;

    border-radius: 50%;

    background: #ff5a1f;

    box-shadow:
        0 0 0 4px rgba(255,90,31,.08);
}


.shiftify-service .pool-location-dot--end {

    background: #16a34a;

    box-shadow:
        0 0 0 4px rgba(22,163,74,.08);
}


.shiftify-service .pool-location small {

    display: block;

    color: #94a3b8;

    font-size: 7px;
    font-weight: 700;
}


.shiftify-service .pool-location strong {

    display: block;

    margin-top: 2px;

    color: #111827;

    font-size: 10px;
}


/* ROUTE LINE */

.shiftify-service .pool-route-line {

    height: 1px;

    position: relative;

    background:
        repeating-linear-gradient(
            90deg,
            #cbd5e1 0,
            #cbd5e1 5px,
            transparent 5px,
            transparent 9px
        );
}


.shiftify-service .pool-route-truck {

    position: absolute;

    left: 50%;
    top: 50%;

    width: 25px;
    height: 25px;

    display: flex;
    align-items: center;
    justify-content: center;

    transform:
        translate(-50%, -50%);

    border: 1px solid #fed7aa;

    border-radius: 50%;

    background: #fff7ed;

    font-size: 11px;

    animation:
        routeTruckMove 2.8s linear infinite;
}


@keyframes routeTruckMove {

    0% {
        left: 8%;
    }

    100% {
        left: 92%;
    }

}


/* SHIPMENT DETAILS */

.shiftify-service .pool-shipment-details {

    margin-top: 14px;

    padding-top: 10px;

    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 8px;

    border-top: 1px solid #f1f5f9;
}


.shiftify-service .pool-shipment-details > div {

    padding: 8px;

    border-radius: 7px;

    background: #f8fafc;
}


.shiftify-service .pool-shipment-details span {

    display: block;

    margin-bottom: 3px;

    color: #94a3b8;

    font-size: 8px;
}


.shiftify-service .pool-shipment-details strong {

    color: #475569;

    font-size: 10px;
}


/* STATUS */

.shiftify-service .pool-status {

    max-width: 310px;

    margin: 0 auto;

    display: grid;

    grid-template-columns: 20px 1fr auto;

    align-items: center;

    gap: 7px;

    padding: 9px 11px;

    border: 1px solid #dcfce7;

    border-radius: 9px;

    background: #f0fdf4;

    font-size: 10px;
}


.shiftify-service .pool-status .status-check {

    width: 18px;
    height: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #16a34a;

    color: #ffffff;

    font-size: 9px;
    font-weight: 800;
}


.shiftify-service .pool-status span:nth-child(2) {
    color: #475569;
}


.shiftify-service .pool-status strong {
    color: #15803d;
    font-size: 9px;
}


/* =========================================================
   MATCH LIST
========================================================= */

.shiftify-service .pool-match-list {

    width: 100%;
    max-width: 315px;

    margin: 18px auto 12px;

    display: flex;
    flex-direction: column;

    gap: 8px;
}


.shiftify-service .pool-match-item {

    min-height: 52px;

    display: grid;

    grid-template-columns: 34px 1fr auto;

    align-items: center;

    gap: 8px;

    padding: 8px 9px;

    border: 1px solid #e2e8f0;

    border-radius: 9px;

    background: #ffffff;

    box-shadow:
        0 4px 10px rgba(15,23,42,.04);

    transition:
        transform .3s ease,
        border-color .3s ease;
}


.shiftify-service .pool-match-item--active {

    border-color: #ff5a1f;

    background: #fffaf5;

    animation:
        matchHighlight 2.4s ease-in-out infinite;
}


@keyframes matchHighlight {

    0%,
    100% {
        box-shadow:
            0 4px 10px rgba(15,23,42,.04);
    }

    50% {
        box-shadow:
            0 7px 18px rgba(255,90,31,.12);
    }

}


.shiftify-service .pool-truck-icon {

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: #f1f5f9;

    font-size: 15px;
}


.shiftify-service .pool-match-item--active .pool-truck-icon {
    background: #ffedd5;
}


.shiftify-service .pool-match-info {
    min-width: 0;
}


.shiftify-service .pool-match-info strong {

    display: block;

    color: #111827;

    font-size: 9px;
}


.shiftify-service .pool-match-info span {

    display: block;

    margin-top: 3px;

    color: #94a3b8;

    font-size: 8px;
}


.shiftify-service .pool-match-percent {

    color: #16a34a;

    font-size: 10px;
    font-weight: 800;
}


.shiftify-service .pool-match-percent--muted {
    color: #94a3b8;
}


/* MATCH STATUS */

.shiftify-service .match-status {

    max-width: 315px;

    margin: 0 auto;

    display: flex;

    align-items: center;

    gap: 7px;

    padding: 9px 11px;

    border-radius: 9px;

    background: #f0fdf4;

    border: 1px solid #dcfce7;

    color: #166534;

    font-size: 10px;
}


.shiftify-service .match-status > span {

    width: 18px;
    height: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #16a34a;

    color: #ffffff;

    font-size: 9px;
}


/* =========================================================
   ROUTE PLAN MAP
========================================================= */

.shiftify-service .pool-plan-map {

    width: 100%;
    max-width: 315px;
    height: 135px;

    margin: 16px auto 12px;

    position: relative;

    overflow: hidden;

    border: 1px solid #dbe2ea;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #f8fafc,
            #eef2f7
        );
}


/* MAP GRID */

.shiftify-service .pool-map-grid {

    position: absolute;
    inset: 0;

    opacity: .45;

    background-image:
        linear-gradient(
            45deg,
            #dbe2e8 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #dbe2e8 25%,
            transparent 25%
        );

    background-size: 38px 38px;
}


/* ROUTE */

.shiftify-service .pool-map-route {

    position: absolute;

    left: 28px;
    right: 28px;

    top: 50%;

    display: flex;

    align-items: center;

    transform:
        translateY(-50%);
}


.shiftify-service .pool-map-point {

    width: 28px;
    height: 28px;

    flex: 0 0 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #fff7ed;

    border: 2px solid #ff5a1f;

    color: #ea580c;

    font-size: 6px;
    font-weight: 800;

    z-index: 3;
}


.shiftify-service .pool-map-point--end {

    border-color: #16a34a;

    background: #f0fdf4;

    color: #15803d;
}


/* PATH */

.shiftify-service .pool-map-path {

    flex: 1;

    height: 3px;

    position: relative;

    background:
        repeating-linear-gradient(
            90deg,
            #ff5a1f 0,
            #ff5a1f 7px,
            transparent 7px,
            transparent 12px
        );
}


.shiftify-service .pool-map-path span {

    position: absolute;

    top: 50%;

    left: 0;

    width: 8px;
    height: 8px;

    transform:
        translateY(-50%);

    border-radius: 50%;

    background: #ff5a1f;

    box-shadow:
        0 0 0 5px rgba(255,90,31,.08);

    animation:
        mapRouteMove 2.5s linear infinite;
}


@keyframes mapRouteMove {

    0% {
        left: 0;
    }

    100% {
        left: calc(100% - 8px);
    }

}


/* MAP TRUCK */

.shiftify-service .pool-map-truck {

    position: absolute;

    left: 50%;
    top: 35%;

    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 5px 12px rgba(15,23,42,.10);

    font-size: 14px;

    transform:
        translateX(-50%);

    animation:
        mapTruckFloat 2s ease-in-out infinite;
}


@keyframes mapTruckFloat {

    0%,
    100% {
        transform:
            translateX(-50%)
            translateY(0);
    }

    50% {
        transform:
            translateX(-50%)
            translateY(-5px);
    }

}


/* PLAN SUMMARY */

.shiftify-service .pool-plan-summary {

    width: 100%;
    max-width: 315px;

    margin: 0 auto;

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    border: 1px solid #e2e8f0;

    border-radius: 9px;

    overflow: hidden;

    background: #ffffff;
}


.shiftify-service .pool-plan-summary > div {

    min-width: 0;

    padding: 8px 5px;

    text-align: center;

    border-right: 1px solid #e2e8f0;
}


.shiftify-service .pool-plan-summary > div:last-child {
    border-right: 0;
}


.shiftify-service .pool-plan-summary span {

    display: block;

    margin-bottom: 3px;

    color: #94a3b8;

    font-size: 7px;
}


.shiftify-service .pool-plan-summary strong {

    display: block;

    color: #111827;

    font-size: 8px;
}


/* =========================================================
   MOVEMENT TIMELINE
========================================================= */

.shiftify-service .pool-movement-timeline {

    width: 100%;
    max-width: 310px;

    margin: 18px auto 13px;
}


.shiftify-service .pool-timeline-item {

    display: flex;

    align-items: center;

    gap: 9px;

    padding: 7px 0;

    text-align: left;
}


.shiftify-service .pool-timeline-item > span {

    width: 25px;
    height: 25px;

    flex: 0 0 25px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f1f5f9;

    color: #94a3b8;

    font-size: 7px;
    font-weight: 800;

    border: 1px solid #e2e8f0;
}


.shiftify-service .pool-timeline-item.active > span {

    background: #ff5a1f;

    border-color: #ff5a1f;

    color: #ffffff;
}


.shiftify-service .pool-timeline-item div {
    min-width: 0;
}


.shiftify-service .pool-timeline-item strong {

    display: block;

    color: #111827;

    font-size: 10px;
}


.shiftify-service .pool-timeline-item small {

    display: block;

    margin-top: 2px;

    color: #94a3b8;

    font-size: 8px;
}


.shiftify-service .pool-timeline-line {

    width: 1px;
    height: 12px;

    margin-left: 12px;

    background: #cbd5e1;
}


/* MOVEMENT STATUS */

.shiftify-service .pool-move-status {

    max-width: 310px;

    margin: 0 auto;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 9px 11px;

    border-radius: 9px;

    background: #fff7ed;

    border: 1px solid #fed7aa;

    color: #78716c;

    font-size: 9px;
}


.shiftify-service .pool-move-status > span {

    color: #ff5a1f;

    animation:
        movementDot 1.4s ease-in-out infinite;
}


@keyframes movementDot {

    0%,
    100% {
        opacity: .35;
    }

    50% {
        opacity: 1;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .shiftify-service .pool-shipment-card,
    .shiftify-service .pool-match-list,
    .shiftify-service .pool-plan-map,
    .shiftify-service .pool-plan-summary,
    .shiftify-service .pool-movement-timeline {
        max-width: 280px;
    }

    .shiftify-service .pool-map-route {
        left: 20px;
        right: 20px;
    }

}