:root {
  --color-primary-blue: #305DFB;
  --color-primary-blue-selected: #053AF5;
  --color-white: #FFFFFF;
  --color-text-primary: #2C405A;
  --color-text-secondary: #3F536E;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: #F7F9FF;
}

/* Layout */
.layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
/* Header */
.header {
  background: #15032D;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo {
  font-weight: bold;
  font-size: 18px;
  margin-right: 24px;
}

.logo-img {
  height: 24px;
  width: auto;
  display: block;
}

.header-title {
  font-size: 16px;
  color: var(--color-white);
  font-weight: 600;
}

.header .button-container {
  position: absolute;
  right: 24px;
  z-index: 1000; /* Ensure it floats above the map */
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

/* Body */
.body {
  display: flex;
  flex: 1;
  overflow: hidden;
}


.main-layout {
  display: flex;
  width: 100%;
  height: calc(100vh - 56px); /* full screen */
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--color-white);
  border-right: 1px solid #E0E0E0;
  box-sizing: border-box;
  position: relative;
  transition: transform 0.3s ease;
}


.toggle-tab {
  color: #A8C6DF;
  position: absolute;
  top: 60px;
  right: -32px; /* sticks outside the sidebar */
  transform: translateY(-50%);
  background: var(--color-white);
  border-right: 1px solid #E0E0E0;
  border-top: 1px solid #E0E0E0;
  border-bottom: 1px solid #E0E0E0;
  width: 32px;
  height: 40px;
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2000; /* <-- make sure it's HIGHER than your map */
  border-radius: 0 8px 8px 0;
}
.toggle-tab:hover {
  color: var(--color-primary-blue);
}
/* Sidebar Content */
.sidebar-content {
  overflow-y: auto;
  max-height: calc(100vh - 64px - 48px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  /* Hide scrollbar - Firefox */
  scrollbar-width: none;
  /* Hide scrollbar - IE/Edge */
  -ms-overflow-style: none;
  gap: 0px;
}

/* Hide scrollbar - Chrome, Safari, Opera */
.sidebar-content::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}


.panel-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-title, .sub-title {
  font-size: 12px;
  letter-spacing: 1px;
  color: #2C405A;
  font-weight: 600;
  text-transform: uppercase;
}

.sub-title {
  color: #3F536E;
}

.sub-title.full {
  width: 100%;
}
.sub-title.switch-text {
  width: 80%;
}

.panel-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}


.panel-file-name {
  font-size: 16px;
  font-weight: 400;
  color: #2C405A;
}

.small-button-secondary {
  font-family: 'Poppins', sans-serif;
  background: none;
  border: 1px solid #D8E5EE;
  color: var(--color-primary-blue);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s;
  line-height: 12px
}

.small-button-secondary:hover {
  background: var(--color-primary-blue);
  border: 1px solid var(--color-primary-blue);
  color: #fff;
}

.small-button-primary {
  font-family: 'Poppins', sans-serif;
  background: var(--color-primary-blue);
  border: 1px solid var(--color-primary-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 0 16px;
  border-radius: 16px;
  max-height: 24px;
  min-height: 24px;
  cursor: pointer;
  transition: 0.3s;
}

.small-button-primary:hover {
  background: var(--color-primary-blue-selected);
}

.small-icon-button-secondary:hover svg{
  fill: var(--color-white);
}

.file-upload-button {
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 6px 16px;
  cursor: pointer; /* Pointer on the label */
}

.file-upload-button input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 12px;
  cursor: pointer; /* Pointer also on the input */
}

.checkbox-row {
  margin-top: 4px;
}

.checkbox-container {
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  color: #333;
  font-weight: 400; /* Normal weight */
  display: flex;
  align-items: center;
}

/* Hide default checkbox */
.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

/* Custom checkbox */
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: var(--color-white);
  border: 1px solid #A8C6DF;
  border-radius: 4px;
}

/* When checked, change background */
.checkbox-container input:checked ~ .checkmark {
  background-color: var(--color-primary-blue);
  border-color: var(--color-primary-blue);
}

/* Checkmark/indicator (hidden when not checked) */
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

/* Checkmark/indicator style */
.checkbox-container .checkmark:after {
  left: 6px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ✅ Change font-weight when checked */
.checkbox-container input:checked ~ .checkmark + span {
  font-weight: 600;
}

.radio-container {
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  font-weight: 400; /* Normal weight */
  display: flex;
  align-items: center;
}

/* Hide default radio button */
.radio-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

/* Custom radio circle */
.radio-mark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: var(--color-white);
  border: 1px solid #A8C6DF;
  border-radius: 50%; /* Circle shape */
  box-sizing: border-box;
  color: #2C405A
}

/* When checked, change border */
.radio-container input:checked ~ .radio-mark {
  border-color: var(--color-primary-blue);
}

/* Inner dot hidden by default */
.radio-mark::after {
  content: "";
  position: absolute;
  display: none;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background-color: var(--color-primary-blue);
  border-radius: 50%;
  transform: translate(-50%, -50%); /* 🎯 perfectly center */
}

/* Show inner dot when selected */
.radio-container input:checked ~ .radio-mark::after {
  display: block;
}

/* Change font-weight when selected */
.radio-container input:checked ~ .radio-mark + span {
  font-weight: 600;
}

.textfield {
  width: 60px;
  padding: 8px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: 'Roboto Mono', monospace;
  text-align: center;
}

#map-container {
  flex: 1;
  position: relative;
  width: 100vw;
  height: 100%;
  overflow: hidden;
  background-color: ##f2f2f2;
  cursor: default;
  transition: width 0.3s ease;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 0;
  padding: 0;
}

.sidebar.collapsed .toggle-tab {
  right: -32px; /* keep the tab sticking out */
}

#map-container.expanded {
  flex-grow: 1;
}

#map-container.panning {
  cursor: grabbing;
}



#svg-container {
  width: 100%;
  height: 100%;
}

#svg-container svg {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
}

.controls {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 8px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

button {
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
}



.site-entry {
  margin-bottom: 10px;
}

.msa-hover:hover {
  fill: orange !important;
  cursor: pointer;
}

#scale-zoom-controls {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 8px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

input[type="range"],
input[type="number"] {
  width: 100px;
}

.spacebar-held {
  cursor: grab !important;
}

.msa-dot {
  cursor: pointer;
}

.marker-label {
  font-size: 12px;
  fill: #333;
  pointer-events: none;
}

/* CARD */
.info-card {
  position: absolute; /* <<< CHANGED from fixed to absolute */
  right: -448px; /* Start off-screen */
  top: 50%;
  transform: translateY(-50%);
  width: 448px;
  background: white;
  border-radius: 8px 0 0 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  color: #333;
  overflow: hidden;
  padding: 24px 24px 0 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 56px - 48px); /* 24px top + 24px bottom */
  transition: right 0.4s ease;
  z-index: 10; /* Put above map but below header */
}
/* When active (visible) */
.info-card.active {
  right: 0; /* Slide into view */
}
.info-header {
  margin-bottom: 16px;
}

.info-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #2C405A;
}

.info-sub {
  font-size: 14px;
  color: #3F536E;
  margin-top: 4px;
}

.clickable {
  cursor: pointer;
  color: #5271FF;
  text-decoration: none;
  transition: color 0.3s, text-decoration 0.3s;
}

.clickable:hover {
  color: #5271FF;
  text-decoration: underline;
  background-color: #EBEFFF;
}


.site-info-table{
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 144px);
  margin-bottom: 24px; /* <-- Give a little bottom padding for last item */
  border: 1px solid #D8E5EE;
  /* Hide scrollbar - Firefox */
  scrollbar-width: none;
  /* Hide scrollbar - IE/Edge */
  -ms-overflow-style: none;
  gap: 0px;
}

.site-info-table.dashboard {
  gap: 8px;
  border: none;
}

/* Hide scrollbar - Chrome, Safari, Opera */
.site-info-table::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}


.info-section {
  margin-bottom: 14px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background-color: #F9FAFC;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background-color: #FFFFFF; /* light grey/blue tone */
}

.site-info-table > .info-row:nth-child(even) {
  background-color: #F7F9FF; /* light grey/blue tone */
}

.info-cell {
  display: flex;
  align-items: center;
}

.rank-label {
  font-family: 'Roboto Mono', monospace;
  border: 1px solid #D8E5EE;
  font-size: 12px;
  font-weight: 600;
  color: #2C405A;
  background: #F7F9FF;
  border-radius: 2px;
  width: 24px;
  height: 20px;
  justify-content: center;
}

.info-row .title {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  color: #2C405A;
  width: 168px;
}


.info-row:hover{
  background-color: #EBEFFF !important;
}

.info-sub .clickable:hover {
  background-color: #FFFFFF;
}

.info-row:hover .title {
  color: var(--color-primary-blue);
}

.info-row .value {
  font-family: 'Roboto Mono', monospace;
  width: 60px;
  text-align: right;
  font-weight: 500;
  color: #3F536E;
  display: block;
}

.info-row .bar {
  flex: 1;
  height: 8px;
  background-color: #eee;
  border-radius: 4px;
  overflow: hidden;
  position: relative; /* Needed for .bar-avg to position correctly */
}

.info-row .bar .bar-fill {
  height: 100%;
  background-color: #FC8F1C;
  border-radius: 4px;
}

/* Dotted line to indicate average */
.bar-avg {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #000000;
  opacity: 1;
  pointer-events: none;
}

.site-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 144px);
  padding-bottom: 24px; /* <-- Give a little bottom padding for last item */
  border: 1px solid
  /* Hide scrollbar - Firefox */
  scrollbar-width: none;

  /* Hide scrollbar - IE/Edge */
  -ms-overflow-style: none;
}

/* Hide scrollbar - Chrome, Safari, Opera */
.site-list::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

.info-highlight {
  background-color: #FBFCFF;
  border: 1px solid #D8E5EE;
  border-radius: 4px;
  padding: 16px;
  flex: 1;
}

.info-highlight.clickable:hover {
  cursor: pointer;
  border: 1px solid var(--color-primary-blue);
  text-decoration: none;
}

.info-section label, .info-highlight label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #3F536E;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-section p, .info-highlight p {
  font-family: 'Roboto Mono', monospace;
  margin: 0;
  font-size: 24px;
  color: #2C405A;
}

.card-close {
  position: absolute;
  top: 16px;
  right: 24px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#info-card:hover .card-close {
  opacity: 1;
}

.card-close {
  font-size: 20px;
  color: #A8C6DF;
  transition: color 0.2s ease;
}

.card-close:hover {
  color: var(--color-primary-blue); /* Blue on hover */
}

/* RESET BUTTON */
.reset-button {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background-color: #fff; /* match your brand color */
  color: #2C405A;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border: 1px solid #D8E5EE;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.reset-button:hover {
  background-color: var(--color-primary-blue); /* slightly darker on hover */
  color: #fff;
  border: 1px solid var(--color-primary-blue);
  transform: translateX(-50%) scale(1.05);
}

.marker-label {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  fill: #2C405A;
  pointer-events: none; /* So it doesn't interfere with hover */
  user-select: none;
}

.map-zoom-controls {
  position: absolute;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden; /* Clip children inside the border radius */
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* Shadow on the whole block */
  z-index: 10;
}

.map-zoom-controls button {
  all: unset; /* Remove all default button styling */
  width: 32px;
  height: 32px;
  text-align: center;
  font-size: 24px;
  font-weight: 500;
  color: #A8C6DF;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.map-zoom-controls button:hover {
  background: var(--color-primary-blue);
  color: white;
}

.medium-button-primary {
  font-family: 'Poppins', sans-serif;
  background-color: var(--color-primary-blue);
  color: var(--color-white);
  font-weight: 500;
  font-size: 14px;
  padding: 0 16px;
  border-radius: 16px;
  height: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 0;
  display: inline-flex; /* <-- better for buttons */
  align-items: center;
  justify-content: center;
  white-space: nowrap; /* <-- stop text wrapping */
  width: auto; /* allow it to shrink to fit */
  align-self: flex-start;
}

.medium-button-primary:hover {
  background-color: var(--color-primary-blue-selected);
}

.medium-button-secondary {
  font-family: 'Poppins', sans-serif;
  background: #FFFFFF;
  border: 1px solid #D8E5EE;
  color: var(--color-primary-blue-selected);
  font-weight: 500;
  font-size: 14px;
  padding: 0 16px;
  border-radius: 16px;
  height: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex; /* <-- better for buttons */
  align-items: center;
  justify-content: center;
  white-space: nowrap; /* <-- stop text wrapping */
  width: auto; /* allow it to shrink to fit */
  align-self: flex-start;
}

.medium-button-secondary:hover {
  background: var(--color-primary-blue);
  border: 1px solid var(--color-primary-blue);
  color: #fff;
}

.sidebar-tabs {
  display: flex;
  background-color: #EAEAF1;
  height: 40px;
}

.tab-button {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  font-weight: 400;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background-color 0.3s ease;
}

.tab-button.active {
  font-weight: 600;
  color: var(--color-text-primary);
  background-color: #FFFFFF;
}

.tab-button:hover {
  font-weight: 600;
  color: var(--color-primary-blue);
}

.tab-panel {
  display: none;
  padding-bottom: 24px;
}

.tab-panel.active-tab {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Switch wrapper */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

/* Hide native checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Background of the switch */
.slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 20px;
  transition: background-color 0.3s;
}

/* The circle inside */
.slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  top: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* When checked */
.switch input:checked + .slider {
  background-color: #305DFB;
}

.switch input:checked + .slider::before {
  transform: translateX(16px);
}

.tour-container{
  position: absolute; /* <<< CHANGED from fixed to absolute */
  left: 0; /* Start off-screen */
  top: 50%;
  transform: translateY(-50%);
  width: 240px;
  background: white;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  color: #333;
  overflow: hidden;
  padding: 24px 24px 24px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 56px - 48px); /* 24px top + 24px bottom */
  transition: left 0.4s ease;
  z-index: 10; /* Put above map but below header */
}

.tour-container .section-title{
  font-size: 12px;
  letter-spacing: 1px;
  color: #2C405A;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tour-container .slide-title{
  font-size: 16px;
  font-weight: 600;
  color: #2C405A;
}
.tour-container .slide-desc{
  font-size: 14px;
  color: #3F536E;
}

.tour-container .progress-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1rem;
}

.tour-container .progress-dot {
  width: 6px;
  height: 6px;
  background-color: #e5e7eb;
  border-radius: 50%;
  flex-shrink: 0;
}

.tour-container .progress-dot:hover {
  cursor: pointer;
  background-color: #3b82f6; /* darker blue on hover */
}

.tour-container .progress-bar {
  flex: 1;
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.tour-container .progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: #3b82f6;
  transition: width linear;
}

.tour-button-container{
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#tour-container:hover .close-icon {
  opacity: 1;
}

.tour-container .close-icon {
  position: absolute;
  top: 16px;
  right: 24px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 20px;
  color: #A8C6DF;
  transition: color 0.2s ease;
}

.tour-container .close-icon:hover {
  color: var(--color-primary-blue); /* Blue on hover */
}
