/* ===== Uship Pet Transport Tracker — modern theme ===== */

.uctp-track-wrap, .uctp-dashboard-wrap {
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1d29;
    background: #F4F7FF;
    padding: 20px;
    border-radius: 20px;
}

.uctp-track-wrap *, .uctp-dashboard-wrap * { box-sizing: border-box; }

.uctp-track-wrap h1, .uctp-track-wrap h2, .uctp-track-wrap h3, .uctp-track-wrap h4,
.uctp-dashboard-wrap h1, .uctp-dashboard-wrap h2, .uctp-dashboard-wrap h3, .uctp-dashboard-wrap h4 {
    margin: 0 0 6px !important;
    line-height: 1.3 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}
.uctp-track-wrap h1, .uctp-dashboard-wrap h1 { font-size: 26px !important; }
.uctp-track-wrap h2, .uctp-dashboard-wrap h2 { font-size: 22px !important; }
.uctp-track-wrap h3, .uctp-dashboard-wrap h3 { font-size: 17px !important; }
.uctp-track-wrap h4, .uctp-dashboard-wrap h4 { font-size: 13px !important; }

/* Search form */
.uctp-track-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    background: #fff;
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 4px 16px rgba(16,24,40,0.06);
    border: 1px solid #eef0f4;
}

.uctp-track-form label {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 700;
    color: #1a1d29 !important;
    gap: 8px;
}

.uctp-track-form input {
    padding: 12px 14px;
    border: 1.5px solid #e3e6ed;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1d29 !important;
    background: #ffffff !important;
    transition: border-color 0.15s ease;
}
.uctp-track-form input::placeholder {
    color: #9aa0b4 !important;
    opacity: 1;
}
.uctp-track-form input:focus {
    outline: none;
    border-color: var(--uctp-primary);
}

.uctp-btn {
    background: linear-gradient(135deg, var(--uctp-primary), var(--uctp-primary-dark));
    color: #fff;
    border: none;
    padding: 13px 26px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(60,131,246,0.3);
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.uctp-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(60,131,246,0.4); }

.uctp-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Logo */
.uctp-logo-row { text-align: center; margin-bottom: 20px; }
.uctp-logo { max-height: 56px; }

/* Result container */
.uctp-result { max-width: 900px; margin: 0 auto; }

.uctp-header-bar {
    background: linear-gradient(135deg, var(--uctp-primary) 0%, var(--uctp-primary-dark) 100%);
    color: #fff;
    border-radius: 18px;
    padding: 20px 26px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(22,41,110,0.2);
    position: relative;
}
.uctp-header-label { font-size: 10.5px; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.uctp-header-bar h2 { margin: 4px 0 0 !important; font-size: 28px !important; font-weight: 800; color: #fff; letter-spacing: -0.01em; word-break: break-word; }
.uctp-barcode-wrap { margin-top: 10px; line-height: 0; }
.uctp-barcode { max-width: 220px; height: 36px; }
.uctp-verified {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255,255,255,0.18);
    padding: 4px 12px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 10px;
    backdrop-filter: blur(4px);
}
.uctp-header-status { text-align: right; }
.uctp-header-status .uctp-badge { margin-top: 6px; background: rgba(255,255,255,0.18); color: #fff; font-weight: 700; }
.uctp-header-updated { font-size: 10.5px; opacity: 0.75; margin-top: 6px; }

/* Card grids */
.uctp-info-grid, .uctp-parcel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.uctp-info-card {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.04);
    transition: box-shadow 0.15s ease;
}
.uctp-info-card:hover { box-shadow: 0 4px 16px rgba(16,24,40,0.08); }
.uctp-info-card h4 {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--uctp-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.uctp-info-card p { margin: 4px 0; font-size: 14px; color: #333747; line-height: 1.5; }

.uctp-progress-card, .uctp-history-card, .uctp-map-card {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}
.uctp-progress-card h3, .uctp-history-card h3, .uctp-map-card h3 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #1a1d29;
}

/* Progress bar */
.uctp-progress-bar {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 24px;
}
.uctp-progress-bar::before {
    content: "";
    position: absolute;
    top: 17px;
    left: 6%;
    right: 6%;
    height: 3px;
    background: #eef0f4;
    border-radius: 3px;
    z-index: 0;
}
.uctp-progress-step {
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: center;
    font-size: 12px;
}
.uctp-progress-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: #F4F7FF;
    font-size: 14px;
    border: 2px solid #eef0f4;
    filter: grayscale(1) opacity(0.5);
    transition: filter 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.uctp-progress-done .uctp-progress-icon {
    background: var(--uctp-primary);
    border-color: var(--uctp-primary);
    filter: grayscale(0);
}
.uctp-progress-active .uctp-progress-icon {
    background: #fff;
    border-color: var(--uctp-primary);
    filter: grayscale(0);
    animation: uctp-progress-pulse 1.8s infinite;
}
@keyframes uctp-progress-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(60,131,246,0.45); }
    70%  { box-shadow: 0 0 0 9px rgba(60,131,246,0); }
    100% { box-shadow: 0 0 0 0 rgba(60,131,246,0); }
}
.uctp-progress-active .uctp-progress-label {
    color: var(--uctp-primary);
}
.uctp-progress-active .uctp-progress-label::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    margin-left: 5px;
    vertical-align: middle;
    animation: uctp-pulse 1.8s infinite;
}
.uctp-progress-label { display: block; font-weight: 700; color: #1a1d29; font-size: 12.5px; }
.uctp-progress-date { display: block; color: #9aa0b4; font-size: 11px; margin-top: 2px; }

/* Two-column layout — map gets more width than history, same row height */
.uctp-two-col {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    align-items: stretch;
    gap: 18px;
}
.uctp-history-card, .uctp-map-card {
    display: flex;
    flex-direction: column;
}
@media (max-width: 700px) {
    .uctp-two-col { grid-template-columns: 1fr; }
}

/* Timeline */
.uctp-timeline {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    border-left: 2px solid #eef0f4;
}
.uctp-timeline li {
    position: relative;
    padding: 0 0 14px 18px;
}
.uctp-timeline li::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--uctp-primary);
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px #eef0f4;
}
.uctp-timeline-date { display: block; font-size: 12px; color: #9aa0b4; font-weight: 600; margin-bottom: 4px; }
.uctp-timeline-note { margin: 5px 0 0; font-size: 13px; color: #555b6e; line-height: 1.5; }

/* Badges */
.uctp-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: #F4F7FF;
    color: #4b5169;
}
.uctp-badge-delivered, .uctp-badge-delivered_to_receiver { background: #dcfce7; color: #15803d; }
.uctp-badge-delayed, .uctp-badge-customs_hold { background: #fef3c7; color: #92400e; }
.uctp-badge-in_transit, .uctp-badge-shipped, .uctp-badge-out_for_delivery { background: #dbeafe; color: #1d4ed8; }
.uctp-badge-order_received, .uctp-badge-processing, .uctp-badge-payment_confirmed { background: #ede9fe; color: #6d28d9; }
.uctp-badge-pending { background: #f1f5f9; color: #475569; }
.uctp-badge-insurance_hold, .uctp-badge-city_permit_hold { background: #fee2e2; color: #b91c1c; }

/* Map */
.uctp-map {
    width: 100%;
    height: 340px;
    flex: 1;
    min-height: 340px;
    border-radius: 12px;
    background: #F4F7FF;
    overflow: hidden;
}
.uctp-map-loading { text-align: center; padding: 40px 10px; color: #9aa0b4; font-size: 13px; }
.uctp-gmaps-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    color: var(--uctp-primary);
    text-decoration: none;
    font-weight: 700;
}
.uctp-gmaps-link:hover { text-decoration: underline; }

/* Actions */
.uctp-actions { margin-top: 8px; text-align: right; }
.uctp-btn-print {
    background: #fff;
    color: var(--uctp-primary);
    border: 1.5px solid var(--uctp-primary);
    box-shadow: none;
}
.uctp-btn-print:hover { background: #f5f7ff; box-shadow: none; }

/* Dashboard */
.uctp-dashboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #eef0f4;
}
.uctp-dashboard-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9aa0b4;
    background: #F4F7FF;
    font-weight: 700;
}
.uctp-dashboard-table td {
    text-align: left;
    padding: 14px 16px;
    border-top: 1px solid #eef0f4;
    font-size: 14px;
}

.uctp-login-notice {
    background: #F4F7FF;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #eef0f4;
}

@media print {
    .no-print { display: none !important; }
    .uctp-track-form { display: none !important; }
}

/* ===== Icons, live pulse, and layout refinements ===== */

.uctp-progress-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}
.uctp-progress-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.uctp-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    margin-right: 5px;
    box-shadow: 0 0 0 rgba(74,222,128,0.6);
    animation: uctp-pulse 1.8s infinite;
    vertical-align: middle;
}
@keyframes uctp-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.uctp-location-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.uctp-location-row svg {
    width: 12px;
    height: 12px;
    color: var(--uctp-primary);
    flex-shrink: 0;
}

.uctp-btn-print {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.uctp-btn-print svg {
    width: 12px;
    height: 12px;
}

/* Slightly tighter overall spacing for a cleaner fit */
.uctp-result > div { margin-bottom: 18px; }
.uctp-result > div:last-child { margin-bottom: 0; }

/* ===== Page header (breadcrumb + back button), matching reference ===== */
.uctp-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}
.uctp-page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px !important;
    font-weight: 800;
    color: #1a1d29;
}
.uctp-page-title svg { width: 17px; height: 17px; color: var(--uctp-primary); }
.uctp-breadcrumb { font-size: 13px; color: #9aa0b4; margin-top: 2px; }
.uctp-breadcrumb a { color: #9aa0b4; text-decoration: none; }
.uctp-breadcrumb a:hover { color: var(--uctp-primary); }

.uctp-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    text-decoration: none;
}
.uctp-btn-back svg { width: 13px; height: 13px; }

/* Card headings with leading icon, matching reference */
.uctp-info-card h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}
.uctp-info-card h4 svg { width: 13px; height: 13px; color: var(--uctp-primary); flex-shrink: 0; }

/* ===== Hard guard against theme SVG resets (e.g. "svg{max-width:100%;height:auto}") ===== */
.uctp-track-wrap svg.uctp-icon, .uctp-dashboard-wrap svg.uctp-icon {
    max-width: none;
}

/* ===== Live location pin (paw), pulsing to show it's actively tracking ===== */
.uctp-live-marker-wrap {
    background: transparent !important;
    border: none !important;
}
.uctp-live-marker {
    position: relative;
    color: var(--uctp-primary);
    filter: drop-shadow(0 3px 6px rgba(16,24,40,0.35));
}
.uctp-live-marker svg {
    position: relative;
    z-index: 2;
    display: block;
}
.uctp-live-marker-pulse {
    position: absolute;
    left: 50%;
    bottom: -3px;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    background: var(--uctp-primary);
    opacity: 0.55;
    z-index: 1;
    animation: uctp-map-pulse 1.8s ease-out infinite;
}
@keyframes uctp-map-pulse {
    0%   { transform: scale(0.5); opacity: 0.6; }
    70%  { transform: scale(2.6); opacity: 0; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* ===== Logo centered inside the tracking page header bar ===== */
.uctp-header-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.uctp-header-logo img {
    max-height: 46px;
    max-width: 130px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
@media (max-width: 640px) {
    .uctp-header-logo {
        position: static;
        transform: none;
        order: -1;
        width: 100%;
        margin-bottom: 6px;
    }
    .uctp-header-logo img {
        max-height: 38px;
    }
}

/* ===== Map location labels — small, readable, always visible, pointing to their pin ===== */
.uctp-map-label {
    background: #ffffff;
    border: 1.5px solid #c7cedb;
    border-radius: 5px;
    padding: 2px 7px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: #23283a;
    box-shadow: 0 2px 5px rgba(16,24,40,0.18);
    white-space: nowrap;
}
.leaflet-tooltip-top.uctp-map-label::before {
    border-top-color: #c7cedb !important;
    border-width: 5px 5px 0 !important;
    margin-bottom: -1px;
}
.leaflet-tooltip-top.uctp-map-label::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -3.5px;
    width: 0;
    height: 0;
    margin-left: -4px;
    border: 4px solid transparent;
    border-top-color: #ffffff;
    border-bottom: 0;
}
.uctp-map-label-live {
    color: #ffffff;
    background: var(--uctp-primary);
    border-color: var(--uctp-primary);
}
.uctp-map-label-live::after {
    border-top-color: var(--uctp-primary) !important;
}

/* Origin/Destination map labels — small color accent so they're distinct at a glance */
.uctp-map-label-origin { border-color: #22c55e !important; }
.uctp-map-label-origin::before { border-top-color: #22c55e !important; }
.uctp-map-label-dest { border-color: var(--uctp-primary) !important; }
.uctp-map-label-dest::before { border-top-color: var(--uctp-primary) !important; }
