/* SMART WAY MARINE CARGO LLC - public tracking page */
body{display:flex;flex-direction:column;min-height:100vh}
.announcement-bar{background:var(--brand-black);color:#fff;text-align:center;padding:.6rem 1rem;font-size:.85rem;font-weight:500}
.announcement-bar a{color:var(--brand-blue);text-decoration:underline}

.public-header{background:#fff;border-bottom:1px solid var(--border-gray);padding:1rem 1.5rem;
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem}
.public-header .logo-wrap{padding:0}
.public-header .logo-wrap img{max-height:64px}

/* Language toggle */
.lang-toggle{display:inline-flex;align-items:center;background:#E2E8F0;border-radius:2rem;padding:.3rem;position:relative;cursor:pointer;box-shadow:inset 0 2px 4px rgba(0,0,0,.05);-webkit-tap-highlight-color:transparent}
.lang-option{position:relative;z-index:2;padding:.45rem .9rem;font-size:.8rem;font-weight:700;color:#64748B;transition:color .3s}
.lang-option.active{color:var(--brand-blue)}
.lang-slider{position:absolute;top:.3rem;bottom:.3rem;left:.3rem;width:calc(50% - .3rem);background:#fff;border-radius:1.5rem;box-shadow:0 2px 5px rgba(0,0,0,.1);transition:transform .3s cubic-bezier(.4,0,.2,1);z-index:1}
.lang-toggle[data-lang="zh"] .lang-slider{transform:translateX(100%)}

.public-main{flex:1;width:100%;max-width:880px;margin:0 auto;padding:2rem 1.25rem 3rem}

.search-card{background:#fff;border:1px solid var(--border-gray);border-radius:var(--radius-lg);
  padding:2rem;box-shadow:var(--shadow-md);margin-bottom:1.5rem}
.search-card h1{font-size:1.6rem;margin-bottom:.4rem}
.search-card .lead{color:var(--text-muted);font-size:.95rem;margin-bottom:1.25rem}
.search-form{display:flex;gap:.75rem}
.search-form .input{padding:1.05rem 1.25rem;font-size:1.05rem;background:#F8FAFC}
.search-form .input:focus{background:#fff}
.search-form .btn-primary{padding:0 2.25rem;font-size:1rem}
@media(max-width:640px){.search-form{flex-direction:column}.search-form .btn-primary{padding:1rem;justify-content:center}}

.captcha-row{margin-top:1rem;display:flex;justify-content:flex-start}

/* Result panel */
.result-panel{background:#fff;border:1px solid var(--border-gray);border-radius:var(--radius-lg);
  box-shadow:var(--shadow-md);overflow:hidden;margin-bottom:1.5rem;animation:fadeIn .3s ease-out}
@keyframes fadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.result-header{padding:1.5rem 1.75rem 1rem;border-bottom:1px solid var(--border-gray);
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem}
.result-title{font-size:1.25rem;font-weight:700;color:var(--brand-black)}
.result-title small{display:block;color:var(--text-muted);font-size:.75rem;font-weight:500;margin-top:.15rem;letter-spacing:.05em;text-transform:uppercase}
.result-body{padding:1.5rem 1.75rem}

.kv-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem;margin-bottom:1.25rem}
.kv-item{background:var(--surface-gray);border:1px solid var(--border-gray);border-radius:.75rem;padding:1rem 1.1rem}
.kv-label{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);font-weight:600;margin-bottom:.3rem}
.kv-value{font-size:1.05rem;font-weight:600;color:var(--brand-black);word-break:break-word}
.kv-remarks{margin-top:.4rem;padding-top:.4rem;border-top:1px dashed var(--border-gray);font-size:.78rem;color:var(--text-muted);font-weight:400;line-height:1.45;white-space:pre-wrap}

.parent-child-panel{background:#EFF6FF;border:1px solid #bfdbfe;border-radius:.75rem;padding:1rem 1.25rem;margin-bottom:1.25rem}
.parent-child-panel h4{font-family:'Poppins';font-weight:700;font-size:.85rem;color:#1e40af;margin-bottom:.5rem;text-transform:uppercase;letter-spacing:.05em}
.parent-child-panel .pc-row{margin-bottom:.4rem;font-size:.92rem}
.parent-child-panel .pc-row strong{color:var(--brand-black);font-weight:700}
.parent-child-panel .child-mark{display:inline-block;background:#fff;border:1px solid #bfdbfe;border-radius:.4rem;padding:.15rem .55rem;margin:.15rem .25rem .15rem 0;font-size:.85rem;font-weight:600;color:var(--brand-blue)}
.parent-child-panel .pc-explainer{margin-top:.75rem;font-size:.82rem;color:#475569;line-height:1.55}

.qr-card{display:flex;gap:1.25rem;align-items:center;background:var(--surface-gray);border:1px solid var(--border-gray);border-radius:.75rem;padding:1rem 1.25rem;margin-top:1.25rem}
.qr-card img{background:#fff;padding:.4rem;border-radius:.5rem;border:1px solid var(--border-gray)}
.qr-card .qr-text{flex:1}
.qr-card h5{font-size:.95rem;font-weight:700;color:var(--brand-black);margin-bottom:.25rem;font-family:'Poppins'}
.qr-card p{font-size:.8rem;color:var(--text-muted)}

.empty-state{text-align:center;padding:3rem 1rem;color:var(--text-muted)}
.empty-state svg{margin-bottom:1rem;color:var(--border-gray)}

.public-footer{background:#000;color:#cbd5e1;padding:2rem 1.5rem 1.5rem;font-size:.85rem;margin-top:auto}
.public-footer .container{max-width:880px;margin:0 auto}
.public-footer a{color:#cbd5e1}
.public-footer a:hover{color:#fff}
.footer-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1.5rem;padding-bottom:1.25rem;border-bottom:1px solid #1e293b;margin-bottom:1.25rem}
.footer-bottom{display:flex;justify-content:space-between;flex-wrap:wrap;gap:.5rem;color:#64748B;font-size:.8rem}
.footer-ship-icon{opacity:.6;margin-bottom:.5rem}

.pwa-banner{position:fixed;bottom:1rem;left:50%;transform:translateX(-50%);background:#fff;border:1px solid var(--border-gray);
  border-radius:.75rem;padding:.75rem 1rem;box-shadow:0 10px 30px rgba(0,0,0,.15);display:none;align-items:center;gap:1rem;z-index:50;max-width:92vw}
.pwa-banner.show{display:flex}
.pwa-banner .btn{padding:.45rem .9rem;font-size:.85rem}


/* ===================================================================
   Tracking journey (full status progression with current/done/pending)
   =================================================================== */
.journey-card{background:#fff;border:1px solid var(--border-gray);border-radius:var(--radius-lg);
  box-shadow:var(--shadow-md);padding:1.5rem 1.75rem;margin-bottom:1.5rem;animation:fadeIn .35s ease-out}
.journey-card h3{font-size:1.05rem;font-weight:700;font-family:'Poppins';color:var(--brand-black);margin-bottom:1.25rem}

.journey-steps{position:relative;display:grid;grid-template-columns:repeat(var(--steps,5),1fr);gap:0;align-items:flex-start}
.journey-steps::before{content:'';position:absolute;top:18px;left:8%;right:8%;height:3px;background:var(--border-gray);z-index:0;border-radius:99px}
.journey-steps .progress-fill{position:absolute;top:18px;left:8%;height:3px;background:linear-gradient(90deg,#16A34A,#3E87FB);
  z-index:1;border-radius:99px;width:0;transition:width 1.2s cubic-bezier(.4,0,.2,1)}

.journey-step{position:relative;z-index:2;text-align:center;display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:0 .25rem}
.journey-step .dot{width:36px;height:36px;border-radius:50%;background:#fff;border:3px solid var(--border-gray);
  display:flex;align-items:center;justify-content:center;font-size:.9rem;color:var(--text-muted);transition:all .35s;flex-shrink:0}
.journey-step .label{font-size:.75rem;font-weight:600;color:var(--text-muted);line-height:1.25;text-transform:uppercase;letter-spacing:.02em}
.journey-step .when{font-size:.68rem;color:var(--text-muted);font-weight:500}

.journey-step.completed .dot{background:#16A34A;border-color:#16A34A;color:#fff}
.journey-step.completed .dot::before{content:'\F26A';font-family:'bootstrap-icons'}
.journey-step.completed .label{color:#15803D}

.journey-step.current .dot{background:var(--brand-blue);border-color:var(--brand-blue);color:#fff;
  animation:pulseRing 1.6s infinite;width:42px;height:42px;font-size:1rem}
.journey-step.current .label{color:var(--brand-blue);font-weight:700}

.journey-step.pending .dot{opacity:.6}

@keyframes pulseRing{
  0%   { box-shadow: 0 0 0 0 rgba(62,135,251,.5); }
  70%  { box-shadow: 0 0 0 14px rgba(62,135,251,0); }
  100% { box-shadow: 0 0 0 0 rgba(62,135,251,0); }
}

@media (max-width: 720px){
  .journey-steps{grid-template-columns:1fr;gap:.85rem}
  .journey-steps::before, .journey-steps .progress-fill{display:none}
  .journey-step{flex-direction:row;text-align:left;justify-content:flex-start;gap:.85rem;
    padding:.5rem .75rem;background:#F8FAFC;border-radius:.5rem}
  .journey-step .dot{width:30px;height:30px}
  .journey-step.current .dot{width:32px;height:32px}
}

/* History panel */
.history-list{list-style:none;margin:1rem 0 0;padding:0;border-top:1px dashed var(--border-gray);padding-top:1rem}
.history-list li{display:flex;gap:.85rem;padding:.6rem 0;border-bottom:1px dashed var(--border-gray)}
.history-list li:last-child{border-bottom:0}
.history-list .h-dot{width:10px;height:10px;border-radius:50%;background:#16A34A;flex-shrink:0;margin-top:.5rem}
.history-list .h-body{flex:1}
.history-list .h-title{font-size:.92rem;font-weight:600;color:var(--brand-black);margin:0}
.history-list .h-meta{font-size:.78rem;color:var(--text-muted);margin-top:.1rem}
.history-list .h-remarks{margin-top:.3rem;padding:.4rem .75rem;background:#F8FAFC;border-left:3px solid var(--brand-blue);border-radius:0 .35rem .35rem 0;font-size:.82rem;color:var(--text-main)}

/* External provider events panel */
.ext-events{margin-top:1.25rem;border-top:1px dashed var(--border-gray);padding-top:1.25rem}
.ext-events h4{font-size:.95rem;font-weight:700;color:var(--brand-black);margin-bottom:.85rem;display:flex;align-items:center;gap:.5rem}
.ext-events .badge{font-size:.65rem}

/* ===================================================================
   Simplified public footer (only WhatsApp + social links)
   =================================================================== */
.public-footer-min{background:#000;color:#cbd5e1;padding:1.5rem 1.5rem 1.25rem;text-align:center;margin-top:auto}
.public-footer-min .social-row{display:flex;justify-content:center;align-items:center;gap:.85rem;flex-wrap:wrap;margin-bottom:.85rem}
.public-footer-min .social-icon{width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.06);
  display:inline-flex;align-items:center;justify-content:center;color:#cbd5e1;font-size:1.05rem;transition:all .25s;border:1px solid rgba(255,255,255,.08)}
.public-footer-min .social-icon:hover{background:var(--brand-blue);color:#fff;transform:translateY(-2px);text-decoration:none}
.public-footer-min .social-icon.whatsapp:hover{background:#25D366}
.public-footer-min .copyright{font-size:.78rem;color:#64748B}


/* ===================================================================
   Public mobile responsiveness — keep logo + language toggle on one line
   =================================================================== */
@media (max-width: 640px) {
  .public-header{
    padding: .65rem .85rem;
    flex-wrap: nowrap;          /* prevent wrapping to a second row */
    gap: .5rem;
    align-items: center;
  }
  .public-header .logo-wrap{ flex-shrink: 1; min-width: 0; }
  .public-header .logo-wrap img{ max-height: 38px !important; max-width: 60vw; object-fit: contain }

  .lang-toggle{ padding: .22rem; flex-shrink: 0 }
  .lang-option{ padding: .35rem .6rem; font-size: .72rem }

  .announcement-bar{ font-size: .78rem; padding: .45rem .8rem }

  .public-main{ padding: 1.25rem .85rem 2rem }
  .search-card{ padding: 1.25rem 1rem }
  .search-card h1{ font-size: 1.25rem }
  .search-card .lead{ font-size: .88rem }
  .search-form .input{ padding: .9rem 1rem; font-size: 1rem }
  .search-form .btn-primary{ padding: .9rem 1rem; font-size: .95rem }

  .result-header{ padding: 1rem 1.1rem }
  .result-title{ font-size: 1.05rem }
  .result-body{ padding: 1rem 1.1rem }
  .kv-grid{ grid-template-columns: 1fr; gap: .65rem }
  .kv-item{ padding: .8rem .9rem }

  .journey-card{ padding: 1rem 1.1rem }
  .journey-card h3{ font-size: .95rem; margin-bottom: .85rem }

  .qr-card{ flex-direction: column; text-align: center; padding: 1rem }
  .qr-card .qr-text h5{ margin-top: .5rem }

  .public-footer-min{ padding: 1.25rem 1rem 1rem }
  .public-footer-min .social-icon{ width: 38px; height: 38px; font-size: .95rem }
}

@media (max-width: 380px) {
  .public-header .logo-wrap img{ max-height: 32px !important }
  .lang-option{ padding: .3rem .5rem; font-size: .68rem }
}
