.map-wrapper {
    position: relative;
}
#map-back-button {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000; /* Upewnij się, że jest nad mapą */
    background-color: #fff;
    border: 2px solid #ccc;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
#map-back-button:hover {
    background-color: #f4f4f4;
}

.director-popup {
    font-family: 'Inter', sans-serif;
}
.popup-county-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #1a233b;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Karta z wizytówką dyrektora */
.director-card {
    display: flex;
    align-items: center;
    gap: 12px;
}
.director-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}
.director-details {
    display: flex;
    flex-direction: column;
}
.director-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}
.director-contact-link {
    font-size: 0.9rem;
    color: #ed4f00; /* Twój pomarańczowy akcent */
    text-decoration: none;
    line-height: 1.5;
}
.director-contact-link:hover {
    text-decoration: underline;
}

.leaflet-popup-content
{
    width: 350px !important;
}

.map-search-container {
    display: flex;
    margin-bottom: 1rem;
    max-width: 400px;
}
#map-search-input {
    flex-grow: 1;
    border: 2px solid #dee2e6;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 8px 0 0 8px;
    outline: none;
}
#map-search-input:focus {
    border-color: #141f33; /* Twój ciemnoniebieski kolor */
}
#map-search-btn {
    border: none;
    background-color: #141f33;
    color: white;
    padding: 0 1.25rem;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
}
#map-search-btn:hover {
    background-color: #ed4f00; /* Twój pomarańczowy akcent */
}

.interactive-map-wrapper {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
#directors-map-container {
    flex-grow: 1;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.map-controls {
    flex-shrink: 0;
    width: 280px;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.control-group {
    margin-bottom: 1.5rem;
}
.control-group:last-child {
    margin-bottom: 0;
}
.control-group h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}
.control-group label {
    font-weight: 500;
    font-size: 0.9rem;
}
.checkbox-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}
.checkbox-wrapper input {
    margin-right: 10px;
    height: 16px;
    width: 16px;
}
#filter-director {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    margin-top: 5px;
}
.map-legend {
    list-style: none;
    padding: 0; margin: 0;
}
.map-legend li {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}
.legend-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid rgba(0,0,0,0.1);
}
/* Responsywność */
@media (max-width: 992px) {
    .interactive-map-wrapper {
        flex-direction: column;
    }
    .map-controls {
        width: 100%;
    }
}

.map-wrapper {
    position: relative;
}

/* Pływający panel filtrów */
.floating-map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000; /* Upewnij się, że jest nad mapą */
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 280px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.is-open
{
 height: 80%;
}

/* Nagłówek panelu, który działa jak przycisk */
.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
}
.controls-header h5 {
    margin: 0;
    font-weight: 600;
    color: #141f33;
}
.controls-header h5 i {
    margin-right: 10px;
    color: #ed4f00;
}
.toggle-arrow {
    transition: transform 0.3s ease;
}

/* Treść panelu, która się rozwija */
.controls-body {
    padding: 0 1rem 1rem;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.2s ease, padding 0.3s ease;
    border-top: 1px solid #f0f0f0;
}
.control-group { margin-bottom: 1rem; }
.control-group:last-child { margin-bottom: 0; }
.control-group label { font-weight: 500; font-size: 0.9rem; margin-bottom: 0.5rem; display: block; }
.control-group input[type="search"],
.control-group select {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ced4da;
}

/* Stan "rozwinięty" - dodawany przez JavaScript */
.floating-map-controls.is-open .controls-body {
    max-height: 80%; /* Ustaw na bezpieczną, dużą wartość */
    opacity: 1;
}
.floating-map-controls.is-open .toggle-arrow {
    transform: rotate(180deg);
}

.info-legend {
    padding: 10px 15px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 8px;
    line-height: 24px;
    color: #333;
}

.info-legend i {
    width: 18px;
    height: 18px;
    float: left;
    margin-right: 8px;
    opacity: 0.9;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.select2-container .select2-dropdown, .select2-container .select2-selection
{
    border:1px solid #aaa !important;
}

.select2-container .select2-selection--single .select2-selection__rendered
{
    padding:0 0 6px !important;
}

.select2-container .select2-selection--single .select2-selection__arrow
{
    top: 0 !important;
    right: 0 !important;
    height: 99% !important;
}