/* =========================================================================
   LTIA HOMEPAGE BUS BOARD & #dtab-2 TRANSPORT UPGRADE (WHITE & NAVY FIDS)
   ========================================================================= */

/* Allow 3 pill tabs in #flight-board to wrap gracefully on small screens */
.flight-pill-tabs {
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 767.98px) {
    .flight-pill-tabs .tab-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
}

/* #dtab-2 Upgraded Controls & Live Mini Strip */
.sjh-bus-select-card {
    position: relative;
    min-width: 175px;
    padding-right: 12px;
}

.sjh-bus-select {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 100%;
    appearance: auto;
}

.sjh-bus-mini-strip {
    margin-top: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 0.82rem;
    color: #1e3a8a;
}

.sjh-bus-mini-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.sjh-bus-mini-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.sjh-bus-mini-item:hover {
    text-decoration: underline;
}

.sjh-bus-mini-plate {
    background: #ffffff;
    border: 1px solid #93c5fd;
    border-radius: 5px;
    padding: 1px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
    font-size: 0.76rem;
    color: #0f172a;
}

.sjh-bus-mini-eta {
    color: #0284c7;
    font-weight: 800;
}

.sjh-bus-mini-link {
    color: #1e3a8a;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.sjh-bus-mini-link:hover {
    color: #0060df;
    text-decoration: underline;
}

@media (max-width: 991.98px) {
    .sjh-bus-select-card {
        min-width: 0;
        flex: 1 1 calc(50% - 6px);
    }
}

@media (max-width: 767.98px) {
    .sjh-bus-select-card {
        min-width: 100%;
        width: 100%;
        flex: none;
    }
    .sjh-bus-mini-strip {
        padding: 8px 10px;
        font-size: 0.78rem;
    }
}

/* #buses-tab Inside #flight-board */
.home-bus-board-wrap {
    background: #ffffff;
    color: #1e293b;
}

.home-bus-controls {
    background: #f8fafc;
    border-bottom: 1px solid #dbeafe;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-bus-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.home-bus-dir-switch {
    display: inline-flex;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 3px;
    gap: 4px;
    flex-wrap: wrap;
}

.home-bus-dir-btn {
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
}

.home-bus-dir-btn:hover {
    color: #1e3a8a;
}

.home-bus-dir-btn.active {
    background: #1e3a8a;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.22);
}

.home-bus-search-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.home-bus-search-box {
    position: relative;
    min-width: 240px;
    display: flex;
    align-items: center;
}

.home-bus-search-box i,
.home-bus-search-box svg,
.home-bus-search-box .svg-inline--fa,
.home-bus-search-box .home-bus-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.82rem;
    pointer-events: none;
    z-index: 2;
}

.home-bus-search-input {
    width: 100%;
    height: 36px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 9px;
    padding: 0 12px 0 32px;
    font-size: 0.85rem;
    color: #0f172a;
    outline: none;
}

.home-bus-search-input:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}

.home-bus-full-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 9px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.home-bus-full-link:hover {
    background: #dbeafe;
    color: #1e3a8a;
}

.home-bus-chips-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.home-bus-chip {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.home-bus-chip:hover {
    border-color: #0284c7;
    color: #1e3a8a;
    background: #eff6ff;
}

.home-bus-chip.active {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: #ffffff;
}

.home-bus-route-banner {
    display: none;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.84rem;
    color: #1e3a8a;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.home-bus-route-banner.show {
    display: flex;
}

.home-bus-table-wrap {
    overflow-x: auto;
    background: #ffffff;
}

.home-bus-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 880px;
}

.home-bus-table thead th {
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 12px 14px;
    border-bottom: 2px solid #1e3a8a;
    text-align: left;
    white-space: nowrap;
}

.home-bus-row {
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.15s ease;
}

.home-bus-row:nth-child(4n+1) { background: #ffffff; }
.home-bus-row:nth-child(4n+3) { background: #f8fafc; }
.home-bus-row:hover { background: #eff6ff; }

.home-bus-row td {
    padding: 12px 14px;
    vertical-align: middle;
}

.home-bus-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 4px 10px;
    border-radius: 7px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88rem;
    font-weight: 800;
    background: #eff6ff;
    color: #1e3a8a;
    border: 1.5px solid #93c5fd;
}

.home-bus-plate {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    color: #0f172a;
    border: 1.5px solid #1e3a8a;
    border-radius: 7px;
    padding: 4px 9px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.86rem;
    font-weight: 800;
    white-space: nowrap;
}

.home-bus-plate i,
.home-bus-plate svg,
.home-bus-plate .svg-inline--fa {
    color: #0284c7;
    font-size: 0.78rem;
}

.home-bus-route-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}

.home-bus-live-loc {
    font-size: 0.78rem;
    font-weight: 600;
    color: #0369a1;
    margin-top: 2px;
}

.home-bus-eta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.home-bus-eta-pill.arriving {
    background: #dbeafe;
    color: #1e3a8a;
    border: 1px solid #60a5fa;
}

.home-bus-eta-pill.normal {
    background: #f1f5f9;
    color: #1e3a8a;
    border: 1px solid #cbd5e1;
}

.home-bus-eta-pill.closed {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.home-bus-bay {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #1e3a8a;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 7px;
    white-space: nowrap;
}

.home-bus-detail-row {
    display: none;
    background: #f8fafc !important;
    border-bottom: 1.5px solid #bfdbfe;
}

.home-bus-detail-row.open {
    display: table-row;
}

.home-bus-stops {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
}

.home-bus-stops li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
}

.home-bus-stops li.passed {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
}

.home-bus-stops li.current-bus {
    background: #eff6ff;
    border: 1.5px solid #0284c7;
    color: #1e3a8a;
    font-weight: 800;
}

.home-bus-stops li.dest-ltia {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: #ffffff;
}

.home-bus-footer {
    background: #f8fafc;
    border-top: 1px solid #dbeafe;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.82rem;
    color: #475569;
}

/* Responsive Tablet & Mobile Cards for Homepage Bus Tab */
.home-bus-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    background: #ffffff;
}

.home-bus-mcard {
    border: 1.5px solid #dbeafe;
    border-radius: 14px;
    background: #ffffff;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 0;
}

.home-bus-mcard:hover {
    border-color: #60a5fa;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.08);
}

.home-bus-mcard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.home-bus-mcard-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.home-bus-mcard-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding-top: 6px;
    border-top: 1px dashed #dbeafe;
    font-size: 0.78rem;
    color: #475569;
}

.home-bus-mcard-detail {
    display: none;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.home-bus-mcard-detail.open {
    display: block;
}

@media (max-width: 991.98px) {
    .home-bus-chips-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .home-bus-chips-row::-webkit-scrollbar {
        display: none;
    }
    .home-bus-chip {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    .home-bus-controls {
        padding: 12px 14px;
    }
    .home-bus-dir-switch {
        width: 100%;
    }
    .home-bus-dir-btn {
        flex: 1;
        justify-content: center;
        font-size: 0.78rem;
        padding: 7px 8px;
    }
    .home-bus-search-box,
    .home-bus-search-group {
        width: 100%;
    }
    .home-bus-full-link {
        width: 100%;
        justify-content: center;
    }
    .home-bus-cards-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px;
        gap: 10px;
    }
}
