body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #7c878e 50%, #003da5 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin: 20px auto;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: #003da5;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.header h2 {
    font-size: 1.2rem;
    color: #666;
    font-weight: 400;
}

.status-bar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.status-header {
    text-align: center;
    margin-bottom: 8px;
}

.bus-count {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.timeline-container {
    max-width: 100%;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.timeline {
    position: relative;
    height: 30px;
    margin-bottom: 5px;
}

.timeline-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #003da5 0%, #00843d 25%, #ed8b00 50%, #da001e 100%);
    border-radius: 2px;
    transform: translateY(-50%);
}

.bus-dot {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: translate(50%, -50%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.bus-dot:hover {
    transform: translate(50%, -50%) scale(1.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.bus-dot.inbound {
    border-color: #007bff;
}

.bus-dot.outbound {
    border-color: #6c757d;
}

.prediction-card {
    display: flex;
    align-items: center;
}

.prediction-card.inbound-primary {
    padding: 22px;
    margin: 18px 0;
    border-left: 6px solid #003da5;
    box-shadow: 0 3px 12px rgba(0, 61, 165, 0.15);
}

.prediction-card.outbound-secondary {
    padding: 20px;
    margin: 16px 0;
    border-left: 5px solid #7c878e;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    opacity: 0.9;
}

.prediction-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.prediction-card.leave-now {
    border-left-color: #fd7e14;
    background: linear-gradient(135deg, #fff3cd 0%, #f8f9fa 100%);
}

.prediction-card.leave-soon {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #f8f9fa 100%);
}

.prediction-card.already-left {
    border-left-color: #6c757d;
    background: #f8f9fa;
    opacity: 0.6;
}

.prediction-card.too-late {
    border-left-color: #6c757d;
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    opacity: 0.8;
}

.leave-action {
    flex: 0 0 140px;
    text-align: center;
    margin-right: 20px;
}

.action-text {
    font-size: 24px;
    font-weight: 900;
    padding: 8px 16px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-text.leave-now {
    background: #dc3545;
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.action-text.leave-soon {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.action-text.too-late {
    background: #6c757d;
    color: white;
}

.action-text.soon {
    background: #fd7e14;
    color: white;
    box-shadow: 0 2px 4px rgba(253, 126, 20, 0.3);
}

.bus-details {
    flex: 1;
}

.arrival-time {
    font-size: 20px;
    font-weight: bold;
    color: #003da5;
    margin-bottom: 4px;
}

.arrival-minutes {
    font-size: 16px;
    color: #666;
    margin-bottom: 4px;
}

.vehicle {
    font-size: 14px;
    color: #888;
    font-style: italic;
}

@keyframes urgent-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes urgent-flash {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.no-predictions {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.refresh-btn {
    display: block;
    margin: 30px auto 0;
    padding: 12px 24px;
    background: linear-gradient(135deg, #003da5 0%, #002c7a 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 61, 165, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 61, 165, 0.4);
}

.directions-container {
    display: flex;
    flex-direction: column;  /* Stack vertically instead of side-by-side */
    gap: 40px;
    margin-top: 30px;
}

.directions-container.afternoon-order {
    flex-direction: column-reverse;  /* Reverse the vertical stack */
}

.direction-section {
    flex: 1;
}

.direction-section {
    flex: 1;
}

.direction-section.inbound-primary h3 {
    color: #003da5;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 4px solid #003da5;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #003da5, #0056b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stop-location {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
    font-weight: 400;
}

.direction-section.inbound-primary .status-bar {
    background: rgba(0, 61, 165, 0.1);
    border: 2px solid #003da5;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 16px rgba(0, 61, 165, 0.2);
}

.direction-section.inbound-primary .bus-count {
    font-size: 16px;
    font-weight: 700;
    color: #003da5;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #003da5;
}

.direction-section.inbound-primary .timeline {
    height: 35px;
}

.direction-section.inbound-primary .bus-dot {
    width: 16px;
    height: 16px;
    border-width: 3px;
}

.direction-section.outbound-secondary {
}

.direction-section.outbound-secondary h3 {
    color: #7c878e;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 3px solid #7c878e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.direction-section.outbound-secondary .status-bar {
    background: rgba(124, 135, 142, 0.05);
    border: 2px solid #7c878e;
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

.direction-section.outbound-secondary .bus-count {
    font-size: 15px;
    font-weight: 600;
    color: #7c878e;
    background: #f8f9fa;
    border: 2px solid #7c878e;
}

.direction-section.outbound-secondary .timeline {
    height: 30px;
}

.direction-section.outbound-secondary .bus-dot {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* Outbound Primary (Afternoon) */
.direction-section.outbound-primary {
    opacity: 1;
    transform: scale(1);
}

.direction-section.outbound-primary h3 {
    color: #003da5;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 4px solid #003da5;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #003da5, #0056b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.direction-section.outbound-primary .status-bar {
    background: rgba(0, 61, 165, 0.1);
    border: 2px solid #003da5;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 16px rgba(0, 61, 165, 0.2);
}

.direction-section.outbound-primary .bus-count {
    font-size: 16px;
    font-weight: 700;
    color: #003da5;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #003da5;
}

.direction-section.outbound-primary .timeline {
    height: 35px;
}

.direction-section.outbound-primary .bus-dot {
    width: 16px;
    height: 16px;
    border-width: 3px;
}

.prediction-card.outbound-primary {
    padding: 22px;
    margin: 18px 0;
    border-left: 6px solid #003da5;
    box-shadow: 0 3px 12px rgba(0, 61, 165, 0.15);
}

/* Inbound Secondary (Afternoon) */
.direction-section.inbound-secondary {
}

.direction-section.inbound-secondary h3 {
    color: #7c878e;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 3px solid #7c878e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.direction-section.inbound-secondary .status-bar {
    background: rgba(124, 135, 142, 0.05);
    border: 2px solid #7c878e;
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

.direction-section.inbound-secondary .bus-count {
    font-size: 15px;
    font-weight: 600;
    color: #7c878e;
    background: #f8f9fa;
    border: 2px solid #7c878e;
}

.direction-section.inbound-secondary .timeline {
    height: 30px;
}

.direction-section.inbound-secondary .bus-dot {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.prediction-card.inbound-secondary {
    padding: 20px;
    margin: 16px 0;
    border-left: 5px solid #7c878e;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    opacity: 0.9;
}

@media (max-width: 768px) {
    .directions-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .directions-container.afternoon-order {
        flex-direction: column-reverse;
    }
    
    .prediction-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .leave-action {
        margin-right: 0;
        margin-bottom: 15px;
        flex: none;
    }
    
    .action-text {
        font-size: 20px;
        padding: 6px 12px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 20px;
        margin: 10px;
    }
}

.no-predictions {
    text-align: center;
    color: #7c878e;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px dashed #7c878e;
}

.last-updated {
    text-align: center;
    color: #7c878e;
    font-size: 14px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #7c878e;
}