@import url("https://fonts.googleapis.com/css2?family=Saira:ital,wght@0,100..900;1,100..900&display=swap");

.saira-regular {
    font-family: "Saira", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    font-variation-settings: "wdth" 100;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: Saira;
}
#app {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#map {
    flex: 1;
    min-width: 0; /*  zapobiega „rozpychaniu” */
}

#sidebar {
    width: 360px;
    background: #fff;
    padding: 10px;
    border-right: 2px solid #ccc;
    display: flex;
    flex-direction: column;
    /*flex-shrink: 0;*/
    height: 100vh; /* 🔴 klucz */
    overflow-y: auto;
    overflow-x: hidden;
    transition:
        width 0.5s ease,
        padding 0.5s ease,
        border 0.5s ease;
    box-sizing: border-box;
}



#sidebar-ui {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /*padding:8px 10px;*/
    /*border-bottom:1px solid #ddd;*/
    background: #fff;
    margin-bottom: 8px;
    flex-shrink: 0;
}

/* SIDEBAR CLOSE */
/* ukryj checkbox */
#sidebar-toggle {
    display: none;
}

/* sidebar — tylko animacja (bez zmiany layoutu) */
#sidebar {
    transition: transform 0.25s ease;
}

/* zamknięty sidebar */
#sidebar-toggle:not(:checked) ~ #sidebar {
    width: 0;
    padding: 0;
    border: none; /*  usuwa kreskę */
    min-width: 0; /*  ważne przy flex */
    pointer-events: none; /*  ważne */
    overflow: hidden;
}

/* kontener dla X */
.header-top {
    display: flex;
    justify-content: flex-end; 
}

/* przycisk X w sidebarze */
#sidebar-close {
    /*position:static;*/
    /*display: flex;*/
    /*
    top: 10px;
    right: 10px;
    cursor: pointer;
    z-index: 2000;
    line-height: 1;
    */
    border: none;
    background: none;
    cursor: pointer;
    font-size: 18px;
}

/* burger NA MAPIE */
#sidebar-open {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2000;
    font-size: 20px;
    line-height: 1;
    background: #fff;
    padding: 5px 8px 8px 8px;
    border-radius: 4px;
    cursor: pointer;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    display: none;
}

/* pokaz burger TYLKO gdy sidebar zamknięty */
#sidebar-toggle:not(:checked) ~ #map #sidebar-open {
    display: block;
}

/* HEADER */
#sidebar-header {
    display: flex;
    flex-direction: column;
    border-bottom: 1px dotted #ccc;
    /*margin-top: 20px*/
    flex-shrink:0;
}

ul {
    padding-left: 0;
}

#sidebar-header h1 {
    font-size: 32px;
    line-height: 1;
    margin: 8px 0 16px 0;
}

#sidebar-header h2 {
    font-size: 12px;
    color: #2e7d32;
}

#sidebar-header p {
    font-size: 1rem;
    /*font-weight: 700;*/
    line-height: 1.2;
    margin: 0 0 16px 0;
    /*color: #2e7d32;*/
    color: #333;
}

#sidebar-header p strong {
    color: #2e7d32;
}

ul.layer-list {
    margin-bottom: 10px;
}

#layer-groups{
  /*flex:1;*/
  overflow:visible;
  /*min-height:0;*/
}

.layer-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
}

/* LEGENDA WARSTWY */
.layer-legend{
  display:block;
  width:100%;
  margin-top:6px;
  margin-left:22px;
  clear:both;
}

/*
.layer-legend img{
  max-width:100%;
  display:block;
}*/

/* FOOTER */
#sidebar-footer {
    width: 330px;
    margin-top: auto;
    flex-shrink:0;
}
#sidebar-footer img {
    width: 330px;
    height: 35px;
    display: block;
    margin-top: 20px;
}
#sidebar-footer p {
    display: block;
    margin-top: 20px;
    font-size: 0.7rem;
    line-height: 1.2;
}
#sidebar-footer p.info a {
    color: #2e7d32;
    font-weight: 500;
    text-decoration: none;
}

#sidebar-footer p.link a {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 8px;
    border-radius:4px;
    background:#ddd;
    color:#222;
    text-decoration:none;
    font-size:12px;
    font-weight:400;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

#sidebar-footer p.link a:hover{
    background:#2e7d32;
    color:#fff;
    transform:translateY(-1px);
}

#sidebar-footer p.link a:active{

    transform:translateY(0);
}

/*
#sidebar-footer .footer-btn {
    text-decoration: none;
}
*/

/* GROUP */
.group {
    border-bottom: 1px dotted #ccc;
    margin-bottom: 10px;
}

.group-title {
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    padding-right: 20px;
    margin: 10px 0;
    display:flex;
  align-items:center;
  gap:8px;
}

/* ARROWS (▶ / ▼)  */
.group-title::after {
    content: "";
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid #333;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}
.group:not(.collapsed) .group-title::after {
    transform: translateY(-50%) rotate(90deg);
}
.group.collapsed .group-body {
    display: none;
}

.group-icon{
  width:16px;
  height:16px;

  flex-shrink:0;
}

/* LAYERS */
.layer-list {
    list-style: none;
}
.layer-list li {
    display: block;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}
.layer-list li label {
    font-size: 0.8rem;
}

#sidebar .single-content ul {
    padding-left: 0;
}

#app #sidebar ul {
    margin: 10px 0 10px 0;
}

/* INFO ICON – piktogram (bez tekstu) */
.info-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #999;
    position: relative;
    cursor: pointer;
    margin-right: 2px;
    pointer-events:auto !important;
  z-index:9999;
}
.info-icon::before {
    content: "";
    position: absolute;
    width: 2px;
    height: 5px;
    background: #fff;
    left: 50%;
    top: 5px;
    transform: translateX(-50%);
}
.info-icon::after {
    content: "";
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    left: 50%;
    top: 2px;
    transform: translateX(-50%);
}

/* OPACITY */
.opacity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 14px;
}

.opacity-row input {
    width: 180px;
}

/* label */
.opacity-label {
    font-size: 12px;
    color: #555;
    margin-top: 8px;
    margin-bottom: 2px;
}

/* ===== RESET (KLUCZOWE dla Safari) ===== */
.opacity-row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 150px;
    height: 10px;
    background: transparent;
    margin-right: 4px;
    padding: 0;
    cursor: pointer;
}

/* ===== TRACK ===== */
.opacity-row input[type="range"]::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    height: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: transparent;
}

.opacity-row input[type="range"]::-moz-range-track {
    height: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: transparent;
}

/* ===== THUMB (Safari + Chrome) ===== */
.opacity-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;

    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
    border: none;

    margin-top: -1px; /* centrowanie */

    /* usuwa "martwe marginesy" */
    /*position: relative;*/
    /*z-index: 2;*/
}

/* ===== THUMB (Firefox) ===== */
.opacity-row input[type="range"]::-moz-range-thumb {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
    border: none;
}

/* ===== USUNIĘCIE DODATKOWYCH OFFSETÓW ===== */
.opacity-row input[type="range"]::-webkit-slider-container {
    padding: 4px;
}

.opacity-row input[type="range"]:focus {
    outline: none;
}
.opacity-row span {
    font-size: 0.8rem;
}

/* HEIGHT BOX */
#elevationBox {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    padding: 6px;
    z-index: 1000;
    font-size: 12px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.reset-zoom-btn {
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 4px;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.reset-zoom-btn:hover svg {
    opacity: 0.7;
}

/* LANG SWITCH */
#lang-switch {
    display: flex;
    /*position:relative;*/
    gap: 10px;
    /*padding:8px;*/
    background: #fff;
    pointer-events: auto;
}

#lang-switch button {
    border: none;
    background: #ddd;
    padding: 3px 8px;
    cursor: pointer;
    border-radius: 4px;
    pointer-events: auto;
    font-size: 10px;
}

#lang-switch button:hover {
    color: #fff;
    background: #2e7d32;
}

/* IDENTIFY */
.identify-box{
  position:absolute;
  top:10px;
  left:10px;
  width:320px;
  background:#fff;
  border-radius:0;
  padding:12px;
  box-shadow:0 2px 12px rgba(0,0,0,.2);
  z-index:1000;
}

.identify-box.hidden{
  display:none;
}

.identify-box hr {
    border-top: 1px dotted #ccc;
}

#identifyClose{
  position:absolute;
  right:8px;
  top:8px;
  border:none;
  background:none;
  cursor:pointer;
}

/* LOADING */
#map {
    position:relative;
}

#mapLoading {

    position:absolute;

    top:50%;
    left:50%;

    width:36px;
    height:36px;

    margin-left:-18px;
    margin-top:-18px;

    z-index:999999;

    display:none;

    pointer-events:none;
}

#mapLoading::after{

    content:"";

    display:block;

    width:36px;
    height:36px;

    border-radius:50%;

    border:5px solid rgba(255,255,255,0.35);

    border-top-color:#111;

    animation:spin 1s linear infinite;
}

@keyframes spin{

    from{
        transform:rotate(0deg);
    }

    to{
        transform:rotate(360deg);
    }
}


/* LAYER GROUP URL */

.group-link{
    display:inline-flex;
    vertical-align:super;
    margin-left:0;
    text-decoration:none;
    color:#666;
    transition:
        color .2s ease,
        transform .2s ease;
}

.group-link:hover{
    color:#2e7d32;
    transform:scale(1.2);
}

.group-link-icon{
    width:14px;
    height:14px;
    display:block;
}