* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

/* Header Section */
#header {
  background: white;
  padding: 5px 12px;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  height: 35px;
  width: auto;
}

.header-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin: 0;
}

 .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: #0066cc;
  text-decoration: none;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s;
}

.nav-link:hover {
  background-color: #f0f0f0;
}

.nav-link.active {
  background-color: #0066cc;
  color: white;
  font-weight: bold;
}

.nav-link.active:hover {
  background-color: #0052a3;
}

/* Export button in header */
#export-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: #f8f8f8;
  color: #333;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

#export-button:hover {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  border-color: #ccc;
}

.export-icon {
  font-size: 13px;
  line-height: 1;
}

.export-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Map Container - Full screen except header */
#map-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 48px);
}

#viewDiv {
  width: 100%;
  height: 100%;
}

/* Affordability Map Container */
#affordability-map-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#affordabilityViewDiv {
  width: 100%;
  height: 100%;
}

/* PIT/HIC Map Container */
#pit-hic-map-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#pitHicViewDiv {
  width: 100%;
  height: 100%;
}

/* Tabs Section - Floating on map */
#tabs {
  position: absolute;
  top: 15px;
  left: 60px;
  /* transform: translateX(-50%); */
  background: white;
  padding: 2px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  gap: 5px;
  z-index: 50;
}

.tab {
  padding: 6px 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}

.tab.active {
  background: #0066cc;
  color: white;
  font-weight: bold;
  border-color: #0066cc;
}

.tab:hover {
  background: #e8e8e8;
}

.tab.active:hover {
  background: #0052a3;
}

/* Filter Panel - Floating on right */
#filter-panel {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 180px;
  max-height: calc(100vh - 360px);
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 10px;
  overflow-y: auto;
  z-index: 50;
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 12px;
}

.search-icon {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-item {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.filter-item input[type="checkbox"] {
  margin-right: 6px;
  width: 11px;
  height: 11px;
  cursor: pointer;
}

.filter-item label {
  cursor: pointer;
  font-size: 11px;
  color: #333;
  line-height: 1.3;
}

/* Charts Section - Floating at bottom */
#charts-section {
  position: absolute;
  bottom: 35px;
  left: 15px;
  right: 15px;
  height: 200px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.chart-panel {
  flex: 1;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 0px 10px 5px 10px;
  position: relative;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  margin-top: 5px;
}

.chart-title {
  font-weight: bold;
  font-size: 14px;
}

.chart-options {
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 0.5;
}

.chart-content {
  height: calc(100% - 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 12px;
}

.pie-chart-panel .chart-content {
  height: 100%;
}

/* Ensure canvases have proper dimensions */
#pieChartCanvas,
#histogramCanvas,
#costHistogramCanvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 100%;
}

/* Ensure map popup appears above all floating widgets */
.esri-view .esri-ui {
  z-index: 100 !important;
}

.esri-popup,
.esri-popup__main-container {
  z-index: 100 !important;
}

/* Tab Content Containers */
.tab-content {
  display: none;
  width: 100%;
  height: calc(100vh - 48px);
}

.tab-content.active {
  display: block;
}

/* Blank Page Style */
.blank-page {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9f9f9;
}

.blank-page p {
  color: #999;
  font-size: 16px;
  font-style: italic;
}

/* Export modal */
.export-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1010;
}

.export-modal-overlay.visible {
  display: flex;
}

.export-modal {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  width: 520px;
  max-width: 95vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 14px 18px 16px 18px;
}

.export-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.export-modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.export-modal-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: #666;
}

.export-modal-body {
  overflow-y: auto;
  padding-right: 4px;
}

.export-field-group {
  margin-bottom: 12px;
}

.export-label {
  display: block;
  font-weight: 600;
  font-size: 12px;
  color: #333;
  margin-bottom: 6px;
}

.export-radio-group {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #333;
}

.export-radio-group label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.export-checkbox-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #333;
}

.export-checkbox-column label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.export-checkbox-column input[type="checkbox"] {
  margin-top: 2px;
}

.export-help-text {
  font-size: 12px;
  color: #555;
  line-height: 1.4;
}

.export-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.export-primary-button,
.export-secondary-button {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.export-primary-button {
  border: 1px solid #0066cc;
  background: #0066cc;
  color: #fff;
}

.export-primary-button:hover {
  background: #0052a3;
  border-color: #0052a3;
}

.export-secondary-button {
  border: 1px solid #ddd;
  background: #f8f8f8;
  color: #333;
}

.export-secondary-button:hover {
  background: #ffffff;
}

.export-hidden {
  display: none;
}

