/* ============================================================
   NinjaVan Tracker — Frontend Widget Styles  v1.1.0
   Light theme — all values explicit, no inherited dark colors
   ============================================================ */

/* --- Wrapper ----------------------------------------------- */
.nvt-wrap {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    max-width: 780px;
    margin: 0 auto 2rem;
    color: #1e293b;
    position: relative;
}

/* --- Header (stays red — NinjaVan brand) ------------------- */
.nvt-header {
    background: linear-gradient(135deg, #C8102E 0%, #8b0d1f 100%);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.nvt-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: rgba(255,255,255,0.15);
}

.nvt-logo { width: 48px; height: 48px; flex-shrink: 0; }
.nvt-logo svg { width: 100%; height: 100%; }
.nvt-header-text { flex: 1; }

.nvt-title {
    margin: 0 0 4px;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: #ffffff;
}

.nvt-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.80);
    font-style: italic;
}

/* --- Search area ------------------------------------------- */
.nvt-search-area {
    padding: 24px 28px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.nvt-input-group { display: flex; gap: 10px; }

.nvt-input {
    flex: 1;
    min-width: 0;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    color: #1e293b;
    font-family: inherit;
    font-size: 1rem;
    padding: 13px 18px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.nvt-input::placeholder { color: #94a3b8; }

.nvt-input:focus {
    border-color: #C8102E;
    box-shadow: 0 0 0 3px rgba(200,16,46,0.10);
    background: #ffffff;
}

.nvt-btn {
    background: linear-gradient(135deg, #C8102E 0%, #a00d24 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 13px 26px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: filter .15s, transform .1s;
}

.nvt-btn:hover:not(:disabled)  { filter: brightness(1.08); }
.nvt-btn:active:not(:disabled) { transform: scale(0.97); }
.nvt-btn:disabled              { opacity: 0.6; cursor: not-allowed; }

.nvt-btn-icon svg { width: 18px; height: 18px; transition: transform .2s; }
.nvt-btn:hover .nvt-btn-icon svg { transform: translateX(3px); }

.nvt-hint { margin: 8px 0 0; font-size: 0.75rem; color: #94a3b8; }

/* --- Result area ------------------------------------------- */
.nvt-result { background: #ffffff; padding: 0; }
.nvt-result:not(:empty) { padding: 22px 28px 28px; }

/* --- Messages ---------------------------------------------- */
.nvt-message {
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nvt-message.error { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; }
.nvt-message.info  { background: #f8fafc; border: 1px solid #e2e8f0;  color: #475569; }

/* --- Spinner ----------------------------------------------- */
.nvt-spinner-wrap { display: flex; align-items: center; gap: 12px; color: #64748b; font-size: 0.9rem; }

.nvt-spinner {
    width: 22px; height: 22px;
    border: 2.5px solid #e2e8f0;
    border-top-color: #C8102E;
    border-radius: 50%;
    animation: nvt-spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes nvt-spin { to { transform: rotate(360deg); } }

/* --- Summary card ------------------------------------------ */
.nvt-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
}

.nvt-summary-id {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 600;
    margin-bottom: 5px;
}

.nvt-summary-num {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-family: 'Courier New', monospace;
    color: #0f172a;
}

/* --- Status badge ------------------------------------------ */
.nvt-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    flex-shrink: 0;
}

.nvt-status-badge.delivered { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.nvt-status-badge.transit   { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.nvt-status-badge.pending   { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.nvt-status-badge.failed    { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.nvt-status-badge.default   { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.nvt-status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: nvt-pulse 2s ease-in-out infinite;
}

@keyframes nvt-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* --- Events header ----------------------------------------- */
.nvt-events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.nvt-events-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: #64748b;
    font-weight: 700;
}

.nvt-events-count {
    font-size: 0.75rem;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 2px 10px;
    border-radius: 100px;
}

/* --- Timeline ---------------------------------------------- */
.nvt-timeline { position: relative; padding-left: 28px; }

.nvt-timeline::before {
    content: '';
    position: absolute;
    left: 8px; top: 12px; bottom: 12px;
    width: 2px;
    background: linear-gradient(to bottom, #C8102E 0%, #e2e8f0 100%);
}

/* --- Single event ------------------------------------------ */
.nvt-event {
    position: relative;
    padding: 0 0 22px 22px;
    animation: nvt-fade-in .3s ease both;
}

.nvt-event:last-child { padding-bottom: 0; }

@keyframes nvt-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.nvt-event::before {
    content: '';
    position: absolute;
    left: -20px; top: 4px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    z-index: 1;
}

.nvt-event.first::before {
    background: #C8102E;
    border-color: #C8102E;
    box-shadow: 0 0 0 4px rgba(200,16,46,0.12);
}

.nvt-event-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
    line-height: 1.3;
}

.nvt-event.first .nvt-event-status { color: #C8102E; }

.nvt-event-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.nvt-event-time {
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nvt-event-time svg { width: 12px; height: 12px; }

.nvt-event-location {
    font-size: 0.75rem;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nvt-event-message { font-size: 0.78rem; color: #94a3b8; margin-top: 4px; font-style: italic; }

.nvt-no-events { text-align: center; padding: 32px; color: #94a3b8; font-size: 0.9rem; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 520px) {
    .nvt-header             { padding: 18px; }
    .nvt-search-area        { padding: 18px 18px 14px; }
    .nvt-result:not(:empty) { padding: 16px 18px 22px; }
    .nvt-input-group        { flex-direction: column; }
    .nvt-btn                { width: 100%; justify-content: center; }
    .nvt-title              { font-size: 1.15rem; }
    .nvt-summary            { grid-template-columns: 1fr; }
}
