/* ============================================================
   Delhivery B2C Pro – Tracking Widget  (v2 redesign)
   ============================================================ */

.dbf2c-track-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    max-width: 640px;
    margin: 0 auto 2rem;
}

/* Search Form */
.dbf2c-track-form { margin-bottom: 16px; }
.dbf2c-track-title {
    font-size: 1rem; font-weight: 700; color: #d7282f;
    margin: 0 0 10px;
}
.dbf2c-track-inputs { display: flex; gap: 8px; }
.dbf2c-track-input {
    flex: 1; padding: 9px 13px;
    border: 1.5px solid #dde6f0; border-radius: 8px;
    font-size: 14px; background: #fff;
    transition: border-color .2s;
}
.dbf2c-track-input:focus { outline: none; border-color: #d7282f; }
.dbf2c-track-btn {
    background: #d7282f; color: #fff; border: none;
    border-radius: 8px; padding: 9px 20px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    white-space: nowrap; transition: opacity .15s;
}
.dbf2c-track-btn:hover { opacity: .88; }

/* Error / Loading */
.dbf2c-track-error {
    background: #fff0f0; border: 1px solid #f5c2c2;
    color: #c0392b; border-radius: 8px; padding: 10px 14px;
    font-size: 13px; margin-bottom: 10px;
}
.dbf2c-track-loading {
    display: flex; align-items: center; gap: 10px;
    color: #666; font-size: 13px; padding: 16px 0;
}
.dbf2c-track-spinner {
    width: 22px; height: 22px; border: 3px solid #f0f0f0;
    border-top-color: #d7282f; border-radius: 50%;
    animation: dbf2c-spin .7s linear infinite; flex-shrink: 0;
}
@keyframes dbf2c-spin { to { transform: rotate(360deg); } }

/* Result Card */
.dbf2c-track-result {
    background: #fff;
    border: 1px solid #e4eaf3;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,.06);
}

/* Status Header */
.dbf2c-track-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2c2c54 100%);
    color: #fff;
    display: flex; align-items: center; gap: 14px;
}
.dbf2c-track-status-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.dbf2c-track-status-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dbf2c-track-awb-num {
    font-size: 10px; color: rgba(255,255,255,.5);
    font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
}
.dbf2c-track-status-label { font-size: 1.1rem; font-weight: 800; color: #fff; }
.dbf2c-track-eta          { font-size: 11px; color: rgba(255,255,255,.6); margin-top: 1px; }

/* Progress Steps */
.dbf2c-track-progress {
    padding: 16px 20px 14px;
    background: #f8fafd;
    border-bottom: 1px solid #e4eaf3;
}
.dbf2c-progress-steps {
    display: flex; align-items: flex-start;
    justify-content: space-between;
}
.dbf2c-step {
    display: flex; flex-direction: column;
    align-items: center; gap: 5px; flex: 1;
    position: relative; z-index: 1;
}
.dbf2c-step-dot {
    width: 22px; height: 22px; border-radius: 50%;
    background: #e4eaf3; border: 2.5px solid #e4eaf3;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: transparent;
    transition: all .25s; flex-shrink: 0;
}
.dbf2c-step.done .dbf2c-step-dot {
    background: #27ae60; border-color: #27ae60; color: #fff;
}
.dbf2c-step.done .dbf2c-step-dot::after { content: '\2713'; font-weight: 900; }
.dbf2c-step.active .dbf2c-step-dot {
    background: #d7282f; border-color: #d7282f;
    box-shadow: 0 0 0 4px rgba(215,40,47,.18);
}
.dbf2c-step.active .dbf2c-step-dot::after { content: '\25CF'; color: #fff; font-size: 8px; }
.dbf2c-step span {
    font-size: 10px; font-weight: 600;
    text-align: center; color: #b0bbc8;
    max-width: 58px; line-height: 1.2;
    transition: color .25s;
}
.dbf2c-step.done   span { color: #27ae60; }
.dbf2c-step.active span { color: #d7282f; font-weight: 800; }
.dbf2c-step-line {
    flex: 1; height: 2px; background: #e4eaf3;
    margin: 10px -2px 0; transition: background .25s; z-index: 0;
}
.dbf2c-step-line.done { background: #27ae60; }

/* Timeline */
.dbf2c-track-timeline { padding: 16px 20px 8px; }
.dbf2c-tl-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.dbf2c-tl-title {
    font-size: 11px; font-weight: 700; color: #8898aa;
    text-transform: uppercase; letter-spacing: .6px;
}
.dbf2c-tl-count {
    font-size: 10px; font-weight: 700; color: #8898aa;
    background: #f0f4fa; padding: 2px 8px; border-radius: 20px;
}

/* Timeline rows */
.dbf2c-tl-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 0 10px;
    padding-bottom: 10px;
}
.dbf2c-tl-item:last-child { padding-bottom: 0; }
.dbf2c-tl-item.dbf2c-hidden { display: none; }

.dbf2c-tl-icon-col {
    display: flex; flex-direction: column; align-items: center;
}
.dbf2c-tl-dot2 {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0;
    background: #f0f4fa; border: 1.5px solid #e4eaf3;
    z-index: 1;
}
.dbf2c-tl-item.dbf2c-tl-first .dbf2c-tl-dot2 {
    background: #fff0f0; border-color: #fbb;
}
.dbf2c-tl-line {
    flex: 1; width: 2px; background: #edf1f7;
    margin: 3px auto 0; min-height: 8px;
}
.dbf2c-tl-item:last-child .dbf2c-tl-line { display: none; }

.dbf2c-tl-body { padding: 2px 0 0; min-width: 0; }
.dbf2c-tl-row1 {
    display: flex; align-items: baseline;
    gap: 8px; flex-wrap: wrap; margin-bottom: 2px;
}
.dbf2c-tl-status2 {
    font-size: 13px; font-weight: 700; color: #1a1a2e;
    line-height: 1.3;
}
.dbf2c-tl-item.dbf2c-tl-first .dbf2c-tl-status2 { color: #d7282f; }
.dbf2c-tl-time2  { font-size: 11px; color: #9aa5b4; white-space: nowrap; }
.dbf2c-tl-loc2   { font-size: 11px; color: #6b7a8d; display: flex; align-items: center; gap: 3px; }

/* Show more toggle */
.dbf2c-tl-toggle {
    display: flex; align-items: center; gap: 6px;
    margin: 10px 0 14px 42px;
    background: none; border: 1px solid #e4eaf3;
    border-radius: 20px; padding: 5px 14px;
    font-size: 11px; font-weight: 700; color: #6b7a8d;
    cursor: pointer; transition: all .15s; letter-spacing: .2px;
}
.dbf2c-tl-toggle:hover { border-color: #d7282f; color: #d7282f; background: #fff8f8; }
.dbf2c-tl-arrow { transition: transform .2s; display: inline-block; }
.dbf2c-tl-toggle.open .dbf2c-tl-arrow { transform: rotate(180deg); }

/* Footer */
.dbf2c-track-footer {
    padding: 10px 20px 14px;
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid #f0f4fa;
}
.dbf2c-track-refresh-btn {
    background: none; border: none; color: #9aa5b4;
    font-size: 11px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: 4px; padding: 0;
    transition: color .15s;
}
.dbf2c-track-refresh-btn:hover { color: #d7282f; }
.dbf2c-track-last-updated { font-size: 11px; color: #b0bbc8; }

/* Responsive */
@media (max-width: 480px) {
    .dbf2c-track-header   { padding: 12px 14px; gap: 10px; }
    .dbf2c-track-progress { padding: 12px 14px; }
    .dbf2c-track-timeline { padding: 12px 14px 6px; }
    .dbf2c-track-footer   { padding: 8px 14px 12px; }
    .dbf2c-step span      { font-size: 9px; max-width: 44px; }
    .dbf2c-step-dot       { width: 18px; height: 18px; }
}
