/* Modern Track Page Styles */
:root {
    /* Import existing variables from shop.css */
    --primary: #8B4513;
    --primary-light: #A0522D;
    --primary-dark: #654321;
    --secondary: #D2691E;
    --accent: #CD853F;
    --background: #FAF9F6;
    --surface: #FFFFFF;
    --text-primary: #2C1810;
    --text-secondary: #6B5B73;
    --text-muted: #8B7D8B;
    --border: #E5E0DB;
    --brown-50: #FAF9F6;
    --brown-100: #F5F0EB;
    --brown-200: #E5E0DB;
    --brown-300: #D4C4B0;
    --brown-400: #C4A484;
    --brown-500: #B8946F;
    --brown-600: #A67C52;
    --brown-700: #8B5A2B;
    --brown-800: #6B4423;
    --brown-900: #4A2C17;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

/* Track Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-lg);
}

/* Track Hero Section */
.track-hero {
    text-align: center;
    padding: var(--space-3xl) var(--space-2xl);
    margin: var(--space-2xl) 0;
    position: relative;
    overflow: hidden;
}

.track-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="track" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="%23A0522D" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23track)"/></svg>');
    opacity: 0.3;
}

.track-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-md) 0;
    position: relative;
    z-index: 2;
}

.track-hero h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}

.track-hero p {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--text-secondary);
    margin: 0;
    position: relative;
    z-index: 2;
    line-height: 1.6;
}

/* Track Content */
.track-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    margin: var(--space-3xl) 0;
    align-items: start;
}

/* Track Form */
.track-form-container {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.track-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.track-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: var(--space-xs);
}

.form-control {
    padding: var(--space-md);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
    box-sizing: border-box;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
    background: var(--brown-50);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-normal);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: var(--brown-300);
    border-color: var(--brown-300);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-large {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.1rem;
    width: 100%;
}

/* Track Results */
.track-results {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.track-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.track-results h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 var(--space-lg) 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.track-results h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
}

/* Order Status Card */
.order-status-card {
    background: var(--brown-50);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border);
    transition: var(--transition-normal);
}

.order-status-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.order-id {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.order-status {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-status.pending {
    background: var(--warning);
    color: white;
}

.order-status.processing {
    background: var(--info);
    color: white;
}

.order-status.shipped {
    background: var(--success);
    color: white;
}

.order-status.delivered {
    background: var(--primary);
    color: white;
}

.order-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.order-detail {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.order-detail-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-detail-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Progress Timeline */
.progress-timeline {
    position: relative;
    padding: var(--space-lg) 0;
}

.progress-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: var(--space-3xl);
    margin-bottom: var(--space-xl);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    z-index: 2;
    transition: var(--transition-normal);
}

.timeline-item.completed .timeline-icon {
    background: var(--success);
    box-shadow: var(--shadow-md);
}

.timeline-item.current .timeline-icon {
    background: var(--primary);
    box-shadow: var(--shadow-lg);
    animation: pulse 2s infinite;
}

.timeline-item.pending .timeline-icon {
    background: var(--brown-300);
    color: var(--text-muted);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-lg);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(139, 69, 19, 0.2);
    }
}

.timeline-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition-normal);
}

.timeline-item.completed .timeline-content {
    border-color: var(--success);
}

.timeline-item.current .timeline-content {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.timeline-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
}

.timeline-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 var(--space-sm) 0;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: var(--brown-300);
    margin-bottom: var(--space-lg);
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 0 0 var(--space-sm) 0;
}

.empty-state p {
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.6;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl) var(--space-lg);
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--brown-200);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-lg);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Error State */
.error-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    color: var(--error);
}

.error-state i {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
}

.error-state h3 {
    font-size: 1.2rem;
    margin: 0 0 var(--space-sm) 0;
}

.error-state p {
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.6;
}

/* Animations */
.track-form-container,
.track-results {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-item {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.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; }

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: var(--space-2xl) var(--space-md);
    }
    
    .track-content {
        gap: var(--space-2xl);
    }
    
    .track-form-container,
    .track-results {
        padding: var(--space-xl);
    }
    
    .order-details {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: var(--space-md);
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--space-xl) var(--space-sm);
    }
    
    .track-hero {
        padding: var(--space-xl) var(--space-md);
        margin: var(--space-lg) 0;
    }
    
    .track-content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .track-form-container,
    .track-results {
        padding: var(--space-lg);
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .order-details {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .timeline-item {
        padding-left: var(--space-2xl);
    }
    
    .timeline-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .progress-timeline::before {
        left: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--space-lg) var(--space-xs);
    }
    
    .track-hero {
        padding: var(--space-lg) var(--space-sm);
    }
    
    .track-form-container,
    .track-results {
        padding: var(--space-md);
    }
    
    .form-control {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
    }
    
    .order-status-card {
        padding: var(--space-md);
    }
    
    .order-id {
        font-size: 1rem;
    }
    
    .order-detail-label {
        font-size: 0.8rem;
    }
    
    .order-detail-value {
        font-size: 0.9rem;
    }
    
    .timeline-content {
        padding: var(--space-md);
    }
    
    .timeline-title {
        font-size: 0.9rem;
    }
    
    .timeline-description {
        font-size: 0.85rem;
    }
    
    .timeline-date {
        font-size: 0.75rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard navigation */
.form-control:focus,
.btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .track-form-container,
    .track-results,
    .order-status-card,
    .timeline-content {
        border: 2px solid currentColor;
    }
    
    .btn-primary {
        border: 2px solid currentColor;
    }
}
