/* Dow Jones Corporate Board Connections - Styles */

:root {
  --primary-color: #003366;
  --secondary-color: #4a86e8;
  --text-color: #333;
  --board-color: #0077BB;  /* Blue */
  --csuite-color: #EE7733; /* Orange */
  --mixed-color: #009988;  /* Teal */
  --light-bg: #f8f9fa;
  --border-color: #ddd;
  --hover-color: rgba(0, 51, 102, 0.1);
  --focus-outline: 3px solid #4d90fe;
}

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

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #fff;
  margin: 0;
  padding: 0;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Typography */
h1, h2, h3, h4 {
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-top: 1rem;
}

h2.compact-heading {
  font-size: 1.3rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.25rem;
  max-width: 1000px;
}

h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
}

h4 {
  font-size: 1.1rem;
  margin-top: 1rem;
}

p {
  margin-bottom: 1rem;
}

/* Layout */
header {
  background-color: var(--primary-color);
  color: #fff;
  padding: 2rem 1rem;
  text-align: center;
}

header p {
  max-width: 800px;
  margin: 0 auto 0.5rem;
  opacity: 0.9;
}

.last-updated {
  font-size: 0.9rem;
  opacity: 0.8;
}

section {
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

section#intro {
  padding-bottom: 1rem;
}

section#visualization {
  padding-top: 1rem;
}

footer {
  background-color: var(--primary-color);
  color: #fff;
  text-align: center;
  padding: 1.5rem;
  margin-top: 2rem;
}



/* Filter Controls */
.filter-controls {
  /* margin: 1rem 0; */
  max-width: 1000px;
  padding: 1rem;
  /* background-color: var(--light-bg); */
  border-radius: 8px;
  border: 2px solid var(--border-color);
  margin: 0 auto; /* Center on page */
}

/* Desktop layout for filter controls and key container */
@media (min-width: 769px) {
  .visualization-wrapper {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto 15px;
  }
  
  .filter-controls {
    flex: 3;
    max-width: calc(75% - 10px);
    margin: 0;
    height: fit-content;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  .key-container {
    flex: 1;
    max-width: calc(25% - 10px);
    margin: 0;
    height: fit-content;
    padding: 0.75rem;
    background-color: var(--light-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 2px solid var(--border-color);

  }

  .connection-type-filters {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: nowrap;
  }
  
  .filter-group {
    width: 100%;
    justify-content: center;
    margin-top: 5px;
  }
  
  .filter-controls .filter-group label {
    font-size: 0.9rem;
    padding: 0.25rem 0;
    white-space: nowrap;
  }
  
  /* Vertical key layout for desktop */
  .key-container .key-items {
    flex-direction: column;
    align-items: flex-start;
    gap: 0px;
  }
  
  .key-container .key-item {
    width: 100%;
    /* padding: 6px 12px; */
    justify-content: flex-start;
  }
  
  .key-container .key-text {
    font-size: 0.85rem;
  }
}

.filter-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 0;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  font-size: .9rem;

}



/* Network Visualization */
#visualization {
  padding: 1rem 0;
  /* background: #f8f9fa; */
  border-radius: 8px;
  /* margin: 1rem auto; */
  max-width: 1000px;
}

#network-graph {
  width: 100%;
  /* aspect-ratio: 1/1; */
  max-width: 1000px;
  max-height: 1000px;
  position: relative;
  background: black;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  overflow: hidden;
  background-color: white;
}

#network-graph svg {
  width: 100%;
  height: 100%;
  display: block; /* Ensures no extra space below SVG */
}

.controls {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

#reset-view {
  background: #fff;
  border: 2px solid #666;
  border-radius: 4px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#reset-view:hover {
  background: #f0f0f0;
}

#reset-view:focus {
  outline: 3px solid #0077BB;
  outline-offset: 2px;
}

.instructions {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-top: 60px;
  padding: 0 10px;
}

.accessibility-note {
  text-align: center;
  color: #666;
  font-style: italic;
  margin-top: 1rem;
}

/* Node and Link Styling */
.node {
  stroke: #fff;
  stroke-width: 2px;
  cursor: pointer;
  transition: stroke-width 0.3s;
}

.node:hover, .node.highlighted {
  stroke-width: 3px;
  stroke: #000;
}

.node.selected {
  stroke: #ff6600;
  stroke-width: 4px;
}

.node.connected {
  opacity: 1;
}

.node.unconnected {
  opacity: 0.6;
}

.node.has-gov-connection {
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.6));
  animation: pulse-gov 2s ease-in-out infinite;
}

@keyframes pulse-gov {
  0%, 100% {
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.6));
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.8));
  }
}

.node.has-gov-connection:hover {
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 1));
}

/* Link styling with simplified connection types */
.link {
  stroke-opacity: 0.7;
  transition: stroke-opacity 0.3s, stroke-width 0.3s;
}

/* Board connections - thin solid line */
.link.board {
  stroke: var(--board-color);
  stroke-width: 2px;
}

/* Board and Executive connections - thicker solid black line */
.link.mixed {
  stroke: #000000; /* Change to solid black */
  stroke-width: 4px;
}

/* Connection strength classes - multiple directors between same companies */
.link.strength-2 {
  stroke-opacity: 0.8;
}

.link.strength-3plus {
  stroke-opacity: 0.9;
}

/* Government connection styles */
.link.government {
  stroke: #D4AF37 !important;
  stroke-width: 2px;
  stroke-opacity: 0.6;
  stroke-dasharray: 5, 5;
}

.link.government.highlighted {
  stroke-opacity: 1;
  stroke-width: 3px;
}

/* Government node styles */
.government-node {
  fill: #D4AF37 !important;
  stroke: #B8960F !important;
  stroke-width: 3px;
  cursor: pointer;
}

.government-node:hover {
  fill: #FFD700 !important;
  stroke: #997A00 !important;
  stroke-width: 4px;
}

/* Highlighted link states */
.link.highlighted-board {
  stroke: var(--board-color) !important;
  stroke-width: 4px !important; /* Enlarge on highlight */
  stroke-opacity: 0.9 !important;
}

.link.highlighted-mixed {
  stroke: #000000 !important; /* Black for board+executive */
  stroke-width: 5px !important; /* Slightly thicker when highlighted */
  stroke-opacity: 0.9 !important;
}

/* Multi-connection links */
.link.double {
  opacity: 0.85;
}

.link.triple {
  opacity: 0.9;
}

/* Add hover effect to links */
.link:hover {
  stroke-width: 4px;
  stroke-opacity: 0.9;
}

.node-label {
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  color: black;
  max-width: 150px;
  overflow: visible;
  /* text-shadow: 
    -1px -1px 2px rgba(0,0,0,0.7),
    1px -1px 2px rgba(0,0,0,0.7),
    -1px 1px 2px rgba(0,0,0,0.7),
    1px 1px 2px rgba(0,0,0,0.7); */
    font-color: black;
}

/* Tooltip styling */
.tooltip {
  position: fixed;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  max-width: 300px;
  max-height: 80vh;
  overflow-y: auto;
}

.tooltip-header {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #000;
}

.tooltip-scrollable-content {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 5px;
  padding-right: 5px;
}

.tooltip-scrollable-content::-webkit-scrollbar {
  width: 6px;
}

.tooltip-scrollable-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.tooltip-scrollable-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.tooltip-scrollable-content::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.connection-list {
  margin: 0;
  padding-left: 18px;
}

.connection-list li {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #eee;
}

.connection-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.director-background {
  font-size: 0.85em;
  color: #555;
  font-style: italic;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

/* Government service indicators */
.gov-indicator {
  font-size: 0.9em;
  cursor: help;
  vertical-align: middle;
}

.gov-service-badge {
  display: inline-block;
  font-size: 0.8em;
  color: #2c3e50;
  background-color: rgba(52, 152, 219, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
  border-left: 3px solid #3498db;
  font-weight: 500;
}

.director-info {
  margin-bottom: 0.5rem;
}

.recent-change-info {
  background-color: rgba(241, 196, 15, 0.1);
  padding: 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

/* Tables */
.data-tables {
  padding-top: 0;
  max-width: 1000px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
}

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

th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #333;
}

tr:hover {
  background-color: #f8f9fa;
}

/* Data Sources Section */
#data-sources {
  padding: 1rem;
  max-width: 1000px;
  margin: 1.5rem auto;
  background-color: transparent;
  border-radius: 8px;
}

#data-sources h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  padding-bottom: 0.25rem;
  text-align: left;
}

.sources-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 1rem auto;
  max-width: 1000px;
}

.sources-container h3 {
  font-size: 0.95rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
  border-bottom: none;
  padding-bottom: 0;
}

.source-list {
  list-style-type: none;
  padding: 0;
  margin: 0 0 1rem 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.source-list li {
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.source-list a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.source-list a:hover {
  text-decoration: underline;
}

/* Add close button for tooltips on mobile */
.tooltip-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #f1f1f1;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  z-index: 5;
}

.tooltip-close-btn:hover {
  background-color: #ddd;
  color: #333;
}

/* Badge row component styles */
.badges-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  margin: 1rem auto 2rem;
  flex-wrap: wrap;
  max-width: 1200px;
}

.badge-link {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
  text-decoration: none;
  opacity: 0.8;
}

.badge-link:hover {
  transform: translateY(-2px);
  opacity: 1;
}

.badge-link img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

/* Make the visualization accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Section header styling */
.section-header.collapsible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  /* background-color: var(--light-bg); */
  border: 1px solid var(--border-color);
  border-radius: 8px;
  /* margin: 0.5rem 0 0.5rem 0; */
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.section-header.collapsible:hover {
  background-color: rgba(0, 51, 102, 0.05);
}

.section-header.collapsible h2 {
  margin: 0;
  border-bottom: none;
  flex: 1;
  font-size: 1.35rem;
}

.toggle-icon {
  font-size: 1rem;
  color: #666;
  transition: transform 0.3s ease;
}

.section-content {
  overflow: hidden;
  transition: max-height 0.5s ease-out, opacity 0.3s ease-out, visibility 0.3s;
  max-height: 0; /* Default to collapsed */
  /* margin-bottom: 2rem; */
  opacity: 0;
  visibility: hidden;
}

/* Style for expanded sections */
.section-content.expanded {
  max-height: 2000px !important; /* Large enough to fit all content */
  opacity: 1 !important;
  visibility: visible !important;
}

/* JavaScript adds .active class when expanded */
.section-header.collapsible.active + .section-content {
  opacity: 1;
  visibility: visible;
}

.section-header.collapsible.active {
  background-color: rgba(0, 51, 102, 0.08);
  border-left-width: 6px;
}

.section-header.collapsible.active .toggle-icon {
  transform: rotate(180deg);
}

/* Add spacing between sections */
#data-tables > div:not(:last-child) {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  /* margin-bottom: 2rem; */
}

/* Touch-specific styles */
.touch-device .node {
  cursor: pointer;
}

.touch-device .link.highlighted-board,
.touch-device .link.highlighted-csuite,
.touch-device .link.highlighted-mixed,
.touch-device .link.highlighted-both {
  stroke-width: 4px !important;
  stroke-opacity: 0.9 !important;
}

.mobile-view .instructions {
  font-size: 12px;
  margin-top: 50px;
}

.mobile-view #reset-view {
  font-size: 0.7rem;
  padding: 6px 12px;
}



/* New Key Container Styles */
.key-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 2px solid var(--border-color);

  margin: 0 auto 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  position: relative;
  z-index: 1;
}

.key-label {
  font-weight: bold;
  font-size: 1rem;
  color: var(--text-color);
  /* margin-bottom: 10px; */
}

.key-items {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.key-item {
  display: flex;
  align-items: center;
  /* padding: 8px 15px; */
  /* background: #f8f9fa; */
  border-radius: 6px;
  /* border: 1px solid #eee; */
}

.key-line {
  display: inline-block;
  width: 24px;
  height: 3px;
  margin-right: 10px;
}

/* Board interlock - solid blue */
.key-line.board {
  background-color: var(--board-color);
  height: 3px;
}

/* Board and Executive - solid black, thicker */
.key-line.mixed {
  background-color: #000000;
  height: 5px;
}

/* Government connection - gold, dashed */
.key-line.government {
  background: repeating-linear-gradient(
    90deg,
    #D4AF37 0px,
    #D4AF37 5px,
    transparent 5px,
    transparent 10px
  );
  height: 3px;
}

.key-text {
  font-size: .9rem;
  color: var(--text-color);
  white-space: nowrap;
}

/* Mobile Responsive Styles for Key */
@media (max-width: 768px) {
  .key-container {
    padding: 10px;
    width: 95%;
  }
  
  .key-label {
    margin-bottom: 8px;
    font-size: 1rem;
  }
  
  .key-items {
    gap: 10px;
  }
  
  .key-item {
    padding: 6px 10px;
  }
  
  .key-line {
    width: 20px;
    margin-right: 8px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.3rem;
  }
  
  h2, h2.compact-heading {
    font-size: 1.1rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    max-width: 1000px;
  }
  
  h2.compact-heading {
    max-width: 1000px;
    border-bottom: 1px solid var(--border-color);
  }
  
  h3 {
    font-size: 1rem;
    margin-top: 1rem;
  }
  
  /* .connection-type {
    padding: 1rem;
  } */
  
  .connection-type h4 {
    font-size: 0.9rem;
  }
  
  .connection-type p {
    font-size: 1rem;
    /* line-height: 1.3; */
  }
  
  #network-graph {
    /* aspect-ratio: 1/1; */
    border-radius: 8px; /* Match desktop border-radius */
    min-height: 70vh; /* Use viewport height instead of fixed pixels */
    max-height: 75vh; /* Prevent it from being too tall */
    margin: 0 auto 1.5rem; /* Ensure it's centered horizontally */
    display: flex; /* Helps with centering the SVG */
    justify-content: center;
    align-items: center;
  }
  
  /* Ensure SVG takes full container dimensions */
  #network-graph svg {
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    left: 0;
    top: 0;
  }
  
  .controls {
    top: 10px;
  }
  
  #reset-view {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
  
  .tooltip {
    max-width: 85vw;
    font-size: 0.9rem;
  }
  
  .tooltip-header {
    font-size: 14px;
  }
  
  .sources-container {
    grid-template-columns: 1fr;
  }
  
  section#intro {
    padding-bottom: 0.25rem;
  }
  
  section#visualization {
    padding-top: 0.25rem;
  }
  
  .badge-link img {
    width: 28px;
    height: 28px;
  }
  
  #data-sources h2 {
    font-size: 1.1rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    text-align: center;
  }
  
  .source-category {
    padding: 0.75rem;
  }
  
  .sources-container h3 {
    font-size: 0.9rem;
  }
  
  .source-list {
    font-size: 0.8rem;
    line-height: 1.3;
  }
  
  .section-header.collapsible {
    padding: 0.75rem 0.5rem;
    max-width: 1000px;
  }
  
  .section-header.collapsible h2 {
    font-size: 1.1rem;
  }
  
  /* Ensure tables are scrollable on small devices */
  .section-content {
    overflow-x: auto;
    max-width: 100%;
  }
  
  .key-container {
    padding: 6px 8px;
    margin-bottom: 10px;
  }
  
  .key-items {
    gap: 8px;
  }
  
  .key-line {
    width: 16px;
  }
  
  .key-text {
    font-size: .9rem;
  }
  
  /* Make tables responsive */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Improve table header and cell styling for mobile */
  th, td {
    min-width: 120px;
    white-space: nowrap;
  }
  
  /* Optimize table layout for mobile */
  table {
    font-size: 0.85rem;
  }
  
  th, td {
    padding: 8px;
  }
  
  /* Hide sector column on mobile */
  #companies-table th:nth-child(3),
  #companies-table td:nth-child(3),
  .desktop-only {
    display: none;
  }
  
  /* Adjust width of columns */
  #companies-table th:first-child,
  #companies-table td:first-child {
    width: 15%;
  }
  
  #companies-table th:nth-child(2),
  #companies-table td:nth-child(2) {
    width: 15%;
  }
  
  #companies-table th:last-child,
  #companies-table td:last-child {
    width: 15%;
  }
  
  /* Optimize interlocks table */
  #interlocks-table th:first-child,
  #interlocks-table td:first-child {
    width: 15%;
  }
  
  #interlocks-table th:nth-child(2),
  #interlocks-table td:nth-child(2) {
    width: 15%;
  }
  
  #interlocks-table th:last-child,
  #interlocks-table td:last-child {
    width: 15%;
  }
}

/* Tablet adjustments */
@media (min-width: 481px) and (max-width: 1024px) {
  #network-graph {
    max-width: 90%;
    min-height: 650px;
  }
}

/* Mobile navigation and touch improvements */
@media (hover: none) {
  .node {
    stroke-width: 2.5px; /* Larger touch targets */
  }
  
  #reset-view {
    padding: 10px 20px; /* Larger touch target for reset button */
  }
  
  /* Increase tap target sizes */
  .connection-type-filters label {
    padding: 8px 0;
  }
  
  input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
  
  /* Increase spacing for tooltip elements */
  .tooltip-scrollable-content {
    max-height: 40vh;
  }
  
  .connection-list li {
    padding-bottom: 12px;
    margin-bottom: 12px;
  }
}
/* Connection type labels in tooltips */
.connection-type {
  display: block;
  background-color: white;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.connection-type:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.connection-type h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
  font-size: 1.1rem;
  border-bottom: 2px solid rgba(0, 51, 102, 0.1);
  padding-bottom: 0.5rem;
}

.connection-type p {
  margin-bottom: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-color);
}

/* Specific connection type styles for labels in tooltips */
.tooltip .connection-type {
  display: inline-block;
  font-size: 0.8rem;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0.5rem;
  border-radius: 8px;
  transition: none;
}

.tooltip .connection-type:hover {
  transform: none;
  box-shadow: none;
}

.tooltip .connection-type.board {
  color: var(--board-color);
  background: rgba(0, 119, 187, 0.1);
  font-weight: 600;
}

.tooltip .connection-type.c-suite {
  color: green;
  background: rgba(238, 119, 51, 0.1);
  font-weight: 600;
}

.tooltip .connection-type.mixed {
  color: green;
  background: rgba(238, 119, 51, 0.1);
  font-weight: 600;
}

.connection-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 1rem auto;
  max-width: 1000px;
}

.connection-type-filters {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 0;
  flex-wrap: wrap;
}

.connection-type-filters label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  padding: 0.25rem 0;
  font-size: .9rem;
}

@media (max-width: 768px) {
  .connection-types {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 0.75rem 0;
    padding: .5rem;
  }
  
  .connection-type {
    padding: 1rem;
  }
  
  .connection-type-filters {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.5rem 0;
    width: 100%;
  }
  
  .connection-type-filters label {
    margin: 0.25rem 0;
    width: 100%;
  }
  
  .connection-type h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .connection-type p {
    font-size: 0.95rem;
    line-height: 1.4;
  }
}

.filter-label {
  font-weight: bold;
  font-size: 1rem;
  color: var(--text-color);
  /* margin-bottom: 5px; */
  text-align: center;
}

@media (min-width: 769px) {
  .filter-label {
    margin-bottom: 5px;
  }
  
  .key-container .key-label {
    text-align: left;
    /* margin-bottom: 15px; */
    /* border-bottom: 1px solid #eee;
    padding-bottom: 8px; */
  }
  
  /* .key-container {
    padding: 15px;
  } */
}

@media (max-width: 768px) {
  .filter-label {
    margin-bottom: 8px;
    font-size: 1rem;
  }
}

/* Mobile-specific styling adjustments */
@media (max-width: 768px) {
  .node {
    stroke-width: 1.8px; /* Increased from 1.5px */
  }
  
  .node:hover, .node.highlighted {
    stroke-width: 2.5px; /* Increased from 2px */
  }
  
  .node.selected {
    stroke-width: 3.5px; /* Increased from 3px */
  }
  
  .link.board {
    stroke-width: 2px; /* Increased from 1.5px */
  }
  
  .link.mixed {
    stroke-width: 3.5px; /* Increased from 3px */
  }
  
  .link.highlighted-board {
    stroke-width: 3.5px !important; /* Increased from 3px */
  }
  
  .link.highlighted-mixed {
    stroke-width: 4.5px !important; /* Increased from 4px */
  }
  
  .node-label {
    font-size: 12px; /* Increased from 11px to match script.js */
    max-width: 120px; /* Increased from 100px */
  }
}

/* Mobile adjustments for network graph */
@media (max-width: 480px) {
  #network-graph {
    /* Make the container a perfect square to avoid dead space */
    aspect-ratio: 1/1;
    width: 100%;
    height: auto;
    max-width: 100%; /* Ensure it doesn't exceed viewport width */
    min-height: auto;
    max-height: none;
    margin: 0 auto 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
  }
  
  /* Ensure SVG takes full container dimensions */
  #network-graph svg {
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
  }
  
  /* Position instructions near the bottom of the square */
  .instructions {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0 10px;
    text-align: center;
  }
  
  /* Position Reset button at the top */
  .controls {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
  }
}

/* Cluster Mode Filter Styles */
.cluster-mode-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.cluster-mode-filters label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  margin: 0;
}

/* Government Connection Visual Indicator in Key */
.key-item.gov-connection {
  border-left: 3px solid #D4AF37;
  padding-left: 8px;
}

