/* Removing default browser styles for input, select, and button elements */
input,
select,
button {
    -webkit-appearance: none; 
    appearance: none;
}

/* Search and Buttons Section styles */
.search-buttons-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    align-items: stretch;
    margin-bottom: -25px;
}

.input-button-group {
    display: flex;
    gap: 10px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.search-box {
    width: 100%;
    padding: 10px;
    padding-right: 30px; 
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; 
}

.clear-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    display: none; 
}

.clear-button:hover {
    color: #000;
}

.search-box:not(:placeholder-shown) + .clear-button {
    display: block;
}

.switch-button, .search-button {
    padding: 10px 15px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
}

.switch-button {
    background-color: #007BFF;
    color: white;
    width: 95px;
}

.switch-button:hover {
    background-color: #036ad8;
}

.search-button {
    background-color: #28a745;
    color: white;
    width: 80px;
}

.search-button:hover {
    background-color: #218c3a;
}

/* Responsive Styles for Search and Buttons Section */
@media (min-width: 600px) {
    .search-buttons-section {
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }

    .input-button-group {
        flex: 1;
        max-width: 400px;
    }

    .search-box {
        max-width: none;
    }
}

/* Journey Preferences Section styles */
.journey-preferences-section {
    padding: 20px;
    text-align: center;
}

.journey-preferences-button {
    padding: 8px 8px;
    font-size: 1rem;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    background-color: #ffc107; 
    color: #333;
    margin-bottom: 10px;
    margin-top: -10px;
}

.journey-preferences-button:hover {
    background-color: #e4ac07;
}

.journey-preferences {
    display: none; 
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.journey-preferences-section.visible .journey-preferences {
    display: flex;
}

.date-time-label, .journey-options-label {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.date-time-container,
.journey-options-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.date-input, .time-input, .time-is-dropdown, .preferences-dropdown {
    width: 150px; 
    max-width: 180px; 
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.clear-preferences-button {
    padding: 8px 8px;
    font-size: 1rem;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    background: none;
    color: #001aff;
    text-decoration: underline;
    margin-bottom: 10px;
    margin-top: -10px;
}

.clear-preferences-button {
    color: #0015d4;
}

/* Responsive Styles for Journey Preferences Section */
@media (min-width: 600px) {
    #station-search-via {
        width: 300px;
    }
}

/* Search Results Styles */
.search-results {
    margin-top: -40px;
    text-align: left;
    padding-top: 10px;
    padding: 0 10px;
}

.station-result {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    transition: background-color 0.3s, transform 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.station-result:hover {
    background-color: #e0e0e0;
    transform: scale(1.02);
}

.line-colors {
    margin-top: 5px;
    padding: 0 10px; 
    width: 100%;
    box-sizing: border-box;
}

.line-color {
    display: inline-block;
    width: 30px;
    height: 8px;
    border-radius: 4px;
    margin-right: 5px;
}

#selectedStation {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    padding: 0 10px;
}

/* Responsive Styles for Search Section */
@media (min-width: 600px) {
    .station-result {
        max-width: 500px; 
        margin-left: auto;
        margin-right: auto; 
    }

    .line-colors {
        padding: 0; 
    }

    #selectedStation {
        font-size: 1.5em; 
    }
}

/* Responsove Styles for Search Results */
@media (min-width: 900px) {
    .station-result {
        max-width: 600px; 
    }
}

/* Journey Results Styles */
.journey-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
    padding: 10px;
}

.journey-item {
    margin: 10px 0;
    margin-top: -20px;
    margin-bottom: 40px;
    padding: 15px;
    background-color: white;
    border: 4px solid #000000;
    border-radius: 4px;
    width: 100%;
    max-width: 100%; 
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.journey-leg {
    margin-bottom: 20px; 
    padding: 15px 20px; 
    border: 2px solid #745f5f;
    border-radius: 4px;
    background-color: #f9f9f9;
    position: relative;
    border-color: #000;
    box-sizing: border-box;
}

.line-color-inline {
    display: inline-block;
    width: 40px;
    height: 10px;
    border-radius: 4px;
    margin-right: 5px;
}

.journey-leg::before {
    content: '';
    position: absolute;
    left: 30px; 
    top: 45px; 
    bottom: 45px;
    width: 2px;
    background-color: #000;
}

.journey-leg-content {
    padding-left: 30px; 
}

.journey-leg-station {
    position: relative;
    margin: 10px 0;
}

.journey-leg-station::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 50%;
    width: 8px;
    height: 8px;
    background-color: #000;
    border-radius: 50%;
    transform: translateY(-50%);
}

.view-stops-button {
    margin-top: 5px;
    padding: 0;
    border: none;
    background: none;
    color: #007bff;
    cursor: pointer;
    font: inherit;
    display: inline;
    font-size: 0.9rem;
}

.view-stops-button:hover {
    color: #013f82;
    background: none;
    text-decoration: underline;
}

.stop-points {
    margin-top: 10px;
    padding: 0;
    list-style-type: disc;
    list-style-position: inside;
    margin-left: 20px;
}

/* Responsive Styles for Journey Results */
@media (min-width: 600px) {
    .journey-item {
        padding: 20px;
        margin: 15px 0;
        border-width: 3px;
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    }

    .journey-leg {
        padding: 20px 30px;
        border-width: 3px;
    }

    .journey-leg::before {
        left: 41px; 
    }

    .journey-leg-station::before {
        width: 10px; 
        height: 10px;
    }
}

@media (min-width: 900px) {
    .journey-item {
        max-width: 800px;
    }

    .journey-leg {
        padding: 20px 40px;
    }

    .journey-leg::before {
        left: 51px; 
    }

    .journey-leg-station::before {
        width: 10px;
        height: 10px;
    }
}

