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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 16px;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 1.5rem;
    color: #1a5276;
}

.subtitle {
    color: #777;
    font-size: 0.9rem;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: #ddd;
    cursor: pointer;
    font-size: 0.95rem;
    border-radius: 6px 6px 0 0;
    transition: background 0.2s;
}

.tab.active {
    background: #fff;
    font-weight: 600;
    color: #1a5276;
}

.tab-content {
    display: none;
    background: #fff;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-content.active {
    display: block;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="time"],
.form-group input[type="date"],
.form-group select {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #1a5276;
    box-shadow: 0 0 0 2px rgba(26, 82, 118, 0.15);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.swap-btn {
    align-self: center;
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.1rem;
    color: #1a5276;
    transition: background 0.2s;
}

.swap-btn:hover {
    background: #eef;
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.95rem;
}

.autocomplete-item:hover {
    background: #e8f0fe;
}

.btn {
    padding: 12px;
    background: #1a5276;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn:hover {
    background: #154360;
}

.htmx-indicator {
    display: none;
    text-align: center;
    padding: 20px;
    color: #777;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: block;
}

.results-header {
    margin: 20px 0 12px;
}

.results-header h2 {
    font-size: 1.1rem;
    color: #1a5276;
}

.results-header p {
    color: #777;
    font-size: 0.85rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.results-table th {
    background: #f0f0f0;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.85rem;
    color: #555;
    font-weight: 600;
}

.results-table td {
    padding: 10px 12px;
    border-top: 1px solid #eee;
    font-size: 0.95rem;
}

.results-table tr:hover td {
    background: #fafafa;
}

.time {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.countdown {
    color: #e74c3c;
}

.line-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 36px;
    text-align: center;
}

.line-badge.tram {
    background: #e74c3c;
    color: #fff;
}

.line-badge.bus {
    background: #2980b9;
    color: #fff;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #777;
}

.no-results strong {
    color: #333;
}

.update-time {
    text-align: right;
    color: #999;
    font-size: 0.8rem;
    margin-top: 8px;
}

.loading-text {
    text-align: center;
    padding: 40px;
    color: #777;
}

.live-footer {
    margin-top: 24px;
    text-align: center;
}

.back-link {
    color: #1a5276;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

@media (max-width: 500px) {
    .container {
        padding: 8px;
    }

    .form-row {
        flex-direction: column;
        gap: 8px;
    }

    .results-table th,
    .results-table td {
        padding: 8px 6px;
        font-size: 0.85rem;
    }
}
