:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --primary-color: #bb86fc;
    --secondary-color: #03dac6;
    --error-color: #cf6679;
    --card-bg: #1e1e1e;
    --input-bg: #2d2d2d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}


/* --- NEW Styles for Clickable Connections and Details --- */

/* Make connection summaries clickable */
.connection-summary {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.connection-summary:hover {
    background-color: #2a2a2a; /* Slightly lighter background on hover */
}

.connection-summary.selected {
    border-left: 4px solid var(--secondary-color); /* Highlight selected item */
    background-color: #252525; /* Slightly different background when selected */
}

/* Container for the detailed view */
#connection-details-container {
    margin-top: 25px;
    padding: 20px;
    background-color: var(--card-bg);
    border: 1px solid #444;
    border-radius: 4px;
}

#connection-details-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

/* Individual section within the details */
.connection-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    /* border-bottom: 1px dashed #444; */ /* Optional: separator */
}
/* .connection-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
} */

.section-time {
    font-weight: bold;
    margin-bottom: 5px;
}

.section-transport {
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.section-route {
    font-size: 0.95em;
    color: #ccc;
}

/* Separator between sections */
.section-separator {
    border: none;
    border-top: 1px dashed #555;
    margin: 15px 0;
}

/* Style for the Google Maps link */
.google-maps-link-container {
    margin-top: 10px;
    text-align: right; /* Align link to the right */
}

.google-maps-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9em;
    padding: 3px 6px;
    border: 1px solid var(--primary-color);
    border-radius: 3px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.google-maps-link:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    text-decoration: none;
}


h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
}

.search-container {
    margin-bottom: 20px; /* Reduced margin slightly */
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.input-wrapper {
    display: flex;
    gap: 5px;
}

/* Style for both input fields */
#station-input,
#to-station-input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 16px;
}

#nearby-btn {
    background-color: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 0 15px;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0; /* Prevent shrinking */
}

#nearby-btn:hover {
    opacity: 0.9;
}

#location-status {
    margin-top: 5px;
    font-size: 14px;
    color: var(--secondary-color);
    min-height: 20px;
}

/* Style for both suggestion containers */
.suggestions-container {
    margin-top: 5px;
    border-radius: 4px;
    background-color: var(--card-bg);
    max-height: 200px;
    overflow-y: auto;
    display: none; /* Initially hidden */
    border: 1px solid #444; /* Add border */
    position: absolute; /* Position relative to parent */
    width: calc(100% - 2px); /* Match input width, account for border */
    z-index: 10; /* Ensure it's above other elements */
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #444;
}
.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #333;
}

.suggestion-item.error-message {
    color: var(--error-color);
    cursor: default;
}
.suggestion-item.error-message:hover {
    background-color: var(--card-bg); /* No hover effect for error */
}


.search-actions {
    margin-bottom: 30px;
    text-align: center; /* Center the button */
}

#search-connections-btn {
    background-color: var(--secondary-color);
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

#search-connections-btn:hover {
    opacity: 0.9;
}


#schedule-results {
    margin-top: 20px;
}

/* Styles for Single Station Schedule Items */
.schedule-item {
    background-color: var(--card-bg);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #333; /* Subtle border */
}

.schedule-time {
    font-weight: bold;
    width: 80px;
    flex-shrink: 0;
}

.schedule-destination {
    flex-grow: 1;
    padding: 0 15px;
    text-align: left;
}

.schedule-line {
    background-color: var(--primary-color);
    color: #000;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: bold;
    white-space: nowrap;
}

.status-realtime {
    color: var(--secondary-color);
    font-size: 0.9em;
}

.status-planned {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9em;
}

.status-delayed {
    color: var(--error-color);
    font-weight: bold;
    font-size: 0.9em;
}

/* Styles for Connection Search Results */
.connection-item {
    background-color: var(--card-bg);
    padding: 15px;
    margin-bottom: 15px; /* Slightly more spacing */
    border-radius: 4px;
    border: 1px solid #333;
}

.connection-times {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 8px;
}

.connection-times .dep-time {
    color: var(--text-color);
}

.connection-times .arr-time {
    color: var(--secondary-color);
}

.connection-details {
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #aaa;
}

.connection-details .duration {
    margin-right: 15px;
}

.connection-stations {
    margin-bottom: 8px;
}

.connection-stations .from-station {
    font-weight: bold;
}

.connection-stations .to-station {
    font-weight: bold;
}

.platform {
    font-size: 0.9em;
    color: #bbb;
    margin-top: 5px;
}


/* General Loading/Error Styles */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--secondary-color);
}

.error-message {
    color: var(--error-color);
    text-align: center;
    padding: 20px;
}
