:root {
    --color-accent: #7bcf83;  /* Define the accent color */
}
  
body {
    /* Use the OS’s UI font, 1.5 line height, and center the body */
    font: 100%/1.5 system-ui; 
    max-width: 100ch;
    margin-inline: auto;
    padding: 10px;
    accent-color: var(--color-accent);
}

h1 {
    font-size: 130%;
}

h4{
    text-align: center;
}

.tooltip {
    position: fixed;
}
  
circle {
    transition: 200ms;
    transform-origin: center;
    transform-box: fill-box;
}

circle:hover {
    transform: scale(1.5);
}

.gridlines {
    stroke: #ddd;
    stroke-width: 0.3;
}
  
dl.info {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 12px;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1em;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    transition-duration: 500ms;
    transition-property: opacity, visibility;
}

dl.info dt {
    font-weight: normal;
    color: #666;
    margin: 0;
}

dl.info dd {
    font-weight: bold;
    color: #000;
    margin: 0;
}

dl.info[hidden]:not(:hover, :focus-within) {
    opacity: 0;
    visibility: hidden;
}

/* --------------------- */
/* New Layout Styles     */
/* --------------------- */

/* Container that wraps the sidebar and the chart */
.container {
    display: flex;
    gap: 20px;             /* Space between sidebar and chart */
    padding: 10px;
}

/* Sidebar for controls on the left */
.sidebar {
    flex: 0 0 200px;       /* Fixed width for controls */
    text-align: left;      /* Left-align the controls */
}

/* Style for the mouse select label and select element */
.mouse-select-label {
    display: block;
    line-height: 1.5; /* Adjust if needed */
}

.control-group h3,
.mouse-select-label {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

select {
    width: 80%;
    padding: 6px;
    margin-bottom: 15px;
}

/* Controls (buttons) styling within the sidebar */
.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

/* Button styling */
button {
    padding: 4px 8px;
    width: 80%;
    border: none;
    background-color: #ddd;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 4px;
    font-weight: 500;
}

/* Add spacing between buttons within each control group */
.control-group button:not(:last-child) {
    margin-bottom: 3px;
  }

#male-button{
    color: rgb(11, 164, 240);
}

#female-button{
    color: rgb(224, 84, 108);
}

#day-button{
    color: rgb(174, 134, 0);
}

#night-button{
    color: rgb(45, 0, 180);
}

/* Styling for the selected button */
.selected-button {
    background-color: #666;
    color: #ddd;
}

#male-button.selected-button{
    background-color: rgb(11, 164, 240);
    color: rgb(0, 0, 0);
}

#female-button.selected-button{
    background-color: rgb(224, 84, 108);
    color: rgb(0, 0, 0);
}

#day-button.selected-button{
    background-color: rgb(221, 176, 29);
    color: rgb(0, 0, 0);
}

#night-button.selected-button{
    background-color: rgb(141, 139, 234);
    color: rgb(0, 0, 0);
}

/* Chart container for the plot */
.chart-container {
    flex: 1;                          /* Take remaining space */
    display: flex;
    justify-content: center;          /* Center horizontally */
    align-items: center;              /* Center vertically */
    border: none;           /* Optional border */
    padding: 10px;
    min-height: 500px;
    margin-top: 20px;                 /* Optional: additional top margin */
    width: 100%;
    height: 100%;
}

/* ------------------------------- */
/* New controls container spacing  */
/* ------------------------------- */
.control-group {
  margin-bottom: 20px;
}

/* ------------------------------- */
/* Info icon & tooltip styles      */
/* ------------------------------- */

/* Update the info icon to vertically align with the text */
.info-icon {
  display: inline-block;
  margin-left: 8px;
  background-color: #ccc;
  color: #000000;
  font-size: 0.8rem;
  line-height: 1;
  width: 16px;
  height: 16px;
  text-align: center;
  border-radius: 50%;
  position: relative;
  cursor: help;
  vertical-align: middle; /* ensures the icon is centered relative to text */
  top: -1px; /* Adjust this value until it lines up exactly */
}

/* Adjust the tooltip styling: increase font size and adjust vertical offset */
.info-tooltip {
  visibility: hidden;
  opacity: 0;
  width: 220px; /* adjust as needed */
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 5px 8px;
  border-radius: 4px;
  position: absolute;
  bottom: 125%; /* positions tooltip above the icon */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  transition: opacity 0.3s;
  font-size: 1rem; /* increased font size */
}

/* Tooltip arrow remains the same */
.info-tooltip::after {
  content: "";
  position: absolute;
  top: 100%; /* at the bottom of the tooltip */
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

/* Show tooltip on hover */
.info-icon:hover .info-tooltip {
  visibility: visible;
  opacity: 1;
}