/* ==========================================
   1. PODSTAWY I UKŁAD MAPY
========================================== */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #111;
    color: #fff;
    overflow: hidden; 
}

#map {
    width: 100%;
    height: 100vh;
    z-index: 1;
}

/* ==========================================
   2. GÓRNY PASEK: ZEGAR, LOGO, MENU
========================================== */
#floating-ui {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none; 
}

#floating-ui > div {
    pointer-events: auto; 
}

#left-ui { flex: 1; display: flex; justify-content: flex-start; }
#center-ui { flex: 0 1 auto; display: flex; justify-content: center; }
#right-ui { flex: 1; display: flex; justify-content: flex-end; }

/* Twarde, identyczne wymiary dla wszystkich paneli w pasku nawigacji */
.ui-box {
    height: 46px; 
    min-width: 46px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3) !important;
    padding: 0 12px; 
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#clock {
    font-size: 17px;
    font-weight: bold;
}

#hamburger {
    font-size: 24px;
    cursor: pointer;
}

#logo img {
    height: 30px !important;
    display: block;
}

/* Na telefonach wymuszamy idealnie równe pomniejszenie */
@media (max-width: 480px) {
    .ui-box { height: 40px; min-width: 40px; padding: 0 10px; }
    #clock { font-size: 14px; }
    #logo img { height: 24px !important; }
    #hamburger { font-size: 20px; }
}

/* ==========================================
   3. MENU BOCZNE Z PRAWEJ STRONY
========================================== */
#sidebar {
    position: absolute;
    top: 0;
    right: -300px;
    width: 260px;
    height: 100%;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-left: 1px solid #333; 
    z-index: 1002;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

#sidebar.open {
    right: 0;
}

.sidebar-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    text-align: center;
}

.leaflet-control-layers {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: white !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.leaflet-control-layers-list {
    margin: 0 !important;
}

/* ==========================================
   4. STYLIZACJA DYMKÓW I IKON NA MAPIE
========================================== */
.leaflet-popup-content-wrapper {
    background: rgba(20, 20, 20, 0.9) !important;
    color: #fff !important;
    border: 1px solid #444;
    border-radius: 8px;
}
.leaflet-popup-tip {
    background: rgba(20, 20, 20, 0.9) !important;
}

.live-plane-icon div, .live-ship-icon div, .live-bus-icon div {
    transition: transform 1s linear;
}
.live-train-icon div, .ev-icon div, .smog-icon div, .river-icon div {
    transition: background-color 0.3s ease;
}

/* ==========================================
   5. BANER INSTALACJI PWA
========================================== */
#pwa-install-banner {
    display: none;
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    white-space: nowrap;
}

#pwa-install-banner:active {
    background: rgba(40, 167, 69, 0.8);
}
/* PASEK TĘTNA APLIKACJI */
#heartbeat-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: #dc3545;
    z-index: 9999;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px #dc3545;
}

/* NOWE LEWITUJĄCE KONTROLKI (GPS, ZOOM) */
#custom-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#custom-controls button {
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.2s, background 0.2s;
}

#custom-controls button:hover {
    transform: scale(1.05);
    background: rgba(40, 40, 40, 0.9);
}

#custom-controls button:active {
    transform: scale(0.95);
}