html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box; 
  }

body {
    font-family: Arial, sans-serif;
    text-align: center; 
    background-color: white;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;      /* vertically center */
    justify-content: center;  /* horizontally center */
    height: 100vh;
}

#appView {
  width: 100%;
}

/* Loading Overlay (Full-Screen) */
#loadingOverlay {
    display: none; /* hidden by default */
    position: fixed;
    z-index: 9999; /* above all other elements */
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* semi-transparent black bg */
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 2em;
}
      
/* Simple spinner animation */
.spinner {
    border: 16px solid #f3f3f3; /* Light grey */
    border-top: 16px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 80px; height: 80px;
    animation: spin 2s linear infinite;
    margin-bottom: 20px;
    }
    @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 

  /* Centered Splash Container */
  #loginScreen {
    display: none; /* or block if it's the default visible screen */
    width: 100%;
    height: 100%;
    background: #f1f2f6; /* or white */
    
    /* Center it */
    display: flex; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center; 
  }
  #loginScreen h1 {
    margin: 0 0 1rem;
    font-size: 2rem;
    font-weight: 600;
    color: #333;
  }
  #loginScreen p {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: #666;
    line-height: 1.4;
  }
  .login-btn-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
  }
  #loginBtn, #fetchBtn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #0078d7; /* Microsoft Blue */
    color: #fff;
    transition: background-color 0.2s ease;
  }
  #loginBtn:hover, #fetchBtn:hover {
    background-color: #005a9e;
  }


#visualizationScreen {
  display: none;  /* you’ll enable it via JS once logged in */
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  /* If you have a sidebar and main panel, you can do a flex layout */
  display: flex;
  flex-direction: row;
}





#main_title {
    font-size: 34px;
    font-weight: bold; 
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
    width: 100%;
}

#summary {
    font-size: 16px;
    margin-top: 0px;
    margin-bottom: 10px;
    width: 100%;
    color: #555;
}
#label {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-top: 0px;
    margin-bottom: 10px;
    width: 100%;
}

.dashboard {#visualizationScreen {
    display: none;  /* you’ll enable it via JS once logged in */
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    /* If you have a sidebar and main panel, you can do a flex layout */
    display: flex;
    flex-direction: row;
  }
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    display: flex;
    flex-direction: column;  /* Arrange items in a column */
    justify-content: space-between;  /* Push the feedback button to the bottom */
    background-color: #f4f4f4;
    width: 20%;
    padding: 10px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar .section {
    margin-bottom: 20px;
}

.sidebar h3 {
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #333;
    text-align: left;
}

.sidebar button {
    display: block;
    width: 100%; /* Ensure all buttons are the same width */
    padding: 10px;
    margin-bottom: 5px;
    border: none;
    background-color: #fff;
    color: #333;
    text-align: left;
    cursor: pointer;
    border-radius: 5px;
    box-sizing: border-box; /* Ensures padding/border doesn't affect width */
}

.sidebar button:hover {
    background-color: #ddd;
}

.sidebar button:hover + .fronttooltip {
    display: block;
    top: 100%; 
    left: 0;
}

.feedback-section {
    margin-top: auto; 
    padding: 0;
}

.feedback-section button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 5px;
    border: 2px solid #808080; 
    background-color: #fff;
    color: #333;
    text-align: left;
    cursor: pointer;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Main Panel */
.main-panel {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    height: 90vh;
    width: 80%;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: #fff;
}

.main-panel > div {
    width: 100%;
}

/* Front Tooltip */
.fronttooltip {
    display: none;
    position: absolute;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 5px; 
    z-index: 1000;
    border-radius: 5px; 
    font-family: Arial, sans-serif; 
    font-size: 14px; 
}

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

.fronttooltip li {
    padding: 5px 10px; 
    cursor: pointer;
    font-family: Arial, sans-serif; 
    font-size: 14px; 
}

.fronttooltip li:hover {
    background-color: #ddd; 
}

/* Feedback Dialog */
.dialog {
    display: none; 
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.dialog-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    width: 400px;
    margin: auto;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.tooltip {
    position: absolute;
    text-align: center;
    width: auto;
    padding: 8px;
    font: 12px sans-serif;
    background: #f0f0f0;
    border: 0px;
    border-radius: 8px;
    pointer-events: none;
}
        
#dateWindowCanvasRow, 
#dateWindowCanvasRowSub {
    display: flex;            
    flex-direction: row;
    width: 100%;
    max-height: 800px;
    gap: 10px;               /* optional spacing between charts */
    justify-content: space-between;
    align-items: stretch;
}
  
  /* Each canvas takes half the container's width */
#dateWindowCanvasRow canvas,
#dateWindowCanvasRowSub canvas {
    width: 100%;
    height: auto;
}
  
.chart-container {
    flex: 1 1 50%;
    height: 400px;
}

.chart-title {
    margin-top: 10px;
    font-size: 16px;
    font-weight: bold;
    text-align: right;
}
  
.chartContainer {
  position: relative;
  width: 100%;
  height: 400px;          /* Fix the height so it doesn’t grow with width */
  flex: 0 0 auto;         /* If it's in a flex layout, prevent auto-stretching */
  margin: 0 auto;
}

.chartContainer canvas {
  width: 100% !important;  /* Stretch the canvas to full container width */
  height: 100% !important; /* But keep the container’s fixed height */
}

canvas {
    width: 100%;     /* Let it fill width */
    height: auto;    /* Let Chart.js set a default aspect ratio or auto-height */
    /* max-height: 500px; /* optional, to cap it */
  }

/* Custom tooltip styles */
#chartjs-tooltip {
    position: absolute;
    background: rgba(175, 175, 175, 0.5);
    color: black;
    border-radius: 4px;
    pointer-events: none;
    padding: 8px;
    transition: all .1s ease;
    font-size: 12px;
    transform: translate(-50%, -100%);
}


/* gender_age */
.chart {
    display: flex;
    justify-content: center;
}
.bar {
    fill-opacity: 0.8;
    cursor: pointer;
}
.axis text {
    font-size: 12px;
}
.axis path,
.axis line {
    fill: none;
    stroke: #000;
    shape-rendering: crispEdges;
}

/* race_area */

/* countsmap */
/* Map Containers */
#map, #map2, #map3 {
    height: 600px;
    width: 100%;
    background-color: white;
    margin: 0;
    padding: 0;
    display: none; /* Hide all maps by default */
}

/* Display the third map by default */
#map3 {
    display: block;
}

/* Tabs Container */
.tabs {
    display: flex;
    justify-content: center; /* Center the tabs horizontally */
    margin-bottom: 10px;
    border-bottom: 2px solid #ccc;
}

/* Individual Tab */
.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    color: #555;
    border: none;
    background: none;
    outline: none;
    transition: color 0.3s;
    margin-right: 5px;
}

/* Remove right margin from the last tab */
.tab:last-child {
    margin-right: 0;
}

/* Active Tab */
.tab.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
}

/* Tab Hover Effect */
.tab:hover {
    color: #0056b3;
}

/* Minimalist Legend Styles */
.info.legend {
    background: rgba(255, 255, 255, 0.8);
    padding: 5px;
    font: 12px Arial, sans-serif;
    color: #333;
    line-height: 18px;
}

.info.legend i {
    width: 12px;
    height: 12px;
    float: left;
    margin-right: 5px;
    opacity: 0.8;
}		

/* PTC */
  line.node-link, path.node-link {
    fill: none;
    stroke: #959595;
  }
  circle.node {
    fill: white;
    fill-opacity: 0.8;
  }
  rect.node {
    fill: white;
  }
  circle.node + text {
    text-anchor: middle;
  }
  rect.node + text {
    text-anchor: middle;
  }
  text {
    font-family: sans-serif;
    pointer-events: none;
  }
  svg {
    display: block;
    margin: 0 auto;

  }
  /* Tooltip styling */
  .ptc_tooltip {
    position: absolute;
    text-align: center;
    width: auto;
    height: auto;
    padding: 5px;
    font: 12px sans-serif;
    background: lightgrey;
    border: 0px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
  }

/* sankey */
.node rect {
    fill-opacity: 0.8;
    shape-rendering: crispEdges;
}
.node text {
    font-size: 14px;
    pointer-events: none;
}
.link {
    fill: none;
    stroke: grey;
    stroke-opacity: 0.3;
}
.link:hover {
    stroke-opacity: 0.6;
}
.overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
}
.popup-window {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border: 1px solid black;
    padding: 20px;
    z-index: 1000;
    max-height: 80%;
    overflow-y: auto;
    width: 80%;
}
.popup-window table {
    width: 100%;
    border-collapse: collapse;
}
.popup-window th, .popup-window td {
    border: 1px solid black;
    padding: 5px;
    text-align: left;
}
.popup-window table tr td[colspan] {
    background-color: #f0f0f0;
    text-align: left;
    font-size: 16px;
    font-weight: bold;
}	
		
.hidden-visualization-content {
  display: none;  /* or block when visible */
  width: 100%;
}
