/*
=========================================================
BOR BUS APP
style.css
Kompletan refresh za trenutni UI:
- dark theme
- search inputs sa autocomplete dropdown overlay
- bolji spacing
- bez ružnog pomeranja layouta kad se kuca
- lepše kartice rezultata
- badge stilovi
- favorite dugmad za stanice
=========================================================
*/

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top, rgba(62, 82, 255, 0.16), transparent 32%),
        linear-gradient(180deg, #03112b 0%, #04142f 100%);
    color: #ffffff;
}

body {
    display: flex;
    justify-content: center;
    padding: 32px 16px;
}

/* =========================================================
   APP CONTAINER
========================================================= */

.app {
    width: 100%;
    max-width: 760px;
    padding: 28px 20px 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    background: rgba(10, 23, 54, 0.9);
    box-shadow:
        0 16px 44px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
}

#title {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    letter-spacing: 0.2px;
}

/* =========================================================
   CONTROLS
========================================================= */

.controls-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    margin-bottom: 14px;
}

.station-picker {
    flex: 1;
    min-width: 0;
}

.station-picker label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

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

.station-input-wrap input,
.day-mode-select {
    width: 100%;
    height: 54px;
    padding: 0 52px 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 16px;
    background: #25304b;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.station-input-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.station-input-wrap input:focus,
.day-mode-select:focus {
    border-color: rgba(92, 116, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(92, 116, 255, 0.16);
    background: #293553;
}

/* =========================================================
   FAVORITE BUTTON
========================================================= */

.favorite-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
    z-index: 3;
}

.favorite-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffd76a;
}

.favorite-btn:active {
    transform: translateY(-50%) scale(0.96);
}

.favorite-btn.active {
    background: rgba(255, 215, 106, 0.14);
    color: #ffd76a;
    box-shadow: inset 0 0 0 1px rgba(255, 215, 106, 0.18);
}

.favorite-btn:focus {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(92, 116, 255, 0.16),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* =========================================================
   SWAP BUTTON
========================================================= */

.swap-btn {
    width: 50px;
    height: 50px;
    margin-top: 31px;
    flex: 0 0 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: #27324c;
    color: #ffffff;
    font-size: 22px;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.swap-btn:hover {
    background: #314061;
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.swap-btn:active {
    transform: translateY(0);
}

#showBuses {
    width: 100%;
    height: 56px;
    margin-top: 6px;
    margin-bottom: 14px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(180deg, #3b49ff 0%, #2f3bf4 100%);
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(47, 59, 244, 0.28);
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

#showBuses:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 14px 30px rgba(47, 59, 244, 0.32);
}

#showBuses:active {
    transform: translateY(0);
}

#showBuses:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.day-mode-select {
    margin-bottom: 14px;
    cursor: pointer;
    padding-right: 16px;
}

/* =========================================================
   AUTOCOMPLETE DROPDOWN
========================================================= */

.suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 1000;

    display: flex;
    flex-direction: column;
    gap: 6px;

    max-height: 280px;
    overflow-y: auto;
    padding: 8px;

    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    background: #18223b;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.35),
        0 6px 18px rgba(0, 0, 0, 0.2);
}

.suggestions::-webkit-scrollbar {
    width: 10px;
}

.suggestions::-webkit-scrollbar-track {
    background: transparent;
}

.suggestions::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.suggestion-item {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    background: #3240f5;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition:
        transform 0.12s ease,
        background 0.12s ease,
        filter 0.12s ease;
}

.suggestion-item:hover,
.suggestion-item:focus {
    background: #4150ff;
    filter: brightness(1.03);
    transform: translateY(-1px);
}

.suggestion-item:active {
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

/* =========================================================
   RESULTS
========================================================= */

#busList {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

#busList li::marker {
    content: "";
}

.route-header {
    width: 100%;
    max-width: 610px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: #24304a;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}

.bus-item {
    width: 100%;
    max-width: 610px;
    padding: 16px 18px 15px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: #27324b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    text-align: center;
}

.bus-item strong {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 17px;
    line-height: 1.3;
    text-align: center;
}

.bus-item > div {
    margin-bottom: 6px;
    color: #f3f6ff;
    font-size: 16px;
    line-height: 1.4;
    text-align: center;
}

.bus-item > div:last-child {
    margin-bottom: 0;
}

.bus-meta {
    color: rgba(255, 255, 255, 0.72) !important;
    font-size: 14px !important;
    text-align: center !important;
}

/* =========================================================
   BADGES
========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto 0;
    padding: 7px 12px;
    min-height: 30px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.badge-soon {
    background: rgba(42, 201, 125, 0.18);
    color: #91ffc8;
    border: 1px solid rgba(42, 201, 125, 0.22);
}

.badge-tomorrow {
    background: rgba(255, 213, 90, 0.14);
    color: #ffe28f;
    border: 1px solid rgba(255, 213, 90, 0.18);
}

/* =========================================================
   META / FOOTER TEXT
========================================================= */

.small {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

#hint {
    margin-top: 16px;
}

#meta {
    margin-top: 8px;
}

/* =========================================================
   BEST TRIP CARD
========================================================= */

.best-trip {
    margin-top: 16px;
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid rgba(64, 90, 255, 0.25);
    border-radius: 18px;
    background: rgba(43, 57, 121, 0.45);
}

.best-title {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 800;
}

.best-sub {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 14px;
}

/* =========================================================
   EMPTY / FALLBACK STATES
========================================================= */

#busList li:not(.route-header):not(.bus-item) {
    padding: 16px 18px;
    border-radius: 16px;
    background: #24304a;
    color: #ffffff;
}

/* =========================================================
   PAUSE NOTE
========================================================= */

.pause-note {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(255, 200, 80, 0.08);
    color: #21ec0f !important;
    font-size: 13px !important;
    font-weight: 700;
    display: inline-block;
    width: fit-content;
    text-align: center;
}

.bus-item .badge {
    display: flex;
    width: fit-content;
    margin: 10px auto 0;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 640px) {
    body {
        padding: 16px 10px;
    }

    .app {
        padding: 22px 14px 20px;
        border-radius: 18px;
    }

    #title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .controls-row {
        gap: 10px;
    }

    .station-picker label {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .station-input-wrap input,
    .day-mode-select {
        height: 48px;
        font-size: 15px;
        padding: 0 46px 0 14px;
        border-radius: 14px;
    }

    .favorite-btn {
        right: 8px;
        width: 30px;
        height: 30px;
        font-size: 16px;
        border-radius: 9px;
    }

    .swap-btn {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        margin-top: 28px;
        font-size: 18px;
    }

    #showBuses {
        height: 52px;
        font-size: 17px;
        border-radius: 14px;
    }

    .suggestions {
        max-height: 220px;
        padding: 7px;
        border-radius: 14px;
    }

    .suggestion-item {
        padding: 11px 12px;
        font-size: 14px;
        border-radius: 10px;
    }

    .route-header {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 14px;
    }

    .bus-item {
        padding: 14px 15px;
        border-radius: 16px;
    }

    .bus-item strong {
        font-size: 16px;
    }

    .bus-item > div {
        font-size: 15px;
    }

    .small {
        font-size: 13px;
    }
}

/* =========================================================
   INSTALL BANNER
========================================================= */

.install-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid rgba(92, 116, 255, 0.18);
    border-radius: 16px;
    background: rgba(45, 58, 111, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.install-banner-text {
    min-width: 0;
}

.install-banner-text strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
}

#installBannerSubtext {
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.4;
}

.install-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.install-btn,
.install-close-btn {
    border: none;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        filter 0.2s ease,
        background 0.2s ease;
}

.install-btn {
    min-width: 110px;
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: linear-gradient(180deg, #3b49ff 0%, #2f3bf4 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
}

.install-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.install-btn:active {
    transform: translateY(0);
}

.install-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 16px;
}

.install-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 640px) {
    .install-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .install-banner-actions {
        justify-content: space-between;
    }

    .install-btn {
        flex: 1;
    }
}

/* =========================================================
   SEARCH MODE / CUSTOM TIME
========================================================= */

.search-mode-wrap {
    margin-bottom: 14px;
}

.search-mode-label,
.custom-time-label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.search-mode-select,
.custom-time-input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 16px;
    background: #25304b;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.search-mode-select:focus,
.custom-time-input:focus {
    border-color: rgba(92, 116, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(92, 116, 255, 0.16);
    background: #293553;
}

.custom-time-wrap {
    margin-top: 12px;
}

@media (max-width: 640px) {
    .search-mode-select,
    .custom-time-input {
        height: 48px;
        font-size: 15px;
        border-radius: 14px;
    }

    .search-mode-label,
    .custom-time-label {
        font-size: 14px;
        margin-bottom: 6px;
    }
}