/**
 * Cargo Foxes Advanced Tracking System — Public CSS
 * Brand: Primary #ff6b00 | Secondary #1e293b | Accent #0ea5e9
 */

:root {
    --cfx-primary: #ff6b00;
    --cfx-secondary: #1e293b;
    --cfx-accent: #0ea5e9;
    --cfx-success: #22c55e;
    --cfx-danger: #ef4444;
    --cfx-warning: #f59e0b;
    --cfx-bg: #f8fafc;
    --cfx-card-bg: #ffffff;
    --cfx-border: #e2e8f0;
    --cfx-text: #1e293b;
    --cfx-text-muted: #64748b;
    --cfx-radius: 12px;
    --cfx-shadow: 0 4px 24px rgba(0,0,0,0.08);
    --cfx-shadow-hover: 0 8px 32px rgba(0,0,0,0.12);
}

/* ===== WRAPPER ===== */
.cfx-tracking-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--cfx-text);
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 48px;
}

/* ===== HERO SEARCH ===== */
.cfx-tracking-hero {
    background: linear-gradient(135deg, var(--cfx-secondary) 0%, #0f172a 60%, #1e3a5f 100%);
    border-radius: var(--cfx-radius);
    padding: 40px 32px;
    margin: 24px 0 32px;
    position: relative;
    overflow: hidden;
}

.cfx-tracking-hero::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255,107,0,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.cfx-hero-inner {
    position: relative;
    z-index: 1;
}

.cfx-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.cfx-brand-icon {
    font-size: 42px;
    filter: drop-shadow(0 2px 8px rgba(255,107,0,0.4));
}

.cfx-brand h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 2px;
    letter-spacing: -0.3px;
}

.cfx-brand p {
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cfx-search-box {
    max-width: 720px;
}

.cfx-search-inner {
    display: flex;
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

#cfxTrackingInput {
    flex: 1;
    padding: 16px 20px;
    font-size: 16px;
    border: none;
    outline: none;
    background: #fff;
    color: var(--cfx-text);
    font-family: inherit;
    min-width: 0;
}

#cfxTrackingInput::placeholder {
    color: #94a3b8;
}

.cfx-track-btn {
    padding: 16px 28px;
    background: var(--cfx-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
}

.cfx-track-btn:hover { background: #e55e00; }
.cfx-track-btn:active { transform: scale(0.98); }
.cfx-track-btn:disabled { background: #94a3b8; cursor: not-allowed; }

.cfx-error-msg {
    color: #fca5a5;
    font-size: 14px;
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(239,68,68,0.15);
    border-radius: 6px;
    border-left: 3px solid #ef4444;
}

/* ===== STATUS BANNER ===== */
.cfx-status-banner {
    background: var(--cfx-card-bg);
    border-radius: var(--cfx-radius);
    box-shadow: var(--cfx-shadow);
    padding: 24px 28px;
    margin-bottom: 24px;
    border-left: 5px solid var(--cfx-primary);
    transition: border-color 0.3s;
}

.cfx-status-banner-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.cfx-status-icon {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.1));
}

.cfx-status-info { flex: 1; min-width: 180px; }

.cfx-tracking-num-display {
    font-size: 13px;
    color: var(--cfx-text-muted);
    font-family: monospace;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.cfx-status-label {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

.cfx-status-location {
    color: var(--cfx-text-muted);
    font-size: 14px;
}

.cfx-status-meta { text-align: right; }

.cfx-eta {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.cfx-carrier {
    color: var(--cfx-text-muted);
    font-size: 13px;
}

/* Progress Bar */
.cfx-progress-wrap { }

.cfx-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 16px;
}

.cfx-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cfx-primary), var(--cfx-accent));
    border-radius: 99px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.cfx-progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    overflow-x: auto;
}

.cfx-step {
    flex: 1;
    text-align: center;
    min-width: 60px;
}

.cfx-step-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    font-size: 13px;
    line-height: 28px;
    margin: 0 auto 6px;
    transition: all 0.3s;
}

.cfx-step-done .cfx-step-dot {
    background: var(--cfx-success);
    color: #fff;
}

.cfx-step-active .cfx-step-dot {
    background: var(--cfx-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(255,107,0,0.2);
    animation: cfxPulseStep 1.5s infinite;
}

@keyframes cfxPulseStep {
    0%, 100% { box-shadow: 0 0 0 4px rgba(255,107,0,0.2); }
    50% { box-shadow: 0 0 0 8px rgba(255,107,0,0.1); }
}

.cfx-step-label {
    font-size: 11px;
    color: var(--cfx-text-muted);
    line-height: 1.3;
}

.cfx-step-done .cfx-step-label,
.cfx-step-active .cfx-step-label {
    color: var(--cfx-text);
    font-weight: 600;
}

/* ===== RESULTS GRID ===== */
.cfx-results-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .cfx-results-grid { grid-template-columns: 1fr; }
}

/* ===== CARDS ===== */
.cfx-card {
    background: var(--cfx-card-bg);
    border-radius: var(--cfx-radius);
    box-shadow: var(--cfx-shadow);
    overflow: hidden;
}

.cfx-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--cfx-border);
}

.cfx-panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--cfx-secondary);
}

/* ===== LIVE DOT ===== */
.cfx-live-dot {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--cfx-success);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cfx-pulse {
    width: 8px; height: 8px;
    background: var(--cfx-success);
    border-radius: 50%;
    display: inline-block;
    animation: cfxLivePulse 1.5s infinite;
}

@keyframes cfxLivePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.4); }
}

/* ===== MAP ===== */
#cfxTrackingMap {
    height: 380px;
    width: 100%;
}

.cfx-map-legend {
    display: flex;
    gap: 16px;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--cfx-text-muted);
    background: #f8fafc;
    border-top: 1px solid var(--cfx-border);
    flex-wrap: wrap;
}

/* Map vehicle icons */
.cfx-vehicle-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
    animation: cfxVehicleBob 3s ease-in-out infinite;
}

@keyframes cfxVehicleBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ===== INFO PANEL ===== */
.cfx-info-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cfx-details-card,
.cfx-timeline-card {
    padding: 0;
}

.cfx-details-card h3,
.cfx-timeline-card h3 {
    padding: 16px 20px 12px;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid var(--cfx-border);
    color: var(--cfx-secondary);
}

.cfx-details-grid {
    padding: 4px 0;
}

.cfx-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 9px 20px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}

.cfx-detail-row:last-child { border-bottom: none; }

.cfx-detail-label {
    color: var(--cfx-text-muted);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.cfx-detail-value {
    font-size: 13px;
    color: var(--cfx-text);
    text-align: right;
    word-break: break-word;
}

/* ===== TIMELINE ===== */
.cfx-timeline {
    padding: 16px 20px;
    max-height: 380px;
    overflow-y: auto;
}

.cfx-tl-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.cfx-tl-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: -10px;
    width: 2px;
    background: #e2e8f0;
}

.cfx-tl-dot {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    font-size: 14px;
    line-height: 30px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}

.cfx-tl-current .cfx-tl-dot {
    animation: cfxPulseStep 1.5s infinite;
}

.cfx-tl-body { flex: 1; }

.cfx-tl-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.cfx-tl-location {
    font-size: 12px;
    color: var(--cfx-text-muted);
}

.cfx-tl-comment {
    font-size: 12px;
    color: var(--cfx-text-muted);
    font-style: italic;
    margin-top: 2px;
}

.cfx-tl-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ===== EMPTY STATE ===== */
.cfx-empty-hero {
    text-align: center;
    padding: 60px 24px;
    background: var(--cfx-card-bg);
    border-radius: var(--cfx-radius);
    box-shadow: var(--cfx-shadow);
}

.cfx-empty-hero .cfx-empty-icon { font-size: 64px; margin-bottom: 16px; }
.cfx-empty-hero h3 { font-size: 22px; font-weight: 700; color: var(--cfx-secondary); margin: 0 0 10px; }
.cfx-empty-hero p { color: var(--cfx-text-muted); font-size: 15px; max-width: 480px; margin: 0 auto 20px; }

.cfx-sample-formats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--cfx-text-muted);
}

.cfx-sample-formats code {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    color: var(--cfx-primary);
    font-size: 13px;
}

/* ===== MY ACCOUNT ===== */
.cfx-myaccount-tracking {
    margin: 20px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--cfx-border);
}

.cfx-myaccount-tracking h3 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
}

.cfx-myaccount-shipment {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--cfx-border);
}

.cfx-myaccount-shipment:last-child { border-bottom: none; }
.cfx-myaccount-num { font-weight: 700; font-family: monospace; color: var(--cfx-primary); }

/* ===== STATUS BADGES ===== */
.cfx-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cfx-badge-order_received    { background: #f1f5f9; color: #64748b; }
.cfx-badge-processing         { background: #fef3c7; color: #d97706; }
.cfx-badge-package_accepted   { background: #dbeafe; color: #2563eb; }
.cfx-badge-departed_facility  { background: #ede9fe; color: #7c3aed; }
.cfx-badge-in_transit         { background: #fff7ed; color: #c2410c; }
.cfx-badge-customs_clearance  { background: #fce7f3; color: #be185d; }
.cfx-badge-flight_departed    { background: #e0f2fe; color: #0369a1; }
.cfx-badge-flight_arrived     { background: #cffafe; color: #0e7490; }
.cfx-badge-out_for_delivery   { background: #ffedd5; color: #c2410c; }
.cfx-badge-delivered          { background: #dcfce7; color: #16a34a; }
.cfx-badge-exception          { background: #fee2e2; color: #dc2626; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .cfx-tracking-hero { padding: 24px 16px; }
    .cfx-search-inner { flex-direction: column; border-radius: 10px; }
    #cfxTrackingInput, .cfx-track-btn { border-radius: 8px !important; }
    .cfx-track-btn { width: 100%; text-align: center; }
    .cfx-status-banner-inner { flex-direction: column; text-align: center; }
    .cfx-status-meta { text-align: center; }
    .cfx-progress-steps { display: none; }
    #cfxTrackingMap { height: 280px; }
}
