@font-face {
    font-family: 'Agrandir';
    src: url('PPAgrandir-Regular.woff2') format('truetype');
    font-weight: 400;
}

body {
    font-family: 'Agrandir', sans-serif;
    text-align: left;
    background-color: #000000;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    flex-direction: column;
    position: relative;
    color: white;
}

/* Outer White Frame */
.container {
    width: 95vw;
    height: 94vh;
    border: 1px solid white;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
}

/* Header Section with Proper Alignment & Dividers */
.header {
    display: grid;
    grid-template-columns: 3fr 10px 3fr 10px 1.5fr 10px 1.5fr; /* Wider space for H1 & H2 */
    align-items: center;
    justify-content: center;
    text-align: left;
    border-bottom: 1px solid white;
    position: relative;
    height: auto;
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 10px;
    font-size: 17px;
    max-width: 47ch;
}

.header-subtitle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 20px;
    font-size: 13px;
    max-width: 50ch;
}

.course-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
    padding-right: 20px;
    font-size: 13px;
    line-height: 1.5;
}

.authors {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
    font-size: 13px;
    line-height: 1.5;
}

/* White Vertical Divider Lines */
.header-divider {
    width: 1px;
    height: calc(100% - 40px); /* Adds 20px padding from both top & bottom */
    background-color: white;
    align-self: center;
}

.tooltip {
    position: absolute;
    background: white;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 10px;
    display: none;
    pointer-events: none;
    color: #000000;
}

svg {
    display: block;
    width: 100vw;
    height: 100vh;
}

g {
    transform: translate(50%, 50%);
}

#overlay {
    width: 25%;
    height: 50%;
    /* background-color: rgb(211, 211, 237);
    opacity: 0.6; */
    position: absolute;
    top: 18%; /* Adjust as needed */
    left: 0; /* Aligns the div to the right side */
    padding-left: 30px; /* Optional: adds some space from the right edge */
    pointer-events: none; /* Allows interactions with the SVG below */
}    

/* Legend - Positioned in Bottom Right */
#legend {
    position: absolute;
    bottom: 1%;
    right: 1%;
}

/* Sources - Positioned 20px Below Header & Responsive */
/* #sources {
    position: absolute;
    top: calc(100% + 20px); /* Places it 20px below the header */
    /* right: 2%;
    text-align: right;
    font-size: 10px;
    line-height: 150%;
    max-width: 400px;
} */

#sources {
    position: relative;
     top: 1%;
     padding-right: 10px;
     text-align: right;
     font-size: 11px;
     line-height: 150%;
     max-width: 400px;
     left: 80%;
 }

a {
    color: white;
}

.flex-bar {
    display: flex;
    justify-content: space-between;
    width: 80%;
}

.city-list {
    width: 30%;
    padding-right: 20px;
}

.city-list ul {
    list-style-type: none;
    padding: 0;
}

.city-list li {
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
}

.bar-chart {
    width: 65%;
}


 /* Container div */
 .table-container {
    width: 100%;
    padding: 2px;
    overflow-x: auto; /* Enables horizontal scrolling if needed */
}

/* Table styling */
table {
    width: 90%;
    border-collapse: collapse;
    font-size: 12px;
}

th, td {
    padding: 2px;
    text-align: left;
    height: 5px;
}

th {
    color: white;
}
/* Define column widths */
th:first-child, td:first-child {
    width: 30%; /* Left column smaller */
}

th:last-child, td:last-child {
    width: 70%; /* Right column larger */
}

.highlighted{
    background-color: rgba(255, 255, 255, 0.1); /* Adjust the opacity */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); /* Softer glow effect */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.toggle-wrapper {
    position: absolute;
    bottom: 220px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

.toggle-label {
    color: white;
    font-size: 14px;
    font-family: 'Agrandir', sans-serif;
}

.toggle-button {
    position: relative;
    width: 56px;
    height: 32px;
    background-color: #374151;
    border-radius: 999px;
    padding: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
}

.toggle-button.active {
    background-color: white;
}

.toggle-slider {
    position: absolute;
    top: 4px; /* Nuova proprietà per centrare il pallino verticalmente */
    left: 4px;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    transform: translateX(0);
}


.toggle-button.active .toggle-slider {
    transform: translateX(24px);
    background-color: #374151;
}

.district {
    overflow: hidden;
    padding: 1px;
}

.district-name {
    height: 10px;
    flex-shrink: 0;
    color: #FFF;
    font-family: "Agrandir";
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    padding-bottom: 2px;
    margin-bottom:3px;
}

  .bar {
    background-color: #ffffff;
    color: rgb(0, 0, 0);
    text-align: right;
    margin: 4px 0;
    width: 154px;
    height: 3px;
    border-radius: 4px;
    border: 1px solid #FFF;

}

.population {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 6px 3px 25px 0px rgba(255, 255, 255, 0.10) inset;
    filter: drop-shadow(3px 4px 7px rgba(51, 51, 51, 0.10));
    padding: 5px;
    padding-bottom: 10px;
    border-radius: 3px;
    text-align: center;
    min-width: 50px;
    display: inline-block;
    color: #FFF;
    font-family: "Agrandir";
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    width: 40px;
    height: 14px;
    flex-shrink: 0;
}


.blue-theme .district-name {
    color: yellow; /* Change text color to blue */
  }
  
  .blue-theme .bar {
    background-color: yellow !important; /* Change bar color to blue */
    color: yellow;
  }


  circle {
    transition: filter 0.2s ease-in-out, stroke-width 0.s ease-in-out;
  }
  
  circle:hover {
    filter: drop-shadow(0px 0px 8px rgba(255, 255, 255, 0.6)); /* Soft glow effect */
    
  }