/* =====================================================
   EcoFreight Pages - Tracking, Forms, Responsive
   ===================================================== */

/* Tracking Page */
.track-hero {
    background: var(--primary-700);
    padding: 160px 0 100px;
    text-align: center;
}

.track-hero h1 {
    color: #fff;
    margin-bottom: 12px;
}

.track-hero p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.125rem;
    margin-bottom: 40px;
}

.track-search {
    max-width: 560px;
    margin: 0 auto;
}

.track-form {
    display: flex;
    gap: 12px;
    background: #fff;
    padding: 8px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.track-form input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    font-size: 1rem;
    background: transparent;
}

.track-form input::placeholder {
    color: var(--gray-400);
}

.track-form input:focus {
    outline: none;
}

.track-results {
    padding: 80px 0;
}

.track-card {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.track-card-header {
    background: var(--gray-50);
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.track-code {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
}

.track-card-body {
    padding: 36px 32px;
}

.track-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 40px;
}

.track-info-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    margin-bottom: 6px;
}

.track-info-item span {
    font-weight: 500;
    color: var(--gray-800);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 36px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 28px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -36px;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 0.75rem;
    z-index: 1;
}

.timeline-item.current .timeline-marker {
    background: var(--primary-600);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

.timeline-content h4 {
    font-size: 0.9375rem;
    margin-bottom: 4px;
}

.timeline-content p {
    color: var(--gray-500);
    font-size: 0.9375rem;
    margin-bottom: 4px;
}

.timeline-meta {
    font-size: 0.8125rem;
    color: var(--gray-400);
}

/* Status Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-pending .badge-dot {
    background: #f59e0b;
}

.badge-in_transit {
    background: var(--primary-100);
    color: var(--primary-800);
}

.badge-in_transit .badge-dot {
    background: var(--primary-600);
}

.badge-delivered {
    background: #d1fae5;
    color: #065f46;
}

.badge-delivered .badge-dot {
    background: #10b981;
}

.badge-failed {
    background: #fee2e2;
    color: #991b1b;
}

.badge-failed .badge-dot {
    background: #ef4444;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: var(--transition);
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9375rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-info {
    background: var(--primary-100);
    color: var(--primary-800);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 64px 24px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* Loader */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 1200px) {
    .hero-bg {
        width: 50%;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    :root {
        --section-padding: 80px;
    }

    .hero {
        text-align: center;
    }

    .hero-bg {
        display: none;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .about-image {
        order: -1;
    }

    .about-image-badge {
        right: 24px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: fixed;
        inset: 0;
        background: var(--gray-900);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
        z-index: 1001;
    }

    .nav.active {
        display: flex;
    }

    .nav-link {
        font-size: 1.5rem;
        color: #fff;
    }

    .mobile-toggle {
        display: flex;
        position: relative;
        z-index: 1002;
    }

    .header-actions .btn {
        display: none;
    }

    .hero {
        padding: 140px 0 80px;
        min-height: auto;
    }

    .hero-stats {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .hero-stat {
        text-align: center;
    }

    .hero-track-form {
        flex-direction: column;
    }

    .services-grid,
    .features-grid,
    .about-features {
        grid-template-columns: 1fr;
    }

    .track-info {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    :root {
        --section-padding: 64px;
    }

    .container {
        padding: 0 16px;
    }

    .btn {
        padding: 12px 20px;
    }

    .service-card,
    .feature-card {
        padding: 24px 20px;
    }
}