* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #F1F7ED;
}
/* Content (Replaces #container, #container2) */
.content {
  padding: 1rem;
  max-width: 100%;
  position: relative;
}
/* Rows */
.row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: stretch;
}

/* Data Note Container */
.data-note-container {
  position: absolute;
  top: 0px;
  right: 0px;
  font-size: 9px;
  background-color: #F1F7ED;
  padding: 0.5rem;
  border-radius: 4px;
  z-index: 1010;
  /* width: 270px; */
  max-width: 270px;
  }

.chart-container {
  flex: 1;
  max-width: calc(96vw - 250px); /* Your current width */
  position: relative;
  background-color: #e9ecef;
}

#chart1-container, #chart2-container, #chart3-container {
  position: relative;
}

#chart1-container {
  width: calc(96vw - 250px); /* Match your max-width */
}

.chart-container > div {
  width: 100%; /* Fill container width */
  height: 100%; /* Inherit container height to respect row-specific heights */
}
/* Table Containers */
.table-container {
  width: 250px;
  min-width: 250px;
  /* max-width: 320px; */
  overflow: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Aligns content to the bottom */
  }

/* Table Styling */
.totals-table {
  margin-top:60px;
  width: 100%;
  /* height: 100%; */
  border-collapse: collapse;
  font-size: clamp(8px, 0.8vw, 12px);
  line-height: 0.8; /* Tighter lines for compact look */
}
#totals-table1{
  margin-bottom: 200px;
}

.totals-table th, .totals-table td {
  border: 1px solid #7a7a7a;
  padding: 4px; /* Your original tight padding */
  text-align: left;
  margin: 0; /* Explicitly remove any cell margins */
}

.totals-table th {
  background-color: #f2f2f2;
  text-align: center;
}

.totals-tableheader {
  background-color: #A9D08E !important;
}

.main-row td {
  font-weight: bold;
}

.sub-row td:first-child {
  padding-left: 20px;
}

.totals-table td:nth-child(2),
.totals-table td:nth-child(3),
.totals-table td:nth-child(4) {
  text-align: right;
}

.totals-table tbody tr td:nth-child(2) span[id$="-pct_of_total"]::after {
  content: "%";
}
.totals-table tbody tr td:nth-child(2) span[id$="-pct_of_total2"]::after {
  content: "%";
}

.totals-table tbody tr td:nth-child(4) {
  font-size: 9px;
  text-align: center;
}

.row-1 .chart-container {
  height: calc(98vh - 35px); /* Chart 1 base height */
  max-height: 70vw;
}
.row-1 .table-container {
  height: calc(98vh - 35px); /* Align with chart 1 */
  max-height: 70vw;
}
.row-2 .chart-container {
  height: calc((95vh - 35px) * 2 / 3); /* 2/3 of chart 1 */
  max-height: calc(70vw * 2 / 3);
}
.row-2 .table-container {
  height: calc((95vh - 35px) * 2 / 3); /* Align with chart 2 */
  max-height: calc(70vw * 2 / 3);
}
.row-3 .chart-container {
  height: calc((98vh - 35px) / 3); /* 1/3 of chart 1 */
  max-height: calc(70vw / 3);
}
.row-3 .table-container {
  height: calc((98vh - 35px) / 3); /* Align with chart 3 */
  max-height: calc(70vw / 3);
}


#container,     /*don't mess with these that are used in the salinity graphs */
#container2 {
  position: relative;
  width: 95vw;
  height: 70vw;
  max-height: 100vh;
}
#chart1-container {
  position: relative;
  width: 80vw;
  height: 70vw;
  max-height: 95vh;
    }
  #chart2-container {
  position: relative;
  width: 80vw;
  height: 35vw;
  max-height: 95vh;
    }
#Roosevelt,
#TenCent {
  position: relative;
}
#stat-overlay,
#stat-overlay2 {
  position: absolute;
  top: 30px;
  left: 60px;
  background-color: #f7f7f7;
  padding: 8px;
  border: 1px solid #333; /* Outer border around entire table */
  border-radius: 12px;
  z-index: 10;
}
/* @media (max-width: 1200px) {
        #stat-overlay,
        #stat-overlay2 {
          
          top: auto;
          left: auto;
          min-width: 280px;
          left: 50%;
          transform: translateX(-50%);
        }
        #container,
        #container2 {
          top: 60px;
        }
        .next-link {
          display: none;
        }
      } */
@media (max-width: 1200px) {
  #stat-overlay,
  #stat-overlay2 {
    left: 0px;
  }
}
.stat-overlay-table,
.stat-overlay-table2 {
  border-collapse: collapse;
  width: 100%;
  font-size: clamp(5.5px, 1vw, 12px);

  color: #5a5a5a;
}

.stat-overlay-table th,
.stat-overlay-table2 th {
  text-align: left;
  text-decoration: underline;
  padding: 0px 2px;
  font-weight: normal;
}
.stat-overlay-table tr:nth-child(2),
.stat-overlay-table2 tr:nth-child(2) {
  color: red;
  /* font-weight: bold; optional */
}
.stat-overlay-table td,
.stat-overlay-table2 td {
  padding: 0px 2px;
}

.stat-overlay-table td:first-child,
.stat-overlay-table2 td:first-child {
  text-align: left;
}

.stat-overlay-table td:not(:first-child),
.stat-overlay-table2 td:not(:first-child) {
  text-align: right;
}

/* Remove interior lines but keep spacing clean */
.stat-overlay-table th,
.stat-overlay-table td,
.stat-overlay-table2 th,
.stat-overlay-table2 td {
  border: none;
}
/* Navigation */
.navigation {
    /* position: relative; */
    /* padding: 10px; */
    /*---*/
    position: fixed;
    top: 0;
    left: 0;
    width: calc(96vw - 250px);
    height: 35px;
    background-color: #F1F7ED;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem; /* Space between buttons */
    z-index: 1000;
    overflow-x: auto; /* Scroll if too many buttons */
    white-space: nowrap; /* Prevent button wrapping */
}
.nav-items {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-link {
  /* position: absolute; */
  top: 0;
  background-color: rgba(168, 168, 168, 0.6);
  color: white;
  padding: 0 0.15em; /* Remove vertical padding to avoid height conflicts */
  border-radius: 4px;
  min-height: 24px; /* Use min-height instead of fixed height */
  max-width: 20vw;
  text-decoration: none;
  font-family: sans-serif;
  z-index: 11;
  white-space: nowrap;
  cursor: pointer;
  display: flex; /* Add flex for vertical centering */
  justify-content: center; /* Horizontal centering */
  align-items: center; /* Vertical centering */
}
.nav-link.home-link {
  position: absolute;
  left: 1rem; /* Offset from left edge */
  top: 50%;
  transform: translateY(-50%); /* Vertical centering */
  z-index: 1001; /* Above other nav items */
}
.nav-link span,
.nav-link .link-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link.home-link {
    left: 10px;
    font-size: clamp(1rem, 1vw, 1rem);
    display: flex; /* Ensure flexbox for centering */
    justify-content: center; /* Horizontal centering */
    align-items: center; /* Vertical centering */
    min-height: 24px; /* Match .nav-link min-height */
    padding: 0 0.15em; /* Match .nav-link padding */
    line-height: 1; /* Normalize line height for larger font */
}

.nav-link.toggle-link {
  right: calc(20vw + 266px);
  font-size: clamp(0.9rem, 0.9vw, 0.9rem);
  width: 60px;
  padding: 0 0.15em; /* Consistent padding */
  display: flex; /* Already present, kept for clarity */
  justify-content: space-between;
  align-items: center;
}

.nav-link.back-link {
  right: calc(20vw + 176px);
  font-size: clamp(0.9rem, 0.9vw, 0.9rem);
  min-width: 84px;
  display: flex; /* Add for vertical centering */
  justify-content: center;
  align-items: center;
}

.nav-link.forward-link {
  right: 20vw;
  font-size: clamp(0.9rem, 0.9vw, 0.9rem);
  min-width: 84px;
  display: flex; /* Add for vertical centering */
  justify-content: center;
  align-items: center;
}

.year-input {
  right: calc(20vw + 90px);
  width: 80px;
  padding: 0;
  border: 2px solid #ccc;
  border-radius: 4px;
  font-size: clamp(0.9rem, 0.9vw, 0.9rem);
  font-weight: bold;
  color: #5a5a5a;
  outline: none;
  text-align: center;
  background-color: #f1f7ed;
  display: flex; /* Add for vertical centering */
  justify-content: center;
  align-items: center;
  min-height: 24px; /* Match nav-link */
}

.year-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.toggle-option {
  width: 50%;
  text-align: center;
  z-index: 12;
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 0;
  width: 50%;
  height: calc(100% - 4px);
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  transition: left 0.3s ease;
  z-index: 11;
}

.nav-link::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 5px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 9999;
}

.nav-link:hover::after {
  opacity: 1;
}

/* @media (max-width: 735px) {
  .home-link {
    /* this isn't working the way i wan't */
    /* display: none; 
    position: relative;
    left: 0px;
  }
} */
.nav-link:hover, .nav-link.toggle-link:hover  {
  background-color: rgba(70, 70, 70, 0.8);
}
.year-input:hover {
  background-color: #F1F7ED
}  
.next-link {
  position: absolute;
  font-size: clamp(0.9rem, 0.9vw, 0.9rem);
  left: 170px; /* Offset from left edge */
  top: 50%;
  transform: translateY(-50%); /* Vertical centering */
  z-index: 1001; /* Above other nav items */
}
.salinitynext-link {        
  position: absolute;
  top: 95vh;
  left: 60px;
  background-color: rgba(168, 168, 168, 0.6);
  color: white;
  padding: 0.15em 0.15em;
  border-radius: 4px;
  max-width: 20vw;
  text-decoration: none;
  font-family: sans-serif;
  z-index: 11;

  white-space: nowrap; /* Don't wrap */
  /* overflow: hidden; Hide any overflow */
  /* text-overflow: ellipsis; Show "..." if needed */
  /* font-size: clamp(1rem, 1vw, 1rem); Shrinks based on viewport */
} 
.note-overlay {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(63vw - 250px) !important;           /* fixed width */
  height: 10vh !important;           /* fixed width */
  padding: 15px 20px;
  background: rgba(243, 237, 237, 0.507);
  border: 1px solid #ccc;
  border-radius: 8px;     /* optional rounded corners */
  font-size: 12px;
  color: #333;
  font-weight: bold;
  text-align: left;
  /* pointer-events: none; */
  box-shadow: 0 2px 6px rgba(0,0,0,0.2); /* optional shadow */
}

   

#timeseries-note {
  margin-top: 2px;
  line-height: 1.2;
}
html {
  scroll-behavior: smooth;
}
/* Responsive Stacking */
@media (max-width: 900px) {
  .row {
    flex-direction: column;
  }
  .chart-container, .table-container {
    max-width: 100%;
    /* height: auto; */
  }
  .row-1 .chart-container { max-height: 432px }
  .row-2 .chart-container { max-height: 432px; }
  .row-3 .chart-container { max-height: 432px; }
  .row-1 .table-container { max-height: fit-content }
  .row-2 .table-container { max-height: fit-content }
  .row-3 .table-container { max-height: fit-content }
  .data-note-container {
    position: static;
    max-width: 100%;
    margin-bottom: 1rem;
  }
  .table-container {
  width: 100vw;
  /* min-width: 250px; */
  /* max-width: 320px; */
  /* overflow: auto; */
  padding: 0;
}
.totals-table {
  margin-top:0px;
  width: 100%;
  /* height: 100%; */
  border-collapse: collapse;
  font-size: 16px;
  line-height: 0.8; /* Tighter lines for compact look */
}
#totals-table1{
  margin-bottom: 0px;
}
#totals-table2 {
  display: none;
}
#total-storage-note-row td{
  font-size: clamp(6px, 0.6vw, 8px) !important;
}

/* Navigation container full width */
 .navigation {
  width: 100vw !important;
  height: auto;                   /* let height adapt */
  max-width: 100% !important;
  display: flex;
  flex-wrap: wrap;                /* allow wrapping */
  justify-content: center;        /* center items horizontally */
  padding: 0.25rem 0;             /* smaller padding */
  box-sizing: border-box;
}

.nav-items {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  gap: 0.25rem;                   /* tighter gap */
}

.nav-link,
.nav-link.toggle-link,
.nav-link.back-link,
.nav-link.forward-link,
.year-input {
  top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
  flex: 1 1 calc(33% - 0.25rem);  /* 3 equal buttons per row */
  height: 30px;                   /* fixed height */
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(0.9rem, 1vw, 1rem);
  margin: 0;                      /* remove extra vertical spacing */
}

.home-link {
  position: static !important;   /* override absolute */
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
  /*flex: 4 4 calc(66% - 0.25rem);   twice as wide as others */
  height: 30px;                   /* same height */
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;                      /* no margin */
}

.nav-link.toggle-link .toggle-slider {
  margin-left: 0.25rem;
}

.next-link {
  display: none;
}


}