@import url("search_styles.css"); /* Importuj style wyszukiwania */


html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Zapobiega pojawianiu się pasków przewijania na body */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #1a1a1a; /* Ciemne tło główne */
    color: #e0e0e0; /* Jasny kolor tekstu */
    display: flex; /* Umożliwia #map-container wypełnienie przestrzeni */
    flex-direction: column;
}

#map-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 1;
}
#tracking-panel {
    /* ...Twój styl... */
    z-index: 1005;
}

#controls-overlay {
    position: fixed; /* Pozycjonowanie na mapie */
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(44, 44, 44, 0.9); /* Półprzezroczyste tło */
    backdrop-filter: blur(5px); /* Efekt rozmycia tła (działa w nowoczesnych przeglądarkach) */
    -webkit-backdrop-filter: blur(5px); /* Dla Safari */
    padding: 10px 15px;
    border-radius: 8px 8px 0 0; /* Zaokrąglenie tylko górnych rogów */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3); /* Cień na górze */
    display: flex;
    justify-content: space-between; /* Rozłożenie elementów */
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.95rem;
    z-index: 1000; /* Aby było nad mapą, ale pod popupami Leaflet (domyślnie popupy mają wyższy z-index) */
    color: #e0e0e0;
    gap: 10px; /* Odstęp między grupami kontrolek */
}

/* Glassmorphism dla panelu dolnego */
#controls-overlay {
    background: rgba(34, 40, 49, 0.38);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1.5px solid rgba(255,255,255,0.13);
    border-radius: 18px 18px 0 0;
    color: #e0e0e0;
    transition: background 0.3s, box-shadow 0.3s;
}

#controls-overlay .brand-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-right: auto; /* Wypycha inne elementy na prawo */
    white-space: nowrap; /* Zapobiega łamaniu tekstu */
}

#controls-overlay .brand-title a {
    color: #58a6ff;
    text-decoration: none;
}
#controls-overlay .brand-title a:hover {
    text-decoration: underline;
}

#controls-overlay .brand-title span {
    font-weight: normal;
    font-size: 0.9em;
    opacity: 0.8;
}

#controls-overlay .filters,
#controls-overlay .actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0; /* Zapobiega kurczeniu się tych sekcji */
}
#controls-overlay .actions button#open-menu-btn {
    background-color: #6c757d; /* Inny kolor dla przycisku menu */
    padding: 0.5em 0.8em;
}

#controls-overlay .actions button#open-menu-btn:hover {
    background-color: #5a6268;
}


#controls-overlay button {
    padding: 0.5em 1em;
    background-color: #007bff; /* Kolor przycisku może pozostać jasny dla kontrastu */
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#controls-overlay button:hover {
    background-color: #0069d9;
}

#controls-overlay button:active {
    transform: translateY(1px);
}

#controls-overlay label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap; /* Zapobiega łamaniu tekstu w etykietach */
}

#controls-overlay input[type="checkbox"] {
    margin-right: 5px;
    accent-color: #007bff; /* Kolor zaznaczenia checkboxa */
    width: 16px; /* Ustawienie stałej szerokości */
    height: 16px; /* Ustawienie stałej wysokości */
}

#last-updated {
    font-size: 0.85em;
    opacity: 0.7;
    white-space: nowrap;
}

#locate-me-btn {
    margin-left: 8px;
    background: #222e3a;
    color: #58a6ff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.1s;
    cursor: pointer;
    outline: none;
    padding: 0;
}

#locate-me-btn i {
    margin: 0;
    font-size: 1.1em;
    color: #58a6ff;
    pointer-events: none;
}

#locate-me-btn:hover, #locate-me-btn:focus {
    background: #2a3a4d;
    color: #fff;
    box-shadow: 0 4px 16px rgba(88,166,255,0.18);
    transform: scale(1.08);
}

/* Styl dla kafelków mapy w trybie ciemnym - Leaflet domyślnie nie ma ciemnego motywu dla kafelków OpenStreetMap */
/* Można użyć wtyczki lub dostawcy kafelków z ciemnym motywem, np. CartoDB Dark Matter */
.leaflet-tile-pane {
    /* filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9); */ /* Prosty filtr, może pogorszyć czytelność etykiet */
}

/* Dostosowanie kontrolek zoomu Leaflet do ciemnego motywu */
.leaflet-control-zoom a {
    background-color: #2c2c2c !important;
    color: #e0e0e0 !important;
    border-bottom: 1px solid #444 !important;
}
.leaflet-control-zoom a:hover {
    background-color: #383838 !important;
}

/* Dostosowanie informacji o atrybucji Leaflet */
.leaflet-control-attribution {
    background: rgba(26, 26, 26, 0.75) !important; /* Ciemniejsze i bardziej przezroczyste tło */
    color: #bbbbbb !important;
    font-size: 10px; /* Mniejsza czcionka dla atrybucji */
    padding: 2px 6px !important;
}
.leaflet-control-attribution a {
    color: #58a6ff !important;
}

/* Style dla nakładki Menu */
#app-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Półprzezroczyste tło */
    z-index: 2000; /* Wyżej niż kontrolki mapy */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#app-menu-overlay.menu-overlay-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

/* Glassmorphism dla menu */
.menu-content {
    background: rgba(34, 40, 49, 0.38);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1.5px solid rgba(255,255,255,0.13);
    border-radius: 18px;
    color: #e0e0e0;
    transition: background 0.3s, box-shadow 0.3s;
}

.menu-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #404040;
    background-color: #262626;
    border-radius: 8px 8px 0 0;
}

.menu-logo {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
    display: flex;
    align-items: center;
}

.menu-logo .logo-icon {
    margin-right: 8px;
    font-size: 1.2em;
    color: #99cc00;
    line-height: 1;
}

.menu-logo span {
    color: #99cc00;
}

.menu-close-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}
.menu-close-btn:hover {
    color: #99cc00;
}

.menu-container {
    padding: 20px;
    overflow-y: auto; /* Przewijanie jeśli zawartość jest za długa */
}

.menu-section {
    margin-bottom: 30px;
    text-align: center;
}
.menu-section:last-child {
    margin-bottom: 0;
}

.menu-section h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #9e9e9e;
    margin: 0 auto 15px auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #404040;
    padding-bottom: 8px;
}
.menu-section h2 i {
    font-size: 1em;
}

/* Glassmorphism dla .menu-section */
.menu-section {
    background: rgba(34, 40, 49, 0.28);
    border-radius: 14px;
    box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.10);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.10);
    margin-bottom: 30px;
    padding: 12px 0;
}

.grid-menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 12px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #262626;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    color: #e0e0e0;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.15s ease-in-out;
    position: relative;
    min-height: 100px;
}

/* Glassmorphism dla przycisków */
#controls-overlay button,
#controls-overlay .actions button,
.menu-close-btn,
.menu-section .grid-item {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 2px 8px rgba(31,38,135,0.10);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    color: #e0e0e0;
    transition: background 0.2s, box-shadow 0.2s;
}
#controls-overlay button:hover,
#controls-overlay .actions button:hover,
.menu-close-btn:hover,
.menu-section .grid-item:hover {
    background: rgba(255,255,255,0.18);
    color: #232d3a;
}

.grid-item:hover {
    background-color: #333333;
    border-color: #99cc00;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
    color: #99cc00;
}
.grid-item i.icon {
    font-size: 1.7em;
    margin-bottom: 8px;
    color: #9e9e9e;
    transition: color 0.15s ease-in-out;
}
.grid-item:hover i.icon {
    color: #99cc00;
}
.grid-item span.label {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    color: inherit;
    display: block;
}
.grid-item .external-link-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7em;
    color: #6b6b6b;
}

.menu-footer-note {
    text-align: center;
    margin-top: 25px;
    font-size: 11px;
    color: #6b6b6b;
    border-top: 1px solid #404040;
    padding-top: 15px;
}
.menu-footer-note a {
    color: #9e9e9e;
}
.menu-footer-note a:hover {
    color: #99cc00;
}

.brand-link {
    font-weight: bold;
    font-size: 1.12em;
    letter-spacing: 0.5px;
    text-decoration: none;
}
.brand-twoja {
    color: #fee300;
}
.brand-trasa {
    color: #49f300;
}
.brand-link:visited .brand-twoja { color: #fee300; }
.brand-link:visited .brand-trasa { color: #49f300; }

/* Nowy pasek przycisków na dole ekranu */
#controls-bar {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 18px;
    background: rgba(34, 40, 49, 0.72);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1.5px solid rgba(255,255,255,0.13);
    border-radius: 18px;
    padding: 8px 18px;
    z-index: 1100;
}

#controls-bar button {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.45em;
    padding: 7px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    outline: none;
    position: relative;
}
#controls-bar button.active,
#controls-bar button:focus,
#controls-bar button:hover {
    background: rgba(255,255,255,0.13);
    color: #fee300;
    box-shadow: 0 2px 8px rgba(31,38,135,0.10);
}

#controls-bar button#open-menu-btn {
    color: #49f300;
}
#controls-bar button#open-menu-btn:hover {
    color: #fee300;
}

@media (max-width: 600px) {
    #controls-bar {
        gap: 10px;
        padding: 6px 6vw;
        border-radius: 14px;
        bottom: 8px;
    }
    #controls-bar button {
        font-size: 1.15em;
        padding: 6px 7px;
        border-radius: 8px;
    }
}

/* Ukryj stary panel dolny */
#controls-overlay {
    display: none !important;
}

/* Media query dla mniejszych ekranów, aby kontrolki lepiej się układały */
@media (max-width: 768px) {
    #controls-overlay {
        flex-direction: column;
        align-items: flex-start; /* Wyrównaj do lewej na małych ekranach */
        padding: 8px;
    }

    #controls-overlay .brand-title {
        margin-right: 0;
        margin-bottom: 8px; /* Odstęp pod tytułem */
        width: 100%; /* Tytuł na całą szerokość */
        text-align: center; /* Wyśrodkuj tytuł */
    }

    #controls-overlay .filters,
    #controls-overlay .actions {
        width: 100%; /* Filtry i akcje na całą szerokość */
        justify-content: space-around; /* Rozłóż elementy w filtrach i akcjach */
        margin-bottom: 5px;
    }
    #controls-overlay .actions {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    #controls-overlay .filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    #controls-overlay .actions {
         flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    #controls-overlay button {
        width: 100%;
        max-width: 200px; /* Ogranicz szerokość przycisku */
        margin: 0 auto; /* Wyśrodkuj przycisk */
    }
    #last-updated {
        text-align: center;
        width: 100%;
    }
}

/* Poprawiony panel dolny na telefonach */
@media (max-width: 600px) {
    #controls-overlay {
        width: 90vw !important;
        left: 5vw !important;
        right: 5vw !important;
        bottom: 3vw !important;
        border-radius: 16px !important;
        padding: 6px 4vw 4px 4vw !important;
        gap: 4px !important;
    }
    #controls-overlay .brand-title {
        font-size: 1em !important;
        margin-bottom: 1px !important;
    }
    #controls-overlay .filters,
    #controls-overlay .actions {
        font-size: 0.9em !important;
        gap: 5px !important;
        margin-bottom: 1px !important;
    }
    #controls-overlay .filters label,
    #controls-overlay .actions button,
    #controls-overlay label {
        font-size: 0.9em !important;
    }
    #controls-overlay button,
    #controls-overlay .actions button {
        min-width: 22px !important;
        height: 22px !important;
        font-size: 0.9em !important;
        padding: 2px 6px !important;
        border-radius: 4px !important;
    }
    #controls-overlay .actions button#open-menu-btn {
        font-size: 1em !important;
        padding: 2px 8px !important;
        min-width: 32px !important;
        height: 24px !important;
    }
    #last-updated {
        font-size: 0.7em !important;
        padding: 0 1px !important;
        margin: 0 0 1px 0 !important;
    }
}

@media (max-width: 600px) {
    #map-container {
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        position: fixed !important;
        top: 0; left: 0;
        z-index: 1;
    }
    body, html {
        overflow: hidden !important;
        height: 100vh !important;
        margin: 0;
        padding: 0;
    }
    #controls-overlay {
        width: 100vw;
        left: 0;
        right: 0;
        border-radius: 0 0 12px 12px;
        padding: 0 2vw;
        box-sizing: border-box;
    }
    .menu-content, .menu-section .container {
        padding: 0 2vw !important;
    }
    .actions button, #locate-me-btn {
        min-width: 32px;
        height: 32px;
        font-size: 1em;
        padding: 4px 8px;
    }
    .filters label {
        font-size: 1em;
    }
}

/* Glassmorphism dla menu (podstrony) na telefonach i desktopie */
.menu-content,
.menu-section {
    background: rgba(34, 40, 49, 0.55) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.22), 0 2px 8px rgba(0,0,0,0.10) !important;
    backdrop-filter: blur(18px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(160%) !important;
    border: 1.5px solid rgba(255,255,255,0.18) !important;
    border-radius: 22px !important;
    color: #f0f0f0 !important;
    transition: background 0.3s, box-shadow 0.3s;
}

/* Dodatkowe wzmocnienie efektu na telefonach */
@media (max-width: 600px) {
    .menu-content,
    .menu-section {
        background: rgba(34, 40, 49, 0.72) !important;
        border-radius: 18px !important;
        padding: 8px 2vw !important;
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25), 0 2px 8px rgba(0,0,0,0.13) !important;
    }
    .menu-section h2 {
        background: none !important;
        border-radius: 10px !important;
        padding: 8px 0 !important;
        margin-bottom: 10px !important;
    }
    .container, .content-section {
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Zdefiniuj kolor dla wszystkich stanów linku, będąc bardziej specyficznym */
a.favorite-item-link,
a.favorite-item-link:link,
a.favorite-item-link:visited {
    color: white; /* Ustawiamy biały kolor dla linku normalnego i odwiedzonego */
    text-decoration: none;
    flex-grow: 1;
    transition: color 0.2s ease;
}

/* Upewnij się, że tekst w <strong> wewnątrz linku również jest biały */
a.favorite-item-link strong {
    color: white;
}

/* Styl dla najechania myszką pozostaje ten sam */
a.favorite-item-link:hover {
    color: var(--accent);
    text-decoration: none;
}

/* Dodatkowe style dla linków w ulubionych */
#favorites-view-section .content-section ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5px; /* Dopasuj padding wedle uznania */
    border-bottom: 1px solid var(--border-color);
}
#favorites-view-section .content-section ul li:last-child {
    border-bottom: none;
    }
    .favorite-item-link {
        color: white !important; /* Tylko do testów! */
        text-decoration: none;
        flex-grow: 1;
        transition: color 0.2s ease;
    }
    .favorite-item-link:hover {
        color: var(--accent);
        text-decoration: none;
    }
    .favorite-remove-btn {
        flex-shrink: 0; /* Aby przycisk nie kurczył się */
    }

    /* Dodatkowe style dla markerów pojazdów z kierunkiem */
.vehicle-marker-wrapper {
    position: relative; /* Umożliwia pozycjonowanie strzałki względem tego kontenera */
    display: flex;
    flex-direction: column; /* Ustawia elementy (pojazd, strzałka) jeden pod drugim */
    align-items: center;  /* Wyśrodkowuje elementy w poziomie */
}

.vehicle-marker-image {
    width: 32px; /* Dopasuj do vehicleIconSize z JS */
    height: 32px; /* Dopasuj do vehicleIconSize z JS */
    display: block;
    transform-origin: center center; /* Obrót wokół środka obrazka */
}

.vehicle-marker-arrow {
    width: 16px;  /* Dopasuj do arrowIconSize z JS */
    height: 16px; /* Dopasuj do arrowIconSize z JS */
    display: block;
    margin-top: 2px; /* Odstęp między pojazdem a strzałką, dopasuj do gapBetweenIcons z JS */
    transform-origin: center center; /* Obrót wokół środka strzałki */
}

/* Opcjonalnie, aby upewnić się, że tło divIcon jest przezroczyste */
.vehicle-div-icon {
    background: transparent !important;
    border: none !important;
}


}