* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
}

.tracking-main {
    padding: 20px 0;
}

.tracking-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Card */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* Status Banner */
.status-banner {
    padding: 25px;
    text-align: center;
    color: white;
}

.status-banner.in_transit {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.status-banner.delivered {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.status-banner.failed {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
}

.status-banner.pending {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.status-banner.processing {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
}

.status-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.status-text {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.status-subtext {
    opacity: 0.9;
    font-size: 14px;
}

/* ETA Box */
.eta-box {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    display: inline-block;
}

.eta-label {
    font-size: 12px;
    opacity: 0.9;
}

.eta-value {
    font-size: 28px;
    font-weight: bold;
}

/* Content */
.content {
    padding: 25px;
}

/* Progress Timeline */
.progress-timeline {
    position: relative;
    margin: 20px 0;
}

.progress-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
}

.progress-step:last-child {
    margin-bottom: 0;
}

.progress-step::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 30px;
    bottom: -20px;
    width: 2px;
    background: var(--border-color);
}

.progress-step:last-child::before {
    display: none;
}

.progress-step.completed::before {
    background: #48bb78;
}

.step-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-subtle-2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    z-index: 1;
}

.progress-step.completed .step-icon {
    background: #48bb78;
    color: white;
}

.progress-step.current .step-icon {
    background: #c44569;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.step-content {
    flex: 1;
}

.step-label {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}

.step-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Info Sections */
.info-section {
    background: var(--bg-subtle);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.info-section-title {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    color: var(--text-muted);
    font-size: 14px;
}

.info-value {
    font-weight: 500;
    color: var(--text-main);
}

/* Courier Card */
.courier-card {
    display: flex;
    align-items: center;
    background: var(--bg-success);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.courier-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #48bb78;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    margin-right: 15px;
}

.courier-info {
    flex: 1;
}

.courier-name {
    font-weight: 600;
    color: var(--text-main);
}

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

/* Delivery Photo */
.delivery-photo {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.delivery-photo img {
    width: 100%;
    height: auto;
}

.delivery-photo-label {
    background: #48bb78;
    color: white;
    padding: 8px 15px;
    font-size: 12px;
    text-align: center;
}

/* Failed Reason */
.failed-reason {
    background: var(--bg-danger);
    border: 1px solid var(--danger);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.failed-reason-title {
    color: var(--danger-dark);
    font-weight: 600;
    margin-bottom: 5px;
}

.failed-reason-text {
    color: var(--text-main);
    font-size: 14px;
}

/* Card Footer (inside tracking card) */
.tracking-card-footer {
    text-align: center;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.tracking-footer-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.refresh-btn {
    background: var(--primary-dark);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    background: var(--primary);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error */
.tracking-error {
    text-align: center;
    padding: 60px 20px;
}

.tracking-error-icon {
    font-size: 60px;
    color: #f56565;
    margin-bottom: 20px;
}

.tracking-error-title {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 10px;
}

.tracking-error-text {
    color: var(--text-muted);
    font-size: 14px;
}

.tracking-error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

/* Auto refresh indicator */
.auto-refresh {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: var(--shadow-md);
    font-size: 12px;
    color: var(--text-muted);
    display: none;
    align-items: center;
    gap: 8px;
}

.auto-refresh.active {
    display: flex;
    color: #48bb78;
}

.auto-refresh i {
    animation: spin 2s linear infinite;
}

/* Last updated */
.last-updated {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    margin-top: 10px;
}
