/* 
General text CSS 
*/

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  font: 100%/1.5 system-ui;
  background: #212121;
  color: #e5e5e5;
  overflow: hidden;
}

p.bottom {
  margin-bottom: 30px;
}

/* 
Page CSS 
*/

#slider-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.page {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow-y: auto;
  padding-bottom: 20px;
  box-sizing: border-box;

  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.page:first-child, .page:nth-last-child(2) {
  display: flex !important;
  flex-direction: column;
  justify-content: center !important;
  align-items: center !important;
  text-align: center;
  padding: 0 !important;
  height: 100%;
  overflow: hidden;       

  h1 {
    font-size: 40px;
  }
}

.page:not(:first-child) {
  display: flex;
  flex-direction: column;
  align-items: center;  
  text-align: center;  
  padding-top: 10px;
  height: 100%; 

  h2 {
    margin-bottom: 0;
  }
}

.page:last-child {
  align-items: flex-start !important;
  text-align: left !important;
  justify-content: left !important;
  padding-left: 80px;
  padding-right: 80px;
  
  h1 {
    width: 100%;
    text-align: center !important;
  }
  h2 {
    margin-bottom: 20px;
  }
}

.page.active {
  opacity: 1;
  pointer-events: auto;
}

/* Wipe overlay */
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  background: white;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.5s ease-in-out;
  pointer-events: none;
}

/* Trigger wipe-out animation */
.page.wipe-out::after {
  clip-path: inset(0 0 0 0); 
}

/* 
Arrows 
*/

#left-arrow, #right-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 60px;
  cursor: pointer;
  color: #444;
  padding: 10px;
  user-select: none;
  z-index: 1000;
}
#left-arrow { left: 20px; }
#right-arrow { right: 20px; }
#left-arrow:hover, #right-arrow:hover { color: black; }

.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/*
Map images
*/

.quadrants-scroll {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 70%;
  gap: 10px;
  overflow: visible;
  margin-bottom: 50px;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: flex;
    opacity: 0;
    transition: opacity 0.6s ease;
  }
  img.fade-in {
    opacity: 1;
  }
}

/* ================================= Vegetation Density Line Viz Dropdown */

.stateControls {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 15px 0 25px 0;
}

.stateControls label {
  font-size: 18px;
  margin-bottom: 8px;
}

.stateControls select {
  padding: 0.5rem;
  border: 1px solid oklch(80% 3% 200);
  background: white;
  color: black;
  border-radius: 6px;
  font-size: 15px;
  min-width: 180px;
  cursor: pointer;
}

/*
Line plot
*/

.linePlotCitation {
  font-size: 12px;
  color: #ccc;
  text-align: center;
  margin-top: 5px;
}

.linePlotCitation a {
  color: #47e664ff;
  text-decoration: none;
}

.linePlotCitation a:hover {
  text-decoration: underline;
}

.linePlotFootnote {
  font-size: 0.85em;
  color: #cbcbcb;
  margin-top: 4px;
  font-style: italic;
}

#lineTooltip, #lineTooltipExtended{
    position: fixed;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.1s ease-in-out;
}

.linePlotDisplay {
  margin-bottom: 20px;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #2c2c2c;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.slider-label {
    font-weight: 600;
    color: #ffffff;
    min-width: 140px;
}

#time-slider {
    width: 300px;
    height: 6px;
    border-radius: 3px;
    background: #555;
    outline: none;
    cursor: pointer;
    transition: background 0.3s;
}

#time-slider:hover {
    background: #777;
}

#time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #47e664;
    cursor: pointer;
    border: 2px solid #fff;
    transition: background 0.3s, transform 0.2s;
}

#time-slider::-webkit-slider-thumb:hover {
    background: #3ebc57;
    transform: scale(1.2);
}

#time-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #47e664;
    cursor: pointer;
    border: 2px solid #fff;
    transition: background 0.3s, transform 0.2s;
}

#selected-Year-Range {
    font-weight: 600;
    color: #ffffff;
    min-width: 90px;
    text-align: center;
}

.controls {
  display: flex;
  border-bottom-width: 1px;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.controls .item {
  display: flex;
  flex-direction: column;
  align-items: center;  
  text-align: center;  
  padding-top: 10px;
  height: 100%; 
}

.controls select {
  padding: 0.5rem;
  border: 1px solid oklch(80% 3% 200);
  border-radius: 0.25rem;
  background: var(--bg, white);
  color: gray;
  min-width: 10rem;
}

.controls button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.25rem;
  font-weight: bold;
  cursor: pointer;
}

/* ================================= Viz Margin Adjustment  */
.heatmapDisplay {
  margin-bottom: 10px;
}

.linePlotDisplay {
  margin-bottom: 20px;
}

/* ================================= Heatmap info box  */
/* Info Box Container */
#info-box-container {
    background-color: rgba(33, 33, 33, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Region List */
#info-box {
    list-style: none;
    padding: 0;
    margin: 1em 0em 0em 0em;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

#info-box li {
    display: flex;
    justify-content: space-between; /* Name left, value right */
    align-items: center;
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    flex: 1;
    min-height: 45px;
}

#info-box li .region-name {
    font-weight: bold;
    color: #fff;
    font-size: 14px;
    margin-right: 15px; /* Space between name and value */
}

#info-box li .region-value {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 15px;
    white-space: nowrap;
}

/* ================================= Overlay masking when hover  */
.region-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: transparent;
    pointer-events: all;
}

#info-box .region-list li:hover {
    background-color: rgba(33, 33, 33, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* ================================= More heatmap info box adjustment  */
#info-box h3 {
    margin: 0 0 12px 0;
    color: #fff;
    font-size: 18px;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 10px;
}

#info-box {
    padding: 24px 32px;
    border-radius: 12px;
    color: #fff;
    width: auto;
    max-width: 100%;
}