/* ============================================================
   Extreme Custom Tracking — Public Styles (Modern Redesign)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.ect-tracking-container * {
    box-sizing: border-box;
}

.ect-tracking-container {
    max-width: 860px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a2e;
    line-height: 1.5;
}

/* ── Search Card ── */
.ect-search-card {
    background: var(--ect-primary, #0073aa);
    background: linear-gradient(135deg, var(--ect-primary, #0073aa) 0%, #00000030 100%);
    border-radius: 16px;
    padding: 32px 36px;
    margin-bottom: 28px;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.ect-search-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.ect-search-icon {
    font-size: 36px;
    line-height: 1;
}

.ect-search-title {
    margin: 0;
    font-size: 1.6em;
    font-weight: 700;
    color: #fff;
    text-transform: none !important;
}

.ect-search-sub {
    margin: 4px 0 0 0;
    font-size: 0.95em;
    color: rgba(255,255,255,0.8);
}

/* ── Search Input Group ── */
.ect-input-group {
    display: flex;
    gap: 10px;
}

.ect-input-group input[type="text"] {
    flex-grow: 1;
    padding: 14px 18px;
    border: 2px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    color: #fff;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.ect-input-group input[type="text"]::placeholder { color: rgba(255,255,255,0.6); }

.ect-input-group input[type="text"]:focus {
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.22);
}

.ect-btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    background: #fff;
    color: var(--ect-primary, #0073aa);
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    text-transform: none !important;
}

.ect-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

/* ── Alerts ── */
.ect-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 500;
}

.ect-alert-error {
    background: #fff0f0;
    color: #c0392b;
    border: 1px solid #f5c6c6;
}

/* ── Sections (shared card) ── */
.ect-section {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8e8ee;
    margin-bottom: 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    overflow: hidden;
}

.ect-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a2e;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f5;
    background: #fafafa;
    text-transform: none !important;
}

.ect-section-title svg {
    opacity: 0.65;
    flex-shrink: 0;
}

/* ── Tracking Summary ── */
.ect-summary-section {
    border: none;
    position: relative;
    overflow: hidden;
}

/* Accent left border per colour */
.ect-summary-accent-blue   { border-left: 5px solid #0073aa; }
.ect-summary-accent-green  { border-left: 5px solid #1e8c36; }
.ect-summary-accent-orange { border-left: 5px solid #fd7e14; }
.ect-summary-accent-purple { border-left: 5px solid #8224e3; }
.ect-summary-accent-yellow { border-left: 5px solid #e8a31e; }
.ect-summary-accent-red    { border-left: 5px solid #d63638; }
.ect-summary-accent-gray   { border-left: 5px solid #aaa; }

.ect-summary-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px 28px 18px;
}

.ect-summary-status-pill {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ect-status-eyebrow {
    display: block;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #999;
    margin-bottom: 4px;
}

.ect-status-icon {
    font-size: 26px;
    line-height: 1;
}

.ect-tracking-num-chip {
    background: #f0f0f5;
    border: 1px solid #e0e0ea;
    color: #555;
    font-size: 0.85em;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 5px 14px;
    border-radius: 20px;
}

.ect-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-top: 1px solid #f0f0f5;
}

.ect-summary-cell {
    padding: 16px 28px;
    border-right: 1px solid #f0f0f5;
    text-align: center;
}

.ect-summary-cell:last-child { border-right: none; }

.ect-cell-label {
    display: block;
    font-size: 0.76em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #888;
    margin-bottom: 4px;
}

.ect-cell-value {
    display: block;
    font-size: 1em;
    font-weight: 600;
    color: #1a1a2e;
}

.ect-current-location-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    background: #f5f9fd;
    border-top: 1px solid #e8edf2;
    font-size: 0.9em;
    color: var(--ect-primary, #0073aa);
    font-weight: 500;
}

.ect-current-location-bar strong {
    color: #555;
    font-weight: 700;
    margin-right: 4px;
}

.ect-current-location-bar svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ── Progress Bar ── */
.ect-progress-section {
    padding: 30px 20px 15px;
    border: none;
}

.ect-progress-bar-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 100%;
}

.ect-progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.ect-progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 8px;
    background-color: var(--line-color, #e1e5e9);
    
    /* Blended Indeterminate Stripes & Shimmer */
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255,255,255, 0.15) 0px,
        rgba(255,255,255, 0.15) 8px,
        rgba(255,255,255, 0) 8px,
        rgba(255,255,255, 0) 16px
    ),
    linear-gradient(
        90deg,
        rgba(255,255,255, 0) 0%,
        rgba(255,255,255, 0.6) 50%,
        rgba(255,255,255, 0) 100%
    );
    background-size: 24px 24px, 200% 100%;
    animation: ect-bar-flow 3s infinite linear;
    
    z-index: -1;
    transition: background-color 0.4s ease;
}

@keyframes ect-bar-flow {
    0% { background-position: 0 0, 200% 0; }
    100% { background-position: 24px 0, -200% 0; }
}

.ect-progress-icon-wrap {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    padding: 0 10px;
}

.ect-progress-icon {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--step-color, #a0aab8);
    background-color: #fff;
    color: var(--step-color, #a0aab8);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: all 0.4s ease;
    z-index: 1;
}

.ect-stage-current .ect-progress-icon {
    background-color: var(--step-color, #0073aa);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.ect-stage-current .ect-progress-icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background-color: inherit;
    z-index: -1;
    animation: ect-pulse 2s infinite;
}

.ect-stage-completed .ect-progress-icon {
    background-color: var(--step-color, green);
    color: #fff;
}

.ect-progress-label {
    margin-top: 14px;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--step-color, #a0aab8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.4s ease;
}

.ect-stage-current .ect-progress-label {
    font-weight: 700;
}

/* ── Badges ── */
.ect-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ect-badge-gray   { background: #e8e8e8; color: #555; }
.ect-badge-yellow { background: #fef9ec; color: #9c6c04; border: 1px solid #f5e0a0; }
.ect-badge-blue   { background: #e5f4fb; color: #0073aa; border: 1px solid #b3d9f0; }
.ect-badge-orange { background: #fff3e5; color: #d56e0c; border: 1px solid #ffd9a8; }
.ect-badge-purple { background: #f3ecfb; color: #8224e3; border: 1px solid #d4aeee; }
.ect-badge-green  { background: #eaf8ee; color: #1e8c36; border: 1px solid #a8ddb5; }
.ect-badge-red    { background: #fff0f0; color: #d63638; border: 1px solid #f5b5b5; }

/* ── Shipment Details Two-Col ── */
.ect-details-section .ect-section-title { margin-bottom: 0; }

.ect-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.ect-info-card {
    padding: 0;
}

.ect-info-card:first-child {
    border-right: 1px solid #f0f0f5;
}

.ect-info-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #666;
    padding: 14px 22px;
    background: #f9f9fb;
    border-bottom: 1px solid #f0f0f5;
}

.ect-info-card-header svg { opacity: 0.5; flex-shrink: 0; }

.ect-info-card-body {
    padding: 16px 22px;
}

.ect-info-row {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f8;
    align-items: baseline;
}

.ect-info-row:last-child { border-bottom: none; }

.ect-info-label {
    font-size: 0.82em;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    min-width: 65px;
    flex-shrink: 0;
}

.ect-info-val {
    font-size: 0.93em;
    font-weight: 500;
    color: #2d2d3a;
}

.ect-empty-msg {
    color: #bbb;
    font-size: 0.9em;
    font-style: italic;
    margin: 8px 0 0;
}

/* ── Map ── */
.ect-map-section > .ect-section-title { margin-bottom: 0; }

#ect-tracking-map {
    height: 360px;
    width: 100%;
    border-radius: 0 0 14px 14px;
    z-index: 1;
    display: block;
}

/* ── Timeline ── */
.ect-timeline-section > .ect-section-title { margin-bottom: 0; }

.ect-timeline {
    list-style: none;
    padding: 20px 24px;
    margin: 0;
    position: relative;
}

.ect-timeline::before {
    content: '';
    position: absolute;
    top: 28px;
    bottom: 28px;
    left: 35px;
    width: 2px;
    background: linear-gradient(to bottom, #e0e0e0, transparent);
}

.ect-timeline-item {
    position: relative;
    padding-left: 44px;
    margin-bottom: 18px;
}

.ect-timeline-item:last-child { margin-bottom: 0; }

.ect-timeline-dot {
    position: absolute;
    left: 5px;
    top: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #e0e0e0;
    z-index: 2;
}

.ect-timeline-item--latest .ect-timeline-dot {
    box-shadow: 0 0 0 2px currentColor;
}

@keyframes ect-pulse {
    0%   { transform: scale(1); opacity: 0.6; }
    70%  { transform: scale(2); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.ect-dot-pulse {
    display: block;
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: inherit;
    animation: ect-pulse 2s infinite;
}

.ect-timeline-card {
    background: #fff;
    border: 1px solid #eeeef4;
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}

.ect-timeline-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.ect-timeline-item--latest .ect-timeline-card {
    border-color: #dde8f0;
    background: #f7fbfe;
}

.ect-timeline-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.ect-timeline-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82em;
    color: #aaa;
    font-weight: 500;
}

.ect-timeline-date svg { opacity: 0.6; flex-shrink: 0; }

.ect-timeline-note {
    margin: 10px 0 0;
    font-size: 0.9em;
    color: #555;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}

/* Timeline bg/text colours */
.ect-bg-gray   { background-color: #aaa; }
.ect-bg-yellow { background-color: #e8a31e; }
.ect-bg-blue   { background-color: #0073aa; }
.ect-bg-orange { background-color: #fd7e14; }
.ect-bg-purple { background-color: #8224e3; }
.ect-bg-green  { background-color: #1e8c36; }
.ect-bg-red    { background-color: #d63638; }

/* ── Responsive ── */
@media (max-width: 720px) {
    .ect-search-card { padding: 24px 20px; }
    .ect-summary-grid { grid-template-columns: 1fr; }
    .ect-summary-cell { border-right: none; border-bottom: 1px solid #f0f0f5; }
    .ect-two-col { grid-template-columns: 1fr; }
    .ect-info-card:first-child { border-right: none; border-bottom: 1px solid #f0f0f5; }
}

@media (max-width: 500px) {
    .ect-input-group { flex-direction: column; }
    .ect-btn-primary { justify-content: center; }
    .ect-search-title { font-size: 1.3em; }
    .ect-timeline::before { display: none; }
    
    .ect-progress-label { font-size: 0.65em; letter-spacing: 0; }
    .ect-progress-icon { width: 30px; height: 30px; font-size: 13px; }
    .ect-progress-step:not(:last-child)::after { top: 11px; }
    .ect-progress-section { padding: 25px 5px 10px; }
    .ect-progress-icon-wrap { padding: 0 6px; }
}
