.nav-bar {
    width: 100%;
    background-color: #fefefe;
    padding: 15px 0;
    margin-bottom: 10px;
    box-shadow: #555 0 0 10px;
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-link {
    color: #555;
    font-weight: bold;
    text-decoration: none;
    font-size: 18px;
    padding: 5px 15px;
}

.nav-link:hover {
    color: #8c1515;
    border-radius: 5px;
}

.nav-link.active {
    color: #8c1515;
    border-bottom: 2px solid #8c1515;
    padding-bottom: 3px;
}

body {
    font-family: Arial, sans-serif;
    text-align: center;
    display: flex;
    flex-direction: column;
    margin: 0;
    background-color: #F0F0F0;
    height: 100vh; /* Ensure body takes full viewport height */
    overflow: hidden; /* Prevent scrollbars on the body */
}

#main-container {
    display: flex;
    height: 100vh; /* Full height of the viewport */
    overflow: hidden;
}

#graph-container {
    flex: 1; /* Take up the remaining space */
    position: relative;
    background-color: #ffffff; /* Optional: Add a background color for better visibility */
}

svg {
    width: calc(100% - 20px);
    flex: 1; /* Make SVG fill the remaining space */
    margin: 10px 10px;
    border: 1px solid #ddd;
    background-color: rgb(255, 255, 255);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    display: block;
}

text {
    font-size: 14px;
    fill: black;
    /* Text color */
    stroke: white;
    /* Halo color */
    stroke-width: 5px;
    /* Thickness of the halo */
    paint-order: stroke fill;
    text-anchor: middle;
}

.legend {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.legend text {
    font-size: 14px;
    fill: white;
    stroke: none;
}

.legend rect {
    stroke-width: 2;
}

.legend text.legend-text {
    font-size: 14px;
    fill: rgb(255, 255, 255);
    stroke: none;
    text-anchor: middle;
    font-weight: bold;
}

/* Ensure the legend background properly contains the text */
.legend-background {
    fill: rgba(240, 240, 240, 0.9);
}

#info {
    margin: 10px auto 0;
    font-weight: bold;
    color: #8c1515;
    text-align: center;
    width: 100%;
    flex-basis: 100%;
    order: 999; /* Ensure it appears at the end of the flex container */
}

/* Popup styles */
.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #ddd;
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 500px;
    max-width: 90%;
    max-height: 70%;
    border-radius: 8px;
    overflow: auto;
    /* Enable scrolling */
}

.popup .close-btn {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.popup .close-btn button {
    background-color: #8c1515;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.popup .close-btn button:hover {
    background-color: #a91e1e;
}

.popup-content h3 {
    margin-top: 0;
    font-size: 1.2em;
    color: #333;
}

.popup-content p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #555;
}

.popup-content p span {
    font-weight: bold;
    color: #333;
}

.info-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: #8c1515;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.info-button:hover {
    background-color: #a91e1e;
}

.info-tooltip {
    display: none;
    position: absolute;
    bottom: 50px;
    right: 10px;
    background-color: white;
    color: black;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    width: 220px;
}

.filter-container {
    width: 250px;
    max-width: 250px;
    padding: 40px;
    background-color: #ffffff;
    border-left: 0px solid #ddd;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto; /* Allow scrolling if content overflows */
}
.filter-container2 {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping if there are too many elements */
    gap: 10px; /* Add spacing between elements */
    justify-content: center; /* Center elements horizontally */
    align-items: center; /* Center elements vertically */
    width: 100;
    max-width: 100%;
    padding: 20px;
    background-color: #ffffff;
    border-left: 0px solid #ddd;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto; /* Allow scrolling if content overflows */
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content horizontally */
    gap: 5px;
    margin-bottom: 15px;
}

.filter-group label {
    font-weight: bold;
}

.filter-group select,


.select2-container--default .select2-selection--single {
    padding: 5px;
    border: none !important;
    border-radius: 5px;
    width: 200px;
    height: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.select2-container--default .select2-selection--single {
    background-color: white;
    display: flex;
    align-items: center;
}

.select2-dropdown {
    border: none !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.filter-group button,
.filter-group #yearRange {
    padding: 1px;
    border: none;
    border-radius: 5px;
    font-size: 10px;
    width: 140px;
    height: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.filter-group #yearRangeValues {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    border-radius: 5px;
}

.filter-group #yearRangeValues span {
    font-weight: bold;
}

.filter-group #yearRangeValues #yearRange {
    margin: 0 20px;
}

.filter-group button {
    background-color: #8c1515;
    color: white;
    cursor: pointer;
    width: auto;
}

.filter-header {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.connections-button {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: #8c1515;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.connections-button:hover {
    background-color: #a91e1e;
}

#connectionsPopup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #ddd;
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 80%;
    max-width: 90%;
    max-height: 70%;
    border-radius: 8px;
    overflow: auto;
}

#connectionsPopup table {
    width: 100%;
    border-collapse: collapse;
}

#connectionsPopup th,
#connectionsPopup td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

#connectionsPopup th {
    background-color: #f2f2f2;
}

/* Add this to your existing style section */
.highlighted-node {
    stroke: #ff190062;
    /* Color for the highlight */
    stroke-width: 6px;
}

.highlighted-link {
    stroke: #ff190062;
    /* Color for the highlight */
    stroke-width: 3px;
}

.connected-node {
    stroke: #ffff00;
    stroke-width: 4px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 0, 0.7));
}

.popup-content button {
    background-color: #8c1515;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.popup-content button:hover {
    background-color: #a91e1e;
}

.popup-content button:active {
    background-color: #6b0f0f;
}

.popup-content button:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

#resetFilters {
    background-color: #8c1515;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#resetFilters:hover {
    background-color: #a91e1e;
}

.organization-button {
    position: absolute;
    bottom: 50px;
    left: 10px;
    background-color: #8c1515;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.organization-button:hover {
    background-color: #a91e1e;
}

#organizationPopup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #ddd;
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 80%;
    /* Same width as connectionsPopup */
    max-width: 90%;
    max-height: 70%;
    border-radius: 8px;
    overflow: auto;
}

.noUi-horizontal .noUi-handle {
    top: -5px !important
}

#organizationPopup table {
    width: 100%;
    border-collapse: collapse;
}

#organizationPopup th,
#organizationPopup td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

#organizationPopup th {
    background-color: #f2f2f2;
}

.highlighted-label {
    font-weight: bold;
    fill: #000000;
    stroke: #ffffff;
    stroke-width: 1px;
    filter: drop-shadow(0 0 2px rgba(255, 55, 0, 0.5));
}

.node-label {
    opacity: 0.2;
    stroke-width: 1px;
    transition: opacity 0.2s;
    pointer-events: none; /* Prevent accidental mouse events */
}

.node-label.show, .node-label:hover, .highlighted-label {
    opacity: 1;
    pointer-events: auto;
}

/* Data page styles */
.data-container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 40px;
}

.data-tabs {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.tab-button {
    background-color: transparent;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #555;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #8c1515;
}

.tab-button.active {
    color: #8c1515;
    border-bottom: 3px solid #8c1515;
}

.tab-content {
    display: none;
    padding: 10px 0;
}

.tab-content.active {
    display: block;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.table-info {
    margin-bottom: 10px;
    font-weight: bold;
    color: #555;
}

/* Table styles */
#organizationTable, #connectionsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#organizationTable th, #organizationTable td,
#connectionsTable th, #connectionsTable td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}

#organizationTable th, #connectionsTable th {
    background-color: #f2f2f2;
    font-weight: bold;
}

#organizationTable tr:nth-child(even),
#connectionsTable tr:nth-child(even) {
    background-color: #f9f9f9;
}

#organizationTable tr:hover,
#connectionsTable tr:hover {
    background-color: #f0f0f0;
}

#organizationTable a,
#connectionsTable a {
    color: #8c1515;
    text-decoration: none;
}

#organizationTable a:hover,
#connectionsTable a:hover {
    text-decoration: underline;
}

/* Clickable organization names in tables */
.clickable-org {
    cursor: pointer;
    color: #8c1515;
    font-weight: bold;
    transition: all 0.2s ease;
}

.clickable-org:hover {
    text-decoration: underline;
    background-color: #f5f5f5;
}

/* Adjust Data page styles for better scrolling */
body.data-page {
    overflow: auto !important;
    height: auto !important;
}

/* Custom button styles */
.custom-button {
    background-color: #8c1515;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.custom-button:hover {
    background-color: #a91e1e;
    transform: scale(1.05);
}

.custom-button:active {
    background-color: #6b0f0f;
    transform: scale(0.95);
}

.custom-button.learn-more {
    background-color: #1f77b4;
    height: 35px; /* Blue for "Learn More" */
}

.custom-button.learn-more:hover {
    background-color: #1a5f8c;
}

.custom-button.filter-group {
    background-color: #2ca02c;
    height: 35px; /* Green for "Filter to This Group" */
}

.custom-button.filter-group:hover {
    background-color: #238b1f;
}

.popup-buttons {
    display: flex;
    justify-content: center; /* Center the buttons horizontally */
    gap: 10px; /* Add spacing between the buttons */
    margin-top: 10px; /* Add some space above the buttons */
}

.connection-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-weight: bold;
    color: #555;
}

.stat-value {
    font-size: 14px;
    color: #8c1515;
    font-weight: bold;
}
/*Graph styles */
    
#graph {
    width: 100%;
    height: calc(100% - 20px);
    background-color: #FFFEFB;
}
/* Add to your CSS file or inside a <style> tag */
.indicator-row {
    display: flex;
    gap: 24px;
    margin-bottom: 10px;
    justify-content: flex-start;
}
.indicator {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 10px 0px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    text-align: center;
    min-width: 120px;
    max-width: 80px;
    flex: 0 0 120px; /* fixed width for all boxes */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.indicator-label {
    font-size: 0.9em;
    color: #555;
}
.indicator-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #8c1515;
}
/* Add to style.css for toggle button styling
.toggle-row {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}
.toggle-btn {
    padding: 6px 18px;
    border-radius: 6px;
    border: 0px solid #8c1515;
    background: #fff;
    color: #1ce31c;
    max-width: 50;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}
.toggle-btn.active {
    background: #09b6a1;
    color: #fff;
} */

.year-filter-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin: 0 auto; /* Center the switch horizontally */
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #3FB8AF;
}

input:focus + .slider {
    box-shadow: 0 0 1px #3FB8AF;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}