/* Uniwersalne ustawienia bazowe (mobile-first) */
* {
    box-sizing: border-box;
}

.topic-selector select {
    font-size: 12px; /* Zmniejszona czcionka dla wyboru tematu */
    max-width: 80%; /* Ograniczenie szerokości */
    padding: 5px;
    border-radius: 4px;
    margin:10px 0 0 10%;
}
#selected-country-display {
    font-size: 16px;
    font-weight: bold;
    margin: 10px auto 0; /* Odstęp od góry, wyśrodkowanie poziome */
    text-align: center;
    min-height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 800px; /* Ograniczenie szerokości */
    visibility: visible !important;
    opacity: 1 !important;
   
}

.country-select-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Wyśrodkowanie zawartości */
    margin: 10px 0;
}

.select-container {
    display: flex;
    align-items: center;
    margin-bottom: 0px; /* Odstęp między selektem a selected-country-display */
}
#lineChart-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    border-radius: 3px;
    pointer-events: none;
}
.line-chart-container {
    width: 100%; /* Pełna szerokość tylko dla wykresu liniowego */
    max-width: 1200px;
    display: flex;
    height:auto;
}
.country-select-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto; /* Dopasowana wysokość do zawartości */
    padding: 5px 0; /* Minimalny padding dla estetyki */
    margin-bottom: 0px; /* Odstęp od kontenera wykresu */
width:100%;
}

.select-container {
  
    top: 0px; /* Odstęp od góry */
    left: 10px; /* Odstęp od lewej krawędzi */
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.8); /* Lekko przezroczyste tło dla czytelności */
    padding: 0px 0px;
    border-radius: 5px;
    z-index: 10; /* Upewnij się, że jest nad canvasem */
}
.chart-container canvas {
    width: 100% !important; /* Zapewnia pełną szerokość */
    height: 100% !important; /* Zapewnia pełną wysokość kontenera */
}
.chart-container p {
    font-size: 14px;
    margin-bottom: 10px;
}
.chart-container label {
    font-size: 14px;
}
.chart-container select.region-filter {
    padding: 0px;
    font-size: 14px;
}
.controls-container button {
    padding: 5px 10px;
    font-size: 14px;
}
.table-container th select.region-filter {
    padding: 5px;
    font-size: 14px;
    margin-top: 0px;
}
.map-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.map-filter label {
    font-size: 14px;
}
.map-filter select.region-filter {
    padding: 5px;
    font-size: 14px;
}


.chart-container label {
    font-size: 14px;
}
.chart-container select.region-filter {
    padding: 5px;
    font-size: 14px;
}
.ol-popup {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #cccccc;
    bottom: 12px;
    left: -50px;
    min-width: 200px;
}
.ol-popup-closer {
    text-decoration: none;
    position: absolute;
    top: 2px;
    right: 8px;
    font-size: 14px;
    color: #fff;
}
.ol-popup-content {
    font-size: 12px;
    color: #fff;
}



.chart-container select.region-filter {
    padding: 5px;
    font-size: 14px;
    margin-bottom: 10px;
}
.ol-popup {
    position: absolute;
    background-color: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #cccccc;
    bottom: 12px;
    left: -50px;
    min-width: 200px;
}
.ol-popup-closer {
    text-decoration: none;
    position: absolute;
    top: 2px;
    right: 8px;
    font-size: 14px;
    color: #333;
}
.ol-popup-content {
    font-size: 12px;
}
body {
    font-family: Arial, sans-serif;
    margin: 10px;
    padding: 0;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1em;
    min-height: 100vh;
}

main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
 
}

header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

h3 {
    font-size: 1.2em;
    color: #333;
    text-align: center;
    margin: 20px 0 10px;
    width: 100%;
}

.back-arrow {
    position: absolute;
    top: 10px;
    left: 10px;
}

.back-arrow img {
    width: 25px;
    height: 25px;
}

.back-arrow a:hover img {
    opacity: 0.7;
}

.language-selector {
    margin: 10px 0;
    text-align: center;
    width: 100%;
}

.disclaimer {
    width: 100%;
    max-width: 1200px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    padding: 10px;
    margin: 10px auto;
    font-size: 12px;
    color: #856404;
    text-align: left;
}

.disclaimer p[data-en] {
    display: none;
}

.controls-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: row; /* Zawsze poziomy układ przycisków */
    gap: 10px; /* Odstęp między przyciskami */
    justify-content: center;
    margin: 0 auto 10px;
}

.table-container {
    width: 100%;
    max-width: 1200px;
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    margin: 0 auto 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

th, td {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

.charts-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto 20px;
}

.chart-container {
    width: 100%;
    max-width: 1200px;
    height: 450px; /* Wzorcowa wysokość dla małych ekranów */
    background-color: #fff;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-container:nth-child(2) {
    /* Specjalne style dla wykresu kołowego (#pieChart) */
    max-width: 100%;
}
.chart-container:nth-child(4) {
    /* Specjalne style dla wykresu kołowego (#pieChart) */
    max-width: 100%;
}
.line-chart-container {
    width: 100%;
    box-sizing: border-box; /* Zapewnia, że margin i padding nie wpływają na szerokość */
    
}

.chart-description {
    font-size: 10px;
    color: #555;
    text-align: center;
    margin-bottom: 10px;
    width: 100%;
}

.map-container {
    width: 100%;
    max-width: 1200px;
    height: 500px; /* Wzorcowa wysokość dla małych ekranów */
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    margin: 0 auto 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#map {
    width: 100%;
    height: 100%;
}

.sources {
    width: 100%;
    max-width: 1200px;
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    margin: 0 auto 20px;
    font-size: 10px;
    text-align: left;
}

.footer {
    width: 100%;
    max-width: 1200px;
    background-color: #333;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-size: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 0 0 0;
}

.footer a {
    color: #fff;
    text-decoration: none;
    margin: 5px 0;
}

.footer a:hover {
    text-decoration: underline;
}

canvas {
    max-width: 100%;
    max-height: 100%;
}

#pieChart {
    max-width: 85%; /* Ograniczenie szerokości wykresu kołowego */
    max-height: 85%; /* Ograniczenie wysokości wykresu kołowego */
}

.filter-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 10px;
    margin: 5px auto;
    display: block;
}

.filter-button:hover {
    background-color: #45a049;
}

#show-all-button, #unshow-all-button {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 10px;
}

#show-all-button:hover, #unshow-all-button:hover {
    background-color: #1e88e5;
}

.region-filter, .probability-filter {
    display: block;
    margin: 5px auto;
    font-size: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px;
    width: 100%;
    max-width: 200px;
}

/* Style dla dymka na mapie */
.ol-popup {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    font-size: 12px;
    color: #333;
    text-align: center;
    max-width: 250px;
    width: auto;
    z-index: 100;
    /* Ogonki dla wszystkich rozdzielczości */
    position: relative;
}

/* Ogonki dymka */
.ol-popup::after {
    content: '';
    position: absolute;
    bottom: -10px; /* Pozycja ogonka na dole */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #fff; /* Kolor ogonka dopasowany do tła dymka */
    z-index: -1;
}

/* Border ogonka (dla kontrastu z tłem) */
.ol-popup::before {
    content: '';
    position: absolute;
    bottom: -11px; /* Lekko poniżej, aby pokryć granicę */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 11px solid #ccc; /* Kolor granicy */
    z-index: -2;
}

.ol-popup-closer {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    background-color: #fff; /* Białe tło */
    border-radius: 50%; /* Kształt koła */
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc; /* Delikatna granica dla kontrastu */
}

.ol-popup-closer:hover {
    color: #ff0000;
}

/* Większe dymki na urządzeniach mobilnych (<768px) */
@media (max-width: 767px) {
    .ol-popup {
        font-size: 14px; /* Większa czcionka na mobilnych */
        padding: 15px; /* Większy padding */
        min-width: 200px; /* Minimalna szerokość dla lepszej widoczności */
    }

    .ol-popup-content img {
        width: 24px; /* Większa flaga */
        height: 18px;
    }

    .ol-popup-closer {
        font-size: 18px; /* Większy przycisk zamykania */
        width: 24px;
        height: 24px;
    }
    main {
        width: 100%;
       
        margin: 0 0 0 0%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .chart-container {
        position:relative;
        float:left;
        width: 100%;
        height:400px;
        margin: 0 0 10px 0%;
    }
    .table-container {
        width: 94vw;
       
        background-color: #fff;
      
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
        margin: 0 0 10px 0;
        overflow-x: auto;
    }
}

/* Średnie ekrany (601px–900px) */
@media (min-width: 601px) {
    body {
        margin: 20px;
    }
.country-select-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto; /* Dopasowana wysokość do zawartości */
    padding: 5px 0; /* Minimalny padding dla estetyki */
    margin-bottom: 10px; /* Odstęp od kontenera wykresu */
width:100%;
}

    h3 {
        font-size: 1.4em;
        margin: 30px 0 20px;
    }

    .back-arrow {
        top: 20px;
        left: 20px;
    }

    .back-arrow img {
        width: 30px;
        height: 30px;
    }

    .disclaimer {
        font-size: 14px;
        padding: 15px;
    }

    .table-container {
        padding: 15px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }

    .chart-container {
        height: 550px; /* Wzorcowa wysokość dla średnich ekranów */
    }

    .chart-container:nth-child(2) {
        /* Węższy wykres kołowy w układzie dwukolumnowym */
        max-width: 100%;
    }
.line-chart-container {
    width: 100%; /* Pełna szerokość tylko dla wykresu liniowego */
}

    .map-container {
        height: 550px; /* Dopasowanie do wykresów */
    }

    .sources {
        font-size: 12px;
    }

    .footer {
        font-size: 12px;
        flex-direction: row;
        justify-content: center;
        padding: 15px;
    }

    .footer a {
        margin: 0 10px;
    }

    .filter-button, #show-all-button, #unshow-all-button, .region-filter, .probability-filter {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* Duże ekrany (901px–1200px) */
@media (min-width: 901px) {
    .topic-selector select {
        font-size: 14px;
        max-width: 80%;
        margin:10px 0 0 10%;
    }
.country-select-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto; /* Dopasowana wysokość do zawartości */
    padding: 5px 0; /* Minimalny padding dla estetyki */
    margin-bottom: 10px; /* Odstęp od kontenera wykresu */
width:100%;
}

.chart-container:nth-child(2) {
    max-width: 100%;
}
.chart-container:nth-child(3) {
    max-width: 100%;
}
.chart-container:nth-child(4) {
    max-width: 100%;
}
.chart-container:nth-child(5) {
    max-width: 100%;
}

}

/* Bardzo duże ekrany (>1200px) */
@media (min-width: 1201px) {
    body {
        margin: 30px;
    }

    h3 {
        font-size: 1.6em;
    }

    .chart-container {
        position:relative;
        float:left;
        width: 47.5%;
        height:550px;
        margin: 0 0 20px 0%;
    }
    .chart-container:nth-child(4) {
        width: 100%; /* Trzeci wykres na pełną szerokość */
    }
    .chart-container:nth-child(6) {
       
        margin:0 0 20px 5%;
    }
    .chart-container:nth-child(8) {
        width: 100%; /* Trzeci wykres na pełną szerokość */
    }
    
        .chart-container:nth-child(7) {
            width: 100%; /* Trzeci wykres na pełną szerokość */
        }

    
    .map-container {
        height: 650px; /* Dopasowanie do wykresów */
    }

    .footer {
        flex-direction: row;
        justify-content: center;
        padding: 15px;
        font-size: 14px;
     
    }
.country-select-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto; /* Dopasowana wysokość do zawartości */
    padding: 5px 0; /* Minimalny padding dla estetyki */
    margin-bottom: 10px; /* Odstęp od kontenera wykresu */
width:100%;
}
#selected-country-display {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 10px;
}
#selected-country-display img {
    width: 20px;
    height: 15px;
    vertical-align: middle;
}

}