/**
 * Dhondaley Shiprocket - Enterprise Fluid Responsive Tracking Styling
 * Designed for 100% theme-bindability with zero text or image overlap
 */

:root {
    --sr-primary: #0284c7;
    --sr-primary-hover: #0369a1;
    --sr-primary-light: #e0f2fe;
    --sr-success: #16a34a;
    --sr-success-light: #dcfce7;
    --sr-warning: #f59e0b;
    --sr-warning-light: #fef3c7;
    --sr-danger: #dc2626;
    --sr-danger-light: #fee2e2;
    --sr-card-bg: #ffffff;
    --sr-border: #e2e8f0;
    --sr-text-dark: #0f172a;
    --sr-text-muted: #64748b;
    --sr-radius: 10px;
    --sr-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
}

.sr-tracking-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    background: var(--sr-card-bg);
    border: 1px solid var(--sr-border);
    border-radius: var(--sr-radius);
    padding: clamp(14px, 3vw, 24px);
    box-shadow: var(--sr-shadow);
    font-family: inherit;
    margin-bottom: 25px;
    overflow: hidden;
}

/* HEADER INFO GRID */
.sr-tracking-header {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--sr-border);
    margin-bottom: 24px;
}

.sr-info-col {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sr-info-col .sr-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--sr-text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.sr-info-col .sr-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--sr-text-dark);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.sr-awb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sr-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 13px;
    opacity: 0.7;
    transition: opacity 0.2s;
    touch-action: manipulation;
}

.sr-copy-btn:hover {
    opacity: 1;
}

.sr-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    width: fit-content;
    white-space: nowrap;
}

.sr-badge-active {
    background: var(--sr-primary-light);
    color: var(--sr-primary-hover);
}

.sr-badge-success {
    background: var(--sr-success-light);
    color: var(--sr-success);
}

.sr-badge-danger {
    background: var(--sr-danger-light);
    color: var(--sr-danger);
}

/* STEPPER PROGRESS BAR - DESKTOP & TABLET */
.sr-stepper-wrapper {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin: 10px 0 20px 0;
    position: relative;
    width: 100%;
}

.sr-step {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
    flex: 0 1 auto;
    min-width: 60px;
}

.sr-step-icon {
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #cbd5e1;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sr-step-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    line-height: 1.25;
    max-width: 80px;
    word-break: normal;
    overflow-wrap: break-word;
}

.sr-step.completed .sr-step-icon {
    background: var(--sr-primary);
    border-color: var(--sr-primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.18);
}

.sr-step.completed .sr-step-label {
    color: var(--sr-text-dark);
    font-weight: 700;
}

.sr-step.active .sr-step-icon {
    background: var(--sr-primary);
    border-color: var(--sr-primary);
    color: #ffffff;
    animation: sr-pulse 1.8s infinite;
}

@keyframes sr-pulse {
    0% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(2, 132, 199, 0); }
    100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}

.sr-step-line {
    flex: 1 1 0%;
    height: 3px;
    background: #e2e8f0;
    margin: 0 -4px 24px;
    z-index: 1;
    transition: background-color 0.4s ease;
    min-width: 15px;
}

.sr-step-line.completed {
    background: var(--sr-primary);
}

/* ACTIVITY SCANS LIST */
.sr-history-wrapper {
    box-sizing: border-box;
    margin-top: 24px;
    border-top: 1px solid var(--sr-border);
    padding-top: 20px;
}

.sr-history-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--sr-text-dark);
    margin: 0 0 16px 0;
}

.sr-activity-list {
    box-sizing: border-box;
    position: relative;
    border-left: 2px solid #cbd5e1;
    margin-left: 10px;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sr-activity-item {
    box-sizing: border-box;
    position: relative;
    min-width: 0;
}

.sr-activity-marker {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sr-primary);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px var(--sr-primary);
}

.sr-activity-details {
    min-width: 0;
}

.sr-activity-date {
    font-size: 11px;
    color: var(--sr-text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.sr-activity-text {
    font-size: 13px;
    color: var(--sr-text-dark);
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.sr-activity-loc {
    font-size: 12px;
    color: var(--sr-text-muted);
    margin-top: 2px;
}

/* PUBLIC SEARCH TRACKING CARD */
.sr-search-card {
    box-sizing: border-box;
    max-width: 520px;
    width: 100%;
    margin: 30px auto;
    background: #ffffff;
    padding: clamp(16px, 4vw, 32px);
    border: 1px solid var(--sr-border);
    border-radius: var(--sr-radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.sr-search-title {
    font-size: clamp(18px, 3.5vw, 24px);
    font-weight: 800;
    color: var(--sr-text-dark);
    margin-bottom: 6px;
    text-align: center;
}

.sr-search-subtitle {
    font-size: 13px;
    color: var(--sr-text-muted);
    text-align: center;
    margin-bottom: 22px;
}

/* MOBILE RESPONSIVE ADAPTATION */
@media (max-width: 640px) {
    .sr-tracking-header {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .sr-stepper-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-bottom: 12px;
        scrollbar-width: thin;
    }

    .sr-step {
        flex: 0 0 auto;
        min-width: 68px;
    }

    .sr-step-line {
        flex: 0 0 25px;
        min-width: 25px;
    }

    .sr-step-label {
        font-size: 10px;
        max-width: 65px;
    }

    .sr-step-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

@media (max-width: 420px) {
    .sr-tracking-header {
        grid-template-columns: 1fr;
    }
}
