/* ========== Globalne style pluginu City Districts ========== */
#citydistricts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-family: Arial, sans-serif;
}

.citydistricts-main,
.citydistricts-district,
.citydistricts-compare {
    background-color: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 3rem;
    width: 100%;
}

/* Zapewnia wewnętrzny padding tylko raz — w głównym kontenerze */
.citydistricts-main > *,
.citydistricts-district > *,
.citydistricts-compare > * {
    padding: 10px;
}

/* ========== Nagłówki ========== */
h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
}

/* ========== Mapa SVG ========== */
#citydistricts-map,
#district-details,
#compare-panel {
    display: block;
    //width: 100%;
    max-width: 100%;
    min-height: 600px;
    overflow: visible;
    position: relative;
    z-index: 1;
    background: white;
    border-radius: 4px;
	margin-left: 10px;
	margin-right: 10px;
}

#citydistricts-map {
    position: relative;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}


#district-details svg,
#compare-panel svg {
    display: block;
    width: 50%;
    height: auto;
    max-width: 50%;
    min-height: 500px;
    margin-top: 1rem;
    margin-left: auto;
    margin-right: auto;
}


#citydistricts-map svg {
    display: block;
    width: 70%;
    height: auto;
    max-width: 100%;
    min-height: 600px;
    margin-top: 1rem;
    margin-left: auto;
    margin-right: auto;
}


.district {
    cursor: pointer;
    transition: fill 0.3s;
}

.district:hover {
    stroke: #333;
    stroke-width: 1.5;
}

.district.aktywna {
    fill: #007bff;
    stroke: #0056b3;
    stroke-width: 2;
}

/* ========== Dropdown wyboru parametru ========== */
#citydistricts-controls {
    margin-bottom: 1rem;
}

#citydistricts-parameter-select {
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* ========== Buttony dzielnic ========== */

.district-buttons {
    margin-top: 10px;
}

.district-buttons h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.district-buttons-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.district-button {
    padding: 4px 7px 2px 7px;
	background: #ffffff;
    border: 1px solid #0056b3;
    color: #0056b3;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
}

.district-button.active {
    background-color: #007bff;
    color: #fff;
    font-weight: normal;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #007bff;
}


.district-button:hover {
    background: #0056b3;
    color: white;
}


/* ========== Buttony parametrow ========== */

#citydistricts-controls {
    margin-bottom: 2rem;
}

#citydistricts-year-select h2,
#citydistricts-controls h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}


.parameter-buttons {
    flex-grow: 1;
    overflow-y: auto;
    padding-top: 8px;
}

.parameter-button {
    padding: 4px 7px 2px 7px;
    background: #fff;
    border: 1px solid #0056b3;
    color: #0056b3;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.parameter-button:hover {
    background: #0056b3;
    color: #fff;
}

.parameter-button.active {
    background: #007bff;
    color: white;
    font-weight: normal;
    border-color: #007bff;
}



/* ========== Buttony przejsc ========== */

.compare-button {
    padding: 4px 7px 2px 7px;
	background: #e94c0a;
    color: white;
    font-weight: normal;
	border: 2px solid #e94c0a;
}

.compare-button:hover {
    background: #c43c06;
    color: #fff;
	border: 2px solid #c43c06;
}

.parameter-table td svg {
  display: block;
  max-width: 100px;
  height: auto;
}
.parameter-table td {
  vertical-align: middle;
}

.parameter-table td svg {
  display: block;
  margin: 0 auto;
}


.parameter-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.parameter-table th,
.parameter-table td {
    border: 1px solid #ddd;
    padding: 0.5rem;
}

.parameter-table th {
    background: #f0f0f0;
    text-align: left;
}

.parameter-group-toggle {
    cursor: pointer;
    font-weight: bold;
    background: #eee;
    padding: 0.5rem;
    margin-top: 1rem;
    border-radius: 4px;
    transition: background 0.3s;
	font-size: 1rem;
}

.parameter-group-toggle:hover {
    background: #ddd;
}

.parameter-group-toggle.open {
    background: #d0e0ff;
}

.parameter-table.hidden {
    display: none;
}


/* ========== Buttony okresu ========== */


#citydistricts-year-select,
#citydistricts-controls {
    margin-bottom: 10px;
}

.year-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.year-button {
    padding: 4px 7px 2px 7px;
    background: #fff;
    border: 1px solid #0056b3;
	color: #0056b3;
    border-radius: 4px;
    cursor: pointer;
    font-weight: normal;
    transition: all 0.2s ease;
}

.year-button:hover {
    background: #0056b3;
    color: #fff;
}

.year-button.active {
    background: #007bff;
    color: white;
    font-weight: normal;
    border-color: #007bff;	
}


#citydistricts-main-columns {
    display: flex;
    gap: 20px;
    align-items: flex-start; /* <--- zamiast stretch */
    margin-top: 20px;
}


#citydistricts-map-wrapper {
    flex: 1 1 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 4px;
    padding: 20px;
    height: 780px; /* <- STAŁA wysokość */
    box-sizing: border-box;
}


#citydistricts-sidebar {
    flex: 0 0 260px;
    height: 780px; /* Taka sama jak mapa */
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;

    /* Scrollbar – Firefox */
    scrollbar-width: thin;
    scrollbar-color: #aaa transparent;
}

/* Scrollbar – Chrome, Edge, Safari */
#citydistricts-sidebar::-webkit-scrollbar {
    width: 6px;
}
#citydistricts-sidebar::-webkit-scrollbar-thumb {
    background-color: #aaa;
    border-radius: 4px;
}
#citydistricts-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#citydistricts-sidebar h2 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
    margin: 10px 0 6px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
}

/* Modyfikujemy istniejącą klasę, ale tylko wewnątrz sidebar */
#citydistricts-sidebar .parameter-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#citydistricts-sidebar .parameter-button {
    width: 100%;
    text-align: left;
}


@media (max-width: 768px) {
    #citydistricts-main-columns {
        flex-direction: column;
    }

    #citydistricts-sidebar {
        width: 100%;
        max-height: none;
    }

    #citydistricts-sidebar .parameter-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    #citydistricts-sidebar .parameter-button {
        width: auto;
    }
	
	#citydistricts-map svg {
        width: 100%;
        min-height: 400px;
    }
}
.parameter-button {
    white-space: normal; /* umożliwia łamanie wierszy */
    word-break: break-word; /* łamie długie wyrazy */
    line-height: 1.2;
    padding: 6px 8px;
    min-height: 36px;
}



#citydistricts-sidebar .parameter-button {
    width: 100%;
    text-align: left;
}

.param-group-header {
    font-weight: bold;
    background: #e6e6e6;
    padding: 6px 8px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.param-group-header:hover {
    background: #dcdcdc;
}

.param-group-header.open {
    background: #cce0ff;
}

.param-group-body {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.param-group-body.hidden {
    display: none;
}
