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

/* ========= MAPA SEKCJA - DOPASOWANA DO STYLU STRONY ========= */
.map-section {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    padding: 40px 0px;
    max-width: 1200px;
    margin: 0 auto;
}

.map-header {
    text-align: left;
    margin-bottom: 40px;
}

.map-header h2 {
    font-size: 42px;
    font-weight: bold;
    color: #0C0B34;
    position: relative;
    display: inline-block;
    text-transform: none;
    border: none;
    text-align: start;
    padding: 0;
    margin: 0;
    padding-bottom: 10px;
    line-height: 1.2;
}

.map-header-underline {
    display: flex;
    margin-top: 8px;
    margin-bottom: 32px;
}

.span-org {
    width: 150px;
    height: 4px;
    background: #f7941e;
    z-index: 10;
}

.span-gray {
    width: 500px;
    height: 4px;
    background: rgba(127, 127, 127, 0.45);
    z-index: 10;
}

.map-header p {
    color: #666;
    font-size: 16px;
    max-width: 600px;
    margin: 0;
    line-height: 1.5;
}

.map-content {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.map-container {
    flex: 2;
    min-width: 600px;
    position: relative;
}

.sidebar {
    flex: 1;
    min-width: 300px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    height: fit-content;
    border: 2px solid #f7941e;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.poland-map {
    width: 100%;
    height: auto;
}

.province {
    fill: #f0f2f5;
    stroke: #0C0B34;
    stroke-width: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.province:hover {
    stroke: #f7941e;
    stroke-width: 2;
    filter: brightness(1.05);
}

.province.has-data {
    fill: #f7941e !important;
}

.province.no-data {
    fill: #c0c4cc;
}

.province.active {
    stroke: #151432 !important;
    stroke-width: 3;
    filter: brightness(1.1);
    fill: #151432 !important;
}

/* TOOLTIP */
.tooltip {
    position: fixed;
    background: linear-gradient(135deg, #0C0B34 0%, #1a1d5c 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    pointer-events: none;
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    max-width: 280px;
    border: 2px solid #f7941e;
    transform: translate(15px, -50%);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.tooltip.show {
    opacity: 1;
}

.tooltip::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #f7941e;
}

.tooltip::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #0C0B34;
}

.tooltip strong {
    color: #f7941e;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #e9ecef;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
}

.legend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: #f7941e;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #0C0B34;
}

.loading {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: #0C0B34;
}

.province-details {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #f7941e;
    flex-shrink: 0;
}

.province-details h3 {
    color: #0C0B34;
    margin-bottom: 15px;
    border-bottom: 2px solid #f7941e;
    padding-bottom: 10px;
    font-size: 1.4em;
    font-weight: bold;
}

.search-container {
    margin-bottom: 15px;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #f7941e;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #0C0B34;
    box-shadow: 0 0 0 3px rgba(247, 148, 30, 0.1);
}

.search-input::placeholder {
    color: #999;
}

.locations-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    margin-right: -5px;
}

/* Scrollbar styling */
.locations-container::-webkit-scrollbar {
    width: 8px;
}

.locations-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.locations-container::-webkit-scrollbar-thumb {
    background: #f7941e;
    border-radius: 4px;
}

.locations-container::-webkit-scrollbar-thumb:hover {
    background: #F07D05;
}

.locations-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.location-link {
    display: block;
    background: linear-gradient(135deg, #0C0B34 0%, #1a1d5c 100%);
    color: white;
    padding: 15px;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.location-link:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(247, 148, 30, 0.2), transparent);
    transition: left 0.5s;
}

.location-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(12, 11, 52, 0.3);
    border-color: #f7941e;
    background: linear-gradient(135deg, #f7941e 0%, #F07D05 100%);
    color: white;
    text-decoration: none;
}

.location-link:hover:before {
    left: 100%;
}

.location-name {
    font-weight: bold;
    font-size: 1em;
    margin-bottom: 5px;
    line-height: 1.3;
}

.location-info {
    font-size: 0.85em;
    opacity: 0.9;
}

.external-link-icon {
    float: right;
    margin-top: 2px;
    opacity: 0.7;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
    border: 2px solid #dc3545;
}

.empty-province {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px dashed #ccc;
}

.no-results {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px dashed #f7941e;
}

.search-results-count {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
}

/* ========= RESPONSYWNOŚĆ ========= */
@media (max-width: 1024px) {
    .locations-grid {
        grid-template-columns: 1fr;
    }
    
    .span-gray {
        width: 75%;
    }
    
    .span-org {
        width: 25%;
    }
}

@media (max-width: 768px) {
    .map-section {
        padding: 30px 0px;
    }
    
    .map-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .map-container {
        min-width: auto;
    }
    
    .sidebar {
        max-height: 60vh;
    }
    
    .map-header h2 {
        font-size: 32px;
    }
    
    .location-link {
        padding: 12px 15px;
    }

    .locations-grid {
        grid-template-columns: 1fr;
    }

    /* Touch scrolling dla mobile */
    .locations-container {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Tooltip na mobile */
    .tooltip {
        position: absolute;
        transform: translate(10px, -100%);
        font-size: 13px;
        padding: 12px 16px;
        max-width: 250px;
    }
}

@media (max-width: 700px) {
    .map-header h2 {
        font-size: 24px;
    }
    
    .map-section {
        padding: 20px 0px;
    }
    
    .sidebar {
        padding: 20px;
    }
    
    .tooltip {
        font-size: 12px;
        padding: 10px 14px;
        max-width: 200px;
    }
    
    .locations-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .location-link {
        padding: 12px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .map-header h2 {
        font-size: 24px;
    }
    
    .span-org {
        width: 30%;
    }
    
    .span-gray {
        width: 70%;
    }
}