/* MAIN PAGE */
:root {
  --ast-global-color-0: #f26419;
  --ast-global-color-1: #000000;
  --ast-global-color-2: #000000;
  --ast-global-color-3: rgba(0,0,0,0.6);
  --ast-global-color-4: #f7f7f7;
  --ast-global-color-5: #ffffff;
  --ast-global-color-6: rgba(255,255,255,0.65);
  --ast-global-color-7: #000000;
  --ast-global-color-8: #5f5f5f;
  --ast-border-color: #dddddd;
}


html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #ffffff;
}

body {
  min-height: 100vh; /* Ensures the body takes full viewport height */
  display: flex;
  justify-content: center;  /* Horizontal centering */
  align-items: center;      /* Vertical centering */
}


html {
  font-size: 93.75%;
}
body {
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  font-size: 15px;
  font-size: 1rem;
  line-height: 1.6em;
  color: var(--ast-global-color-3);
}


/* POPUP */
.popup {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(0,0,0,0.5);

  /* Flexbox centering */
  align-items: center;
  justify-content: center;
}

.popup-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 460px;
  max-height: 90vh;
  position: relative;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}
.popupLink {
  text-align: right;
}
a {
  color: var(--ast-global-color-3);
  text-decoration: underline;
}
a:hover {
  color: var(--accent-color);
}
.popupTable {
  border-collapse: collapse;
  width: auto;
  font-family: Arial, sans-serif;
}
.popupTable th, .popupTable td {
  border-top: 1px solid #bbb;
  border-bottom: 1px solid #bbb;
  border-left: none;
  border-right: none;
  padding: 8px 12px;
}
.popupTable thead th {
  font-size: 1.1em;
  text-align: left;
  font-weight: bold;
  border-bottom: 3px solid #333;
  border-top: none;
}
.popupTable th:first-child {
  width: 150px;
}
.popupTable th:last-child,
.popupTable td:last-child {
  width: 275px;
}
.popupTable td:first-child {
  width: 150px;
  text-align: right;
  font-weight: bold;
}
.popupTable tr {
  border-left: none;
  border-right: none;
}
.popupTable th:not(:first-child),
.popupTable td:not(:first-child) {
  text-align: left;
}
.popupTable tbody tr:last-child td {
  border-bottom: none;
}
.credits {
  display: block;
  text-align: right;
  font-size: 0.75em;
  color: #888;
  margin: 5px 0 0 0;
  padding: 0;
  line-height: 1.5;
}



.container {
  display: flex;
  gap: 16px;
  width: 95vw; /* Use most of the viewport width */
  /* max-width: 1600px; /* Optional: limit max width */
  box-sizing: border-box;
  align-items: flex-start; /* Align items to the top */
}
.sf-controls tr > * {
  padding-top: 0;
  padding-bottom: 0;
}

.iframe-wrapper {
  position: relative;
  width: 100%;
  height: 95vh;
  min-width: 0;
}

/* Viewer */
.viewer-iframe {
  flex: 1 1 0;
  min-width: 0; /* Important for flex children to shrink */
  width: 100%;
  height: 95vh;
  border: 1px solid #dee2e6 !important;
  border-color: #8e8e8e !important;
  border-radius: 0.25rem !important;
}

.project-title-overlay {
  position: absolute;
  top: 10px;
  left: 6px;
  z-index: 30;
  color: black;
  font-size: 1.25em;
  font-weight: bold;
  padding: 7px 18px 7px 14px;
  pointer-events: none; /* So it doesn't block UI below */
  letter-spacing: 0.01em;
  min-width: 120px;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

.logo-overlay {
  position: absolute;
  bottom: 6px;
  left: 8px;
  z-index: 10;
  padding: 5px;
  border-radius: 4px;
}

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

.logo-overlay:hover {
  background: rgba(255, 255, 255, 0.7);
}

.fullscreen-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 20;
  background: var(--accent-color, #2196F3);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 1.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: background 0.2s;
}
.fullscreen-btn:hover {
  background: #1565c0;
}

.overlay-btn {
  position: absolute;
  z-index: 20;
  background: #4d4d4d;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: background 0.2s;
}

.overlay-btn:hover {
  background: #eb1630;
}

.fullscreen-btn {
  bottom: 16px;
  right: 16px;
}

.gear-btn {
  bottom: 16px;
  right: 62px; /* 16px + 36px + 10px gap */
}

#legend {
  display: none;
}

#legend .legend-title {
  font-weight: bold;
  margin-bottom: 8px;
}

#legend .legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#legend .legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

#legend .legend-color-box {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 1px solid #888;
  border-radius: 4px;
  margin-right: 10px;
}

#legend .legend-label {
  font-size: 1em;
  color: #222;
}

.legend-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.7);
  padding: 5px;
  border-radius: 4px;
}

.legend-overlay ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.legend-overlay li {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}
.legend-overlay span {
  font-size: 1em;
}

/* remove margin for indentation */
.navTree {
  flex: 0 0 auto;
  width: max-content;     /* Only as wide as its content */
  white-space: nowrap;    /* Prevent wrapping */
  max-width: 40vw;        /* Optional: prevent it from getting too wide */
  overflow-x: auto;       /* Scroll if too wide */
}
.navTree ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.navTree li {
  padding: 12px 0;
  font-weight: bold;
  white-space: nowrap; /* Prevent wrapping of list items */
}
.navTree li li {
  padding: 3px 0px 3px 0px;
  font-weight: normal;
  white-space: nowrap;
}

/* Toggle Switches */
.checkbox-container {
  display: inline-block;
  position: relative;
}
.toggle-switch {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.checkbox-container label {
  display: inline-block;
  padding-left: 50px;
  line-height: 24px;
  cursor: pointer;
}
.checkbox-container label::before {
  content: '';
  position: absolute;
  left: 0;
  width: 40px;
  height: 24px;
  background-color: #ccc;
  border-radius: 12px;
  transition: background-color 0.3s;
}
.checkbox-container label::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
/* Toggle Blue = 2196F3 */
.toggle-switch:checked + label::before {
  background-color: var(--accent-color);
}
.toggle-switch:checked + label::after {
  transform: translateX(16px);
}
.black-toggle label::before {
  background-color: #4d4d4d !important;
}
.black-toggle .toggle-switch:not(:checked) + label::before {
  background-color: #ccc !important;
}