/* ===== Track Result Section ===== */

.track-result-section {
    background: #EEF1F5;
    padding: 40px 0 60px;
}

.track-result-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Info Bar */
.track-result-info-bar {
    background: #fff;
    border-radius: 12px 12px 0 0;
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Refund Bar — matches info bar style */
.track-result-refund-bar {
    background: #fff;
    border-radius: 12px;
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-top: 16px;
}

.track-result-refund-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.track-result-refund-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #28a74515;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.track-result-refund-icon i {
    font-size: 24px;
    color: #28a745;
}

.track-result-refund-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.track-result-refund-subtitle {
    font-size: 13px;
    color: #6c757d;
    margin-top: 2px;
}

.track-result-refund-amount {
    font-size: 28px;
    font-weight: 800;
    color: #28a745;
    white-space: nowrap;
}

.track-result-refund-note {
    font-size: 12px;
    color: #adb5bd;
    margin-top: 4px;
    text-align: right;
}

.track-result-info-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.track-result-tracking-number {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    letter-spacing: 1px;
}

.track-result-tracking-number i {
    color: var(--ct-red);
}

.track-result-status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.track-result-info-right {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: #6c757d;
}

.track-result-info-right i {
    color: var(--ct-red);
}

/* Map */
.track-result-map-wrapper {
    position: relative;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.track-result-map {
    width: 100%;
    height: 480px;
    border-radius: 0;
}

.track-result-map-overlay {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 1000;
}

.track-result-map-info {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 200px;
}

.track-result-map-info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
    font-size: 14px;
}

.track-result-map-label {
    color: #6c757d;
    font-weight: 500;
}

.track-result-map-value {
    color: #333;
    font-weight: 600;
}

/* Info badges for Speed/ETA fields */
.info-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.info-badge-green {
    background: #d4edda;
    color: #155724;
}
.info-badge-red {
    background: #f8d7da;
    color: #721c24;
}
.info-badge-grey {
    background: #e2e3e5;
    color: #383d41;
}

/* Mobile collapse toggle */
.track-info-toggle {
    display: none;
}
.track-info-content {
    display: block;
}

/* Details Grid */
.track-result-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 28px;
}

.track-result-detail-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.track-result-detail-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--ct-red);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f2f5;
}

.track-result-detail-card h4 i {
    margin-right: 6px;
}

.track-result-detail-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.track-result-detail-text {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 6px;
    line-height: 1.5;
}

.track-result-detail-text i {
    color: var(--ct-red);
    margin-right: 4px;
}

/* Timeline */
.track-result-timeline-section {
    margin-top: 36px;
}

.track-result-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 24px;
}

.track-result-section-title i {
    color: var(--ct-red);
    margin-right: 8px;
}

.track-result-timeline {
    position: relative;
    padding-left: 32px;
    background: #fff;
    border-radius: 12px;
    padding: 32px 32px 32px 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.track-result-timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 32px;
    bottom: 32px;
    width: 2px;
    background: #e0e6ed;
}

.track-result-timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.track-result-timeline-item:last-child {
    padding-bottom: 0;
}

.track-result-timeline-dot {
    position: absolute;
    left: -40px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ct-red);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--ct-red);
}

.track-result-timeline-current .track-result-timeline-dot {
    background: #28a745;
    box-shadow: 0 0 0 2px #28a745;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 2px #28a745, 0 0 0 0 rgba(40, 167, 69, 0.4); }
    70% { box-shadow: 0 0 0 2px #28a745, 0 0 0 8px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 2px #28a745, 0 0 0 0 rgba(40, 167, 69, 0); }
}

.track-result-timeline-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.track-result-timeline-status {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.track-result-timeline-date {
    font-size: 13px;
    color: #6c757d;
}

.track-result-timeline-date i {
    margin-right: 4px;
}

.track-result-timeline-location {
    font-size: 14px;
    color: #007bff;
}

.track-result-timeline-location i {
    margin-right: 4px;
}

.track-result-timeline-remarks {
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
}

.track-result-timeline-expand {
    text-align: center;
    padding: 12px;
    margin-top: 8px;
    color: var(--ct-blue, #26a4db);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}
.track-result-timeline-expand:hover {
    background: rgba(38, 164, 219, 0.08);
}
.track-result-timeline-expand.collapsed {
    display: none;
}

@keyframes timelineSlideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
.track-result-timeline-item.new-entry {
    animation: timelineSlideIn 0.4s ease-out;
}

.track-result-empty {
    color: #6c757d;
    text-align: center;
    padding: 20px;
}

/* Vehicle marker on map */
.tracking-vehicle-marker {
    background: var(--ct-red);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    transition: transform 0.3s ease;
}

.tracking-origin-marker {
    background: #28a745;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tracking-dest-marker {
    background: var(--ct-red);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ===== Mobile Tracking Card ===== */
.mobile-track-card {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 20px;
    position: relative;
    z-index: 10;
}

.mobile-track-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    border-radius: 0 0 22px 22px;
    background: linear-gradient(to bottom, rgba(238,241,245,0) 0%, rgba(238,241,245,0.9) 100%);
    pointer-events: none;
    z-index: 1;
}

.mobile-track-card > * {
    position: relative;
    z-index: 2;
}

.mtc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.mtc-tracking {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.5px;
}

.mtc-tracking i {
    font-size: 20px;
    color: var(--ct-red);
}

.mtc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.mtc-status-badge i {
    font-size: 13px;
}

.mtc-product {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.mtc-product-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--ct-red)12;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mtc-product-icon i {
    font-size: 22px;
    color: var(--ct-red);
}

.mtc-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.mtc-product-name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mtc-product-sub {
    font-size: 13px;
    color: #6c757d;
}

.mtc-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    margin-bottom: 20px;
}

.mtc-node {
    flex-shrink: 0;
    background: transparent;
    color: #adb5bd;
    font-size: 20px;
    line-height: 1;
    padding: 0 2px;
    position: relative;
    z-index: 2;
}

.mtc-node-active {
    background: transparent;
    color: var(--ct-red);
}

.mtc-node-truck {
    font-size: 28px;
}

/* Green glow + pulse when truck is the current active step (in transit) */
.mtc-node-truck.mtc-node-active {
    color: #28a745;
    animation: mtcTruckPulse 2s ease-in-out infinite;
}

@keyframes mtcTruckPulse {
    0%, 100% {
        text-shadow: 0 0 4px rgba(40, 167, 69, 0.4), 0 0 8px rgba(40, 167, 69, 0.2);
    }
    50% {
        text-shadow: 0 0 8px rgba(40, 167, 69, 0.7), 0 0 16px rgba(40, 167, 69, 0.4), 0 0 24px rgba(40, 167, 69, 0.2);
    }
}

.mtc-line {
    flex: 1;
    border-top: 2px dashed #ced4da;
    margin: 0;
    position: relative;
    z-index: 1;
}

.mtc-line-active {
    border-top-color: var(--ct-red);
}

.mtc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.mtc-pay-btn {
    background: var(--ct-red);
    color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mtc-pay-btn:hover {
    background: var(--ct-red-dark);
    color: #fff;
}

.mtc-footer-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mtc-meta-line {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.mtc-meta-line i {
    color: var(--ct-red);
    font-size: 14px;
}

.mtc-meta-sub {
    font-size: 12px;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 991px) {
    .track-result-details-grid {
        grid-template-columns: 1fr;
    }
    .track-result-info-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .track-result-refund-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .track-result-refund-note {
        text-align: left;
    }
    .track-result-info-right {
        flex-wrap: wrap;
        gap: 8px;
    }
    .track-result-map {
        height: 360px;
    }
}

@media (max-width: 767px) {
    .track-result-section {
        padding-top: 0;
    }
    .track-result-info-bar {
        display: none;
    }
    .mobile-track-card {
        display: block !important;
        transform: translateY(-25%);
        margin-bottom: -44px;
        box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    }
    .track-result-map-wrapper {
        margin-top: 16px;
        border-radius: 12px;
        position: relative;
        background: transparent;
        box-shadow: none;
    }
    .track-result-map-wrapper::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 40px;
        border-radius: 12px 12px 0 0;
        background: linear-gradient(to bottom, rgba(238,241,245,0.9) 0%, rgba(238,241,245,0) 100%);
        pointer-events: none;
        z-index: 1001;
    }
    .track-result-map {
        border-radius: 12px;
    }
    .track-result-info-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
    }
    .track-result-info-left .track-result-status-desc {
        font-size: 12px;
    }
    .track-result-info-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        margin-top: 12px;
    }
    .track-result-info-right .track-result-mode,
    .track-result-info-right .track-result-progress {
        font-size: 13px;
    }
    .track-result-info-right .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 575px) {
    .track-result-container {
        padding: 0 16px;
    }
    .track-result-tracking-number {
        font-size: 18px;
    }
    .track-result-map {
        height: 300px;
    }
    .track-result-map-overlay {
        position: static;
        display: block;
        padding: 12px 16px;
    }
    .track-result-map-info {
        min-width: auto;
        border-radius: 0;
    }
    .track-info-toggle {
        display: block !important;
    }
    .track-result-map-overlay.collapsed .track-info-content {
        display: none;
    }
    .track-result-timeline {
        padding: 24px 16px 24px 40px;
    }
    .track-result-timeline::before {
        left: 16px;
    }
    .track-result-timeline-dot {
        left: -32px;
    }
}
