/* Base style */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    background-color: white;
    color: black;
}

/* App */
#app {
    display: flex;
    height: 90vh;
    width: 100%;
    overflow: hidden;
    transition: grid-template-columns 0.3s ease;
}

#app.sidebar-collapsed {
    display: flex;
}

#sidebar {
    background-image: url('images/szlak_wisly_background.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    padding: 20px;  
    width: 450px;
    height: 100%;
    padding: 14px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    overflow-y: auto;
    max-height: 100%;
    z-index: 1000;
}

#sidebar.collapsed {
    width: 0;
    padding: 0;
    border: none;
    overflow: hidden;
    transition: width 0.3s ease;
}

#toggleSidebar {
    position: absolute;
    top: 85px;
    left: 450px;
    z-index: 2000;
    color: black;
    border: none;
    padding: 6px 10px;
    border: 0 6px 6px 0;
    cursor: pointer;
    transition: left 0.3s ease;
}

#app.sidebar-collapsed #toggleSidebar {
    left: 0;
}

.btn {
    display: inline-block;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid;
    text-decoration: none;
    color: black;
}

.btn:hover {
    background: blue;
    text-decoration: none;
}


.section {
    margin-bottom: 14px;
}

.muted {
    color: #373838;
    font-size: 12px;
}

/* Legenda sidebar */

.legend-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2000;
    overflow-y: auto;
}

.legend-sidebar.show {
    transform: translateX(0);
}

.legend-sidebar h2 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    color: #333;
    font-size: 18px;
}

.legend-sidebar ul {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.legend-sidebar li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.legend-sidebar li img {
    width: 24px;
    height: 24px;
}

.legend-sidebar li span {
    color: #555;
    font-size: 14px;
}


.toggle-legend {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: white;
    color: black;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 2100;
    transition: background-color 0.3s;
}

.toggle-legend:hover {
    background-color:#0056b3;
}

/* buttons */

.open-gallery {
    display: inline-block; margin: 4px; padding: 6px 10px;
    position: center;
    background: #fff; border: 1px solid #d1d5db; border-radius: 8px; cursor: pointer;
    color: black;
    font-size: 13px;
    text-decoration: none;
}

.open-gallery:hover { background: #f3f4f6; text-decoration: none;}

.btn.cross {
    display: inline-block; margin: 4px; padding: 6px 10px;
    position: center;
    background: #7eabdb; 
    border: 1px solid #d1d5db; 
    border-radius: 8px; 
    cursor: pointer;
    color: #f2f2f2;
    font-size: 13px;
    text-decoration: none;
}

.btn.cross:hover { background: #f3f4f6; text-decoration: none;}

.btn.cross-btn {
    display: inline-block; margin: 4px; padding: 8px 12px;
    position: center;
    background: #f2f2f2; 
    border: 1px solid #d1d5db; 
    border-radius: 8px; 
    cursor: pointer;
    color: #2368a8;
    font-size: 13px;
    font-weight: 300;
    text-decoration: none;
}

.btn.cross-btn:hover { background: #2368a8; color: #f2f2f2;text-decoration: none;}

.cross-option {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.cross-option.btn {
    white-space: nowrap;
}

/* scrolling */

.scrolling {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid;
    border-radius: 6px;
    padding: 5px;
}

/* Main */

/* map */
main, #map {
    flex: 1;
    height: 100%;
}

.btn {
    display: inline-block; margin: 4px; padding: 6px 10px;
    position: center;
    background: #fff; border: 1px solid #d1d5db; border-radius: 8px; cursor: pointer;
    color: black;
    font-size: 13px;
    text-decoration: none;
}

.btn:hover { background: #f3f4f6; text-decoration: none;}

.legend {
    background: #ffffff; padding: 10px; border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); font-size: 14px; line-height: 18px;
}

.legend h4 { margin: 0 0 6px; font-size: 15px;}
.legend p { margin: 4px 0; display: flex; align-items: center; gap: 8px;}
.legend img {width: 20px; height: 20px; display: inline-block;}

.leaflet-popup-content {font-size: 14px;}
.leaflet-control-layers-expanded {max-height: 300px; overflow: auto;}

/* pop-ups */

.popup-icons {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    margin-top: 6px;
}

.popup-icons img {
    width: 40px;
    height: 40px;
}

/* tooltip - dymki z nazwami */

.leaflet-tooltip {
    border-radius: 12px;
    padding: 4px 8px;
    color: #2368A8;
    pointer-events: none;
}

/* Footer */
footer {
    display: flex;
    background-color: white;
    color: black;
    text-align: center;
    margin: 0%;
}

@media (max-width: 768px) {
    #app {
        flex-direction: column;
        height: 100vh;
    }
    
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background-color: #f2f2f2;
        overflow-y: auto;
        z-index: 9999;
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #toggleSidebar {
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 10000;
        display: block;
    }

    #legendSidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 260px;
        height: 100vh;
        transform: translateX(100%);
        z-index: 9999;
    }

    #legendSidebar.open {
        transform: translateX(0);
    }

    #toggleLegend {
        position: fixed;
        right: 20px;
        top: 20px;
        z-index: 10000;
        display: block;
    }

    #toggleSidebar, #toggleLegend {
        display: block;
    }

    main, #map {
        height: calc(100vh-60px);
        width: 100%;
    }

    footer {
        position: static;
        display: felx;
        justify-content: center;
        padding: 10px;
        background-color: #f3f4f6;
    }
    
    footer img {
        max-width: 50%;
    }
}