/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* Form Styles */
#tracking-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:disabled,
.form-group select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

#submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

#submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

#submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-container p {
    color: #666;
    font-size: 1.1rem;
}

/* Results Header */
.results-container {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.shipment-header {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.header-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item .label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item .value {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

.status-out-for-delivery {
    background: #cce5ff;
    color: #004085;
}

.status-in-transit {
    background: #fff3cd;
    color: #856404;
}

.status-arrived {
    background: #d1ecf1;
    color: #0c5460;
}

.status-default {
    background: #e2e3e5;
    color: #383d41;
}

/* Timeline Styles */
.timeline-section {
    margin-top: 30px;
}

.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.timeline-item {
    position: relative;
    padding: 20px 0;
    animation: fadeIn 0.5s ease;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 25px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #667eea;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #667eea;
}

.timeline-item:first-child::before {
    background: #28a745;
    box-shadow: 0 0 0 2px #28a745;
}

.timeline-content {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.timeline-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.timeline-location {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.timeline-status {
    color: #555;
    font-size: 0.95rem;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1rem;
}

/* Error Styles */
.error-container {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #721c24;
}

.error-icon {
    font-size: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .header-details {
        grid-template-columns: 1fr;
    }
    
    .timeline {
        padding-left: 30px;
    }
    
    .timeline::before {
        left: 8px;
    }
    
    .timeline-item::before {
        left: -26px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    #submit-btn {
        font-size: 1rem;
        padding: 12px;
    }
}
