
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: sans-serif;
}
#map {
  width: 70%;
  height: 100%;
  float: left;
}
#sidebar {
  width: 30%;
  height: 100%;
  float: right;
  box-sizing: border-box;
  padding: 20px;
  background: #f4f4f4;
  overflow-y: auto;
  border-left: 1px solid #ccc;
}
#uDiagram {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.seat-highlighted {
  stroke: black;
  stroke-width: 4px;
  filter: drop-shadow(0 0 3px black);
}
#chart-wrapper {
  width: 100%;
  height: 350px; 
  position: relative;
  margin-bottom: 30px;
}
#resultsChart {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

#informalChartWrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 20px;
  text-align: center;
}
#informalChartContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
#informal-heading {
  font-size: 16px;
  margin: 5px 0;
  width: 100%;
  text-align: center;
}
#informalChart {
  display: block;
  margin: 0 auto;
  max-width: 300px;
}
#semicircle-donut-container {
  margin-top: 40px !important; 
  margin-bottom: 40px !important; 
}
#vote-counter {
  text-align: center;
  font-size: 16px;
  margin-bottom: 20px;
}
#toggleViewBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
  color: #fff;
  padding: 18px 20px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  gap: 10px;
  min-height: 44px;
  min-width: 180px;
  position: relative;
  top: 10px;
  left: 35%;
  transform: translateX(-50%);
  z-index: 1000;
  touch-action: manipulation;
}
#toggleViewBtn img {
  height: 24px;
  width: auto;
}
#toggleViewBtn span {
  white-space: nowrap;
}
#region-name {
  width: 100%;
  text-align: center;
  margin: 20px 0;
  padding: 0;
  display: block !important;
  box-sizing: border-box !important;
}
.section-divider {
  margin: 20px auto;
  width: 80%;
  height: 2px;
  background-color: #ccc;
}

.modeToggleBtn {
  background-color: #000;
  color: #fff;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.modeToggleBtn:hover {
  background-color: #333;
}

#viewModeButtons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}




#mobile-hex-button-script {
  display: none;
}


@media (max-width: 768px) {
  #map {
    width: 100% !important;
    height: 50vh !important;
    float: none !important;
  }
  
  #sidebar {
    width: 100% !important;
    height: 50vh !important;
    float: none !important;
    overflow-y: auto !important;
    border-left: none !important;
    border-top: 1px solid #ccc !important;
    padding: 15px !important;
  }
  
  
  #chart-wrapper {
    height: 280px !important;
  }
  
  
  #uDiagram {
    max-height: 150px !important;
  }

  
  body:not(.hex-button-fixed)::after {
    content: '';
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 0 !important;
    z-index: 1 !important;
  }
  
  
  html body div#map div button#toggleViewBtn,
  #toggleViewBtn {
    position: fixed !important;
    top: 10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    z-index: 9999 !important;
    min-width: 180px !important;
    width: auto !important;
  }
}


@media (max-width: 480px) {
  #viewModeButtons {
    flex-direction: column !important;
    align-items: center !important;
  }
  
  .modeToggleBtn {
    width: 100% !important;
    max-width: 280px !important;
  }
  
  #toggleViewBtn span {
    font-size: 14px !important;
  }
  
  #toggleViewBtn {
    padding: 10px 15px !important;
  }
}


#yearDropdown {
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: bold;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

#yearDropdown:hover {
    border-color: #005a8b;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

#yearDropdown:focus {
    outline: none;
    border-color: #005a8b;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.2);
}

/* Mobile adjustments for year selector */
@media (max-width: 768px) {
    #yearDropdown {
        font-size: 18px;
        padding: 10px 35px 10px 15px;
    }
}


.year-selector-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.year-selector {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: inherit;
    z-index: 10;
}
.year-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.year-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, #0f0f0f 0%, #1f1f1f 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.year-display:active {
    transform: translateY(0px);
    transition: all 0.1s;
}

#currentYear {
    font-size: 48px;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    letter-spacing: -2px;
    line-height: 1;

}

.dropdown-arrow {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    margin-top: 4px;
}

.year-selector-container:hover .dropdown-arrow {
    color: white;
    transform: translateY(1px);
}


/* TPP Swing Pendulum */
.tpp-pendulum-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.tpp-row {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 8px 10px;
}

.tpp-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.tpp-bar {
  position: relative;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: #f2f2f2;
}

.tpp-bar .tpp-zero {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #777;
  opacity: 0.6;
}

.tpp-bar .tpp-fill {
  position: absolute;
  top: 0; bottom: 0;
}

.tpp-value {
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tpp-pendulum-national {
  padding: 8px 10px;
  background: #111;
  color: #fff;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  text-align: center;
}

.tpp-row-highlighted {
  background: #007acc !important;
  color: white !important;
  border-color: #005a99 !important;
}

.tpp-row-highlighted .tpp-name,
.tpp-row-highlighted .tpp-value {
  color: white !important;
}