/* ── Sidebar form (unique to search — inline in nav panel) ─────────────────── */
.srch-form { display: flex; flex-direction: column; gap: 14px; }

.srch-field { display: flex; flex-direction: column; gap: 5px; }

.srch-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255,255,255,0.4);
}

.srch-optional { font-weight: 400; text-transform: none; letter-spacing: 0; }

.srch-ac-wrap { position: relative; }

.srch-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14px;
    padding: 8px 11px;
    outline: none;
    font-family: inherit;
    height: var(--input-h);
}

.srch-input:focus {
    border-color: rgba(255,255,255,0.45);
    background: rgba(0,0,0,0.4);
}

.srch-input::placeholder { color: rgba(255,255,255,0.27); }

input[type="date"].srch-input,
input[type="time"].srch-input { color-scheme: dark; }

select.srch-input {
    color-scheme: dark;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.srch-btn {
    background: linear-gradient(180deg, var(--blue-primary) 0%, var(--blue-dark) 100%);
    border: none;
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    padding: 10px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 4px;
    transition: filter 0.15s;
}
.srch-btn:hover  { filter: brightness(1.1); }
.srch-btn:active { filter: brightness(0.92); }

/* Dropdown — position:fixed, coords set by JS */
.srch-dropdown {
    position: fixed;
    background: var(--bg-panel);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: var(--r-sm);
    z-index: 600;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.45);
}
.srch-dropdown[hidden] { display: none !important; }

.srch-drop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 11px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 13px;
    gap: 8px;
}

.srch-drop-item:last-child { border-bottom: none; }
.srch-drop-item:hover,
.srch-drop-item.active     { background: rgba(255,255,255,0.1); }

.srch-drop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-drop-crs  { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; color: var(--text-dim); flex-shrink: 0; }

/* Filter toggles */
.srch-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

.srch-filters-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-dim);
}

.srch-filter-btns { display: flex; flex-direction: column; gap: 6px; }

.srch-filter-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: var(--r-sm);
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    font-family: inherit;
    padding: 7px 10px;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.srch-filter-btn::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1.5px solid rgba(255,255,255,0.25);
    flex-shrink: 0;
    transition: background 0.12s, border-color 0.12s;
}

.srch-filter-btn.active { color: var(--text); border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.1); }
.srch-filter-btn.active::before { background: var(--blue-primary); border-color: var(--blue-primary); }
.srch-filter-btn:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }

/* ── Main results area ────────────────────────────────────────────────────── */
.srch-main { padding: 24px 20px; }
.srch-results-wrap { max-width: 100%; }

/* Placeholder: uses .placeholder from components.css */
/* Override icon size for the train emoji */
.placeholder-icon { font-size: 48px; }

/* Results card */
.srch-results {
    background: var(--bg-card);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.srch-results-hdr {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(0,0,0,0.15);
}

.srch-count { font-size: 13px; font-weight: 400; color: var(--text-muted); }

.srch-cols {
    display: grid;
    grid-template-columns: 62px 100px 1fr 1fr 52px;
    padding: 7px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-dim);
    background: var(--blue-header);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    column-gap: 12px;
}

.srch-cols.has-arr { grid-template-columns: 62px 100px 72px 1fr 1fr 52px; }

.srch-row {
    display: grid;
    grid-template-columns: 62px 100px 1fr 1fr 52px;
    padding: 11px 16px;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    background: var(--bg-row-even);
    column-gap: 12px;
    min-height: 50px;
}

.srch-row.has-arr { grid-template-columns: 62px 100px 72px 1fr 1fr 52px; }

.srch-row:nth-child(even) { background: rgba(255,255,255,0.05); }
.srch-row:hover            { background: rgba(255,255,255,0.09); }
.srch-row:last-child       { border-bottom: none; }

.srch-row.cancelled { color: var(--clr-danger); }

.srch-col-time { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.srch-col-exp  { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

.srch-row.cancelled .srch-col-exp { color: var(--clr-danger); }
.srch-row.delayed   .srch-col-exp { color: var(--clr-warning); }

.srch-col-arr   { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.65); }
.srch-col-route { font-size: 15px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-col-op    { font-size: 14px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-col-plat  { font-size: 16px; font-weight: 700; text-align: center; color: rgba(255,255,255,0.65); }

.srch-row.passing           { opacity: 0.45; font-style: italic; }
.srch-row.passing .srch-col-time { font-size: 15px; }
.srch-row.passing:hover     { opacity: 0.75; }

.srch-arrow      { color: var(--text-dim); font-size: 12px; margin: 0 5px; }
.srch-ontime     { color: var(--clr-success); font-size: 13px; font-weight: 700; }
.srch-cancel-tag { color: var(--clr-danger);  font-size: 13px; font-weight: 700; }
.srch-delayed-tag { color: var(--clr-warning); font-weight: 700; }

.srch-loading,
.srch-empty { padding: 40px 16px; text-align: center; opacity: 0.5; font-size: 16px; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
    .srch-main                     { padding: 16px 12px; }
    .srch-cols, .srch-row          { grid-template-columns: 58px 90px 1fr 50px; }
    .srch-cols.has-arr,
    .srch-row.has-arr              { grid-template-columns: 58px 90px 64px 1fr 50px; }
    .srch-col-op                   { display: none; }
}

/* ── ≤500px: card layout ──────────────────────────────────────────────────── */
@media (max-width: 500px) {
    .srch-main { padding: 12px 8px; }

    /* Hide grid column headers */
    .srch-cols { display: none; }

    /* Switch rows to flex-wrap */
    .srch-row,
    .srch-row.has-arr {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0 8px;
        padding: 10px 12px 8px;
        grid-template-columns: unset;
        min-height: 0;
    }

    .srch-col-time  { order: 1; font-size: 18px; font-weight: 700; flex: 0 0 auto; }
    .srch-col-exp   { order: 2; font-size: 13px; flex: 0 0 auto; }
    .srch-col-arr   { order: 3; font-size: 13px; flex: 0 0 auto; color: rgba(255,255,255,0.6); }
    .srch-col-plat  { order: 4; margin-left: auto; font-size: 15px; text-align: right; }
    .srch-col-op    { display: none; }

    /* Route gets its own full-width second line */
    .srch-col-route {
        order: 5;
        flex: 1 0 100%;
        font-size: 14px;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        margin-top: 3px;
        padding-bottom: 2px;
    }

    .srch-row.passing .srch-col-time { font-size: 14px; }
}
