* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.4;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Header */
.header {
    background-color: #c4574a;
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
}

.toggle-search-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-search-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Search Section */
.search-section {
    padding: 20px;
    background-color: #e8e8e8;
    border-bottom: 1px solid #ddd;
}

.search-container {
    position: relative;
    margin-bottom: 12px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
}

.search-input:focus {
    outline: none;
    border-color: #c4574a;
    box-shadow: 0 0 0 2px rgba(196, 87, 74, 0.2);
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background-color: #f0f0f0;
}

.search-btn {
    width: 100%;
    background-color: #c4574a;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.search-btn:hover {
    background-color: #b04739;
}

.search-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #c4574a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* Error */
.error {
    text-align: center;
    padding: 40px 20px;
    color: #d32f2f;
}

/* Stop Info */
.stop-info {
    background-color: white;
}

.stop-header {
    background-color: #666;
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stop-favorite {
    font-size: 20px;
    cursor: pointer;
}

.stop-details {
    flex: 1;
}

.stop-details h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stop-details p {
    font-size: 14px;
    opacity: 0.9;
}

.stop-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Times List */
.times-list {
    padding: 0;
}

.time-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    gap: 16px;
}

.route-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
    background-color: #666; /* Fallback color for undefined routes */
}

/* Route colors */
.route-badge.route-111 { background-color: #525252; }
.route-badge.route-121 { background-color: #525252; }
.route-badge.route-33 { background-color: #E5097A; }
.route-badge.route-9 { background-color: #40AC3D; }
.route-badge.route-4 { background-color: #E31F24; }
.route-badge.route-5 { background-color: #678434; }
.route-badge.route-8 { background-color: #67796F; }
.route-badge.route-11 { background-color: #9C92C5; }
.route-badge.route-21 { background-color: #F39210; }
.route-badge.route-n1 { background-color: #614232; }
.route-badge.route-n3 { background-color: #BF7329; }
.route-badge.route-n5 { background-color: #00A8B1; }
.route-badge.route-n6 { background-color: #8D297B; }
.route-badge.route-25 { background-color: #00A1E3; }
.route-badge.route-n8 { background-color: #9D6A59; }
.route-badge.route-n9 { background-color: #F1B508; }
.route-badge.route-s0 { background-color: #50504E; }
.route-badge.route-s2 { background-color: #8C3231; }
.route-badge.route-c5 { background-color: #C53E3F; }
.route-badge.route-c30 { background-color: #EA5570; }
.route-badge.route-c31 { background-color: #D95A21; }
.route-badge.route-c32 { background-color: #C49E0F; }
.route-badge.route-c34 { background-color: #5C9C78; }
.route-badge.route-c35 { background-color: #008CD2; }
.route-badge.route-u1 { background-color: #6A5BA3; }
.route-badge.route-u2 { background-color: #8D297B; }
.route-badge.route-u3 { background-color: #027981; }
.route-badge.route-13 { background-color: #A2987A; }
.route-badge.route-7 { background-color: #E5097A; } /* Route 7 maps to 627, using 600 color as fallback */
.route-badge.route-m { background-color: #607d8b; } /* Keep existing Metro color */
.route-badge.route-395 { background-color: #666; } /* Qentar - no color specified, using default */
.route-badge.route-f1 { background-color: #666; } /* F routes - no colors specified, using default */
.route-badge.route-f2 { background-color: #666; }
.route-badge.route-f3 { background-color: #666; }
.route-badge.route-f4 { background-color: #666; }
.route-badge.route-f5 { background-color: #666; }
.route-badge.route-f6 { background-color: #666; }
.route-badge.default { background-color: #666; }

.time-details {
    flex: 1;
}

.time-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.time-details p {
    font-size: 14px;
    color: #666;
}

.time-display {
    text-align: right;
    flex-shrink: 0;
}

.main-time {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.upcoming-times {
    font-size: 12px;
    color: #999;
}

.arriving {
    color: #4caf50;
}

/* No Times */
.no-times {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Last Update */
.last-update {
    padding: 16px 20px;
    background-color: #f8f8f8;
    border-top: 1px solid #eee;
    text-align: center;
}

.last-update p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Utilities */
.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        box-shadow: none;
    }
    
    .search-section {
        padding: 16px;
    }
    
    .time-item {
        padding: 12px 16px;
    }
    
    .route-badge {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}
