/* Real-time Tracking & Trace Fixes */

/* 1. Page Header Alignment */
.nxl-content {
    animation: fadeIn 0.4s ease-out;
}

.nxl-content .tw-mb-10 {
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .nxl-content .tw-mb-10 {
        padding: 0;
    }
}

/* 2. Enhanced Card Styles */
.card.tracking-card-shadow {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 0 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover.tracking-card-shadow {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.12), 0 0 20px rgba(0, 0, 0, 0.04);
}

/* 3. Input Field Enhancement */
.tracking-input-wrapper {
    position: relative;
    transition: all 0.2s ease;
}

.tracking-input-wrapper:focus-within {
    transform: scale(1.01);
}

.tracking-input {
    padding-left: 3rem !important; /* Space for icon */
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 2px solid #e2e8f0;
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

.tracking-input:focus {
    border-color: #3b82f6; /* Primary color */
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.tracking-input-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.tracking-input-wrapper:focus-within .tracking-input-icon {
    color: #3b82f6;
}

/* 4. Button Enhancement */
.btn-tracking-submit {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border: none;
    transition: all 0.3s ease;
}

.btn-tracking-submit:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
}

.btn-tracking-submit:active {
    transform: translateY(0);
}

/* 5. Timeline Fixes & Animation */
.tracking-timeline-wrapper {
    position: relative;
    padding-left: 1rem;
}

.timeline-line {
    position: absolute;
    left: 24px; /* Align with dots center */
    top: 24px; /* Start from first dot center */
    bottom: 40px; /* End at last dot center approx */
    width: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.timeline-item {
    position: relative;
    z-index: 1;
    margin-bottom: 2rem;
    opacity: 0;
    animation: slideInRight 0.4s ease-out forwards;
}

/* Stagger animation for timeline items */
.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

.timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #cbd5e1;
    position: absolute;
    left: 15px; /* (50px padding - 20px width)/2 */
    top: 24px; /* Align with card top/center */
    transform: translateX(-50%);
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-item.active .timeline-dot {
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    transform: translateX(-50%) scale(1.2);
}

.timeline-item.completed .timeline-dot {
    background: #2563eb;
    border-color: #2563eb;
}

.timeline-card {
    margin-left: 50px;
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.timeline-item:hover .timeline-card {
    border-color: #cbd5e1;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

/* 6. Status Badge Styles */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.in-transit {
    background-color: #eff6ff;
    color: #2563eb;
}

.status-badge.delivered {
    background-color: #f0fdf4;
    color: #16a34a;
}

.status-badge.pending {
    background-color: #fef2f2;
    color: #dc2626;
}

/* 7. Empty State Enhancement */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8fafc;
    border-radius: 1.5rem;
    border: 2px dashed #e2e8f0;
}

.empty-state-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
