* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    background: #f5f5f5;
    padding-bottom: 30px; /* Add padding to prevent content from being hidden by bottom nav */
}

.welcome-message {
    background: white;
    padding: 16px;
    margin-top: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    line-height: 1.3;
}

.welcome-message p {
    margin-bottom: 15px;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 16px;
}

.flex-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.header {
    background: rgba(25, 118, 210, 0.9);
    backdrop-filter: blur(5px) saturate(180%);
    color: white;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.results-header {
    background: rgba(25, 118, 210, 0.9);
    backdrop-filter: blur(5px) saturate(180%);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    padding-top: 16px;
    padding-bottom: 16px;
    padding-left: 16px;
    display: flex;
    z-index: 1000;
}

.back-button .icon{
    margin-right: -4px;
    font-size: 20px;
}

.results-header .back-button {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-form {
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    padding-left: 16px;
}

/* Bus route autocomplete */
ul#suggestions {
    list-style: none;
    padding-left: 16px;
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

ul#suggestions li {
    background: #e0e0e0;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;

    transition: background 0.3s, color 0.3s;
    }

    ul#suggestions li:hover {
        background: #1976d2;
        color: white;
}

.horizontal-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.horizontal-input-group label,
.horizontal-input-group input {
    width: auto;
    margin-bottom: 0;
    padding-left: 16px;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #1565c0;
    color: rgb(156, 156, 156);
}

.result {
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    display: none;
}

/* Searching Popup Animation */
#searching-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px) saturate(70%);
    display: none;
    justify-content: center;
    align-items: center;
}

#searching-popup .popup-content {
    background: white;
    border-radius: 12px;
    height: 150px;
    width: 150px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#searching-popup .spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #1976d2; /* Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
    margin-top: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Bottom Navigation Styles */
.bottom-nav {
    position: fixed;
    bottom: 0px;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 1px;
}

.nav-item.active {
    color: #1976d2;
}

/* Additional spacing for iOS safe area */
@supports (padding: max(0px)) {
    .bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Results page */

/* suggestion card */
.card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-center {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.seat-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 8px;
}

h2 {
    font-size: 16px;
    color: #1976d2;
}

#colour-legends {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-left: 16px;
    margin-right: 16px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.legend {
    display: flex;
    align-items: center;
    gap: 8px;
}

.colour-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.seat-indicators > .seat-indicator {
    font-size: 40px;
}

.seat-indicator {
    color: #666;
}

.seat-indicator.active {
    color: #1976d2;
}

ul#stops-list {
    list-style: none;
    margin-top: 8px;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

ul#stops-list > li {
    display: flex;
    gap: 8px;
}

ul#stops-list > li > span.stop-dot {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border-radius: 50%;
    border-color: #1976d2;
    background: white;;
    border-width:3px;
    border-style: solid;
    box-sizing: border-box;
    margin-top: 4px;
    z-index: 3;
}

.stops-connecting-line {
    height: 0; /* To be set by javascript */
    background-color: #1976d2;
    width: 6px;
    position: absolute;
    margin-top: 12px;
    margin-left: 21px;
    margin-bottom: 12px;
    z-index: 0;
}

.history-card-normal-text {
    font-size: 16px;
    color: black;
}

.history-card-highlight-text {
    font-size: 16px;
    color: #1976d2;
    font-weight: bold;
}

.history-card {
    cursor: pointer;
    transition: background 0.3s ease;
}

.history-card:hover {
    background: #CCC;
}