/* =============================================
   ORDER TRACKING TIMELINE - AMAZON/FLIPKART STYLE
   Professional vertical timeline for order tracking
   ============================================= */

/* Tracking Modal Overlay */
.tracking-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.tracking-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Modal Content */
.tracking-modal-content {
    position: relative;
    z-index: 2;
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.tracking-modal-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(79, 70, 229, 0.02));
}

.tracking-modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tracking-modal-header h2::before {
    content: '📦';
    font-size: 1.5rem;
}

.modal-close-btn {
    background: var(--bg-tertiary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    font-size: 1.25rem;
}

.modal-close-btn:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

/* Modal Body */
.tracking-modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(85vh - 100px);
}

/* Order Info Card */
.tracking-order-info {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary);
}

.tracking-order-id {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.tracking-order-id strong {
    color: var(--primary-light);
    font-family: monospace;
    font-size: 1rem;
}

.tracking-product-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.tracking-product-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Vertical Timeline Container */
.tracking-timeline {
    position: relative;
    padding: 1rem 0;
}

/* Timeline Step */
.timeline-step {
    position: relative;
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    animation: stepFadeIn 0.4s ease-out;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-step:last-child {
    margin-bottom: 0;
}

/* Step Marker (Circle with Icon) */
.step-marker {
    position: relative;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 2;
    transition: all 0.3s ease;
}

/* Completed Step - GREEN */
.timeline-step.step-completed .step-marker {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Current Step - ORANGE/AMBER */
.timeline-step.step-current .step-marker {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.6), 0 0 0 8px rgba(245, 158, 11, 0.1);
    }
}

/* Upcoming Step - GREY */
.timeline-step.step-upcoming .step-marker {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 2px solid var(--border-color);
}

/* Vertical Connector Line */
.timeline-connector {
    position: absolute;
    left: 25px;
    top: 50px;
    bottom: -15px;
    width: 2px;
    z-index: 1;
}

.timeline-step.step-completed .timeline-connector {
    background: linear-gradient(to bottom, #10b981, #10b981);
}

.timeline-step.step-current .timeline-connector {
    background: linear-gradient(to bottom, #f59e0b, var(--border-color));
}

.timeline-step.step-upcoming .timeline-connector {
    background: var(--border-color);
}

.timeline-step:last-child .timeline-connector {
    display: none;
}

/* Step Content */
.step-content {
    flex: 1;
    padding-top: 0.25rem;
}

.step-label {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.timeline-step.step-upcoming .step-label {
    color: var(--text-muted);
}

.step-timestamp {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-timestamp i {
    color: var(--primary);
    font-size: 0.75rem;
}

.timeline-step.step-upcoming .step-timestamp {
    color: var(--text-muted);
}

.step-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.timeline-step.step-upcoming .step-description {
    color: var(--text-muted);
}

/* Tracking ID Badge */
.tracking-id-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary-light);
    border: 1px solid var(--border-color);
}

.tracking-id-badge i {
    color: var(--primary);
}

/* Empty State */
.tracking-empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.tracking-empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.tracking-empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tracking-empty-state p {
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tracking-modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 16px;
    }

    .tracking-modal-header {
        padding: 1.5rem;
    }

    .tracking-modal-header h2 {
        font-size: 1.4rem;
    }

    .tracking-modal-body {
        padding: 1.5rem;
        max-height: calc(90vh - 90px);
    }

    .tracking-order-info {
        padding: 1rem;
    }

    .timeline-step {
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .step-marker {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .timeline-connector {
        left: 20px;
        top: 40px;
    }

    .step-label {
        font-size: 1rem;
    }

    .step-timestamp {
        font-size: 0.8rem;
    }

    .step-description {
        font-size: 0.85rem;
    }
}

/* Dark Theme Enhancements */
@media (prefers-color-scheme: dark) {
    .tracking-modal {
        background: rgba(0, 0, 0, 0.8);
    }

    .modal-close-btn:hover {
        background: #ef4444;
    }
}

/* Print Styles */
@media print {
    .tracking-modal-overlay,
    .modal-close-btn {
        display: none;
    }

    .tracking-modal-content {
        box-shadow: none;
        max-height: none;
    }
}
