@font-face {
  font-family: 'GT Walsheim';
  src: url('/assets/fonts/GT-Walsheim-Light-webfont.woff2') format('woff2'),
     url('/assets/fonts/GT-Walsheim-Light-webfont.woff') format('woff');
  font-weight: 300;
}

@font-face {
  font-family: 'GT Walsheim';
  src: url('/assets/fonts/GT-Walsheim-Regular-webfont.woff2') format('woff2'),
       url('/assets/fonts/GT-Walsheim-Regular-webfont.woff') format('woff');
  font-weight: 400;
}

@font-face {
  font-family: 'GT Walsheim';
  src: url('/assets/fonts/GT-Walsheim-Medium-webfont.woff2') format('woff2'),
     url('/assets/fonts/GT-Walsheim-Medium-webfont.woff') format('woff');
  font-weight: 500;
}

@font-face {
  font-family: 'GT Walsheim';
  src: url('/assets/fonts/GT-Walsheim-Bold-webfont.woff2') format('woff2'),
     url('/assets/fonts/GT-Walsheim-Bold-webfont.woff') format('woff');
  font-weight: 600;
}

:root {
  /* Sizes of controls added by Mapbox (their styles use px) */
  --mapboxNavControlsMarginRight: 10px;
  --mapboxNavControlsWidth: 30px;
}

* {
  font-family: 'GT Walsheim', Arial, sans-serif;
  box-sizing: border-box;
  scrollbar-color: #25D2C6;
}

*::-webkit-scrollbar {
  width: 8px;
}

*::-webkit-scrollbar-thumb {
  background-color: #25D2C6;
  border-radius: 4px;
}

*::-webkit-scrollbar-track {
  background: #F8F8F8; /* Your custom track color */  
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Remove default margins set within Observable Framework */
#observablehq-center {
  margin: 0;
}
#observablehq-main {
  margin: 0;
}

/* Ensure the map takes up the full viewport */
#map {
  width: 100vw;
  height: 100vh;
}

.no-underline, .no-underline:hover {
  text-decoration: none !important;
}

.map-overlay {
  height: 100%;
}

.w-full {
  width: 100%;
}

.flex {
  display: flex;
}

.statistics-container {
  --panelHeightExpanded: 640px;
  --panelHeightCollapsed: 170px;
  --panelMargin: 1rem;
  --panelMarginRight: calc(
    2 * var(--panelMargin)
    + var(--mapboxNavControlsWidth)
    + var(--mapboxNavControlsMarginRight)
  );
  --panelMaxWidth: 443px;

  position: absolute;
  top: var(--panelMargin);
  left: var(--panelMargin);
  max-width: min(var(--panelMaxWidth), 100svw - var(--panelMarginRight));
  height: 640px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5rem 0;
  transition: height 0.3s linear;
}

@media (min-width: 769px) {
  .statistics-container {
    height: var(--panelHeightExpanded);
  }

  .statistics-container.toggled {
    height: var(--panelHeightCollapsed);
  }
}

@media (max-width: 768px) {
  .statistics-container {
    height: var(--panelHeightCollapsed);
  }

  .statistics-container.toggled {
    height: var(--panelHeightExpanded);
  }
}

.statistics-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  margin-bottom: 1.5rem; /* Increase spacing below the header */
  padding: 0 1.5rem;
  gap: 10px;
}

.statistics-header h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0;
  color: #144466;
  word-wrap: break-word;
  hyphens: auto;
}

.statistics-header .toggle-button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  padding: 4px;
  border-radius: 100%;
  display: flex;
  align-items: center;
}

.statistics-header .toggle-button:hover {
  background-color: #deecf1;
}

.statistics-header .toggle-icon {
  width: 18px;
  height: 18px;
  fill: #144466;
  transition: transform 0.3s ease;
}
.statistics-header .back-button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  text-decoration: underline;
}

.statistics-header .back-button:hover {
  background-color: #deecf1;
}

@media (min-width: 769px) {
  .statistics-header .toggle-icon {
    transform: rotate(180deg);
  }

  .statistics-header .toggle-icon.toggled {
    transform: rotate(0);
  }
}

@media (max-width: 768px) {
  .statistics-header .toggle-icon.toggled {
    transform: rotate(180deg);
  }
}

.statistics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0 1.5rem;
}

.statistic-card {
  height: 67px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #EDF5F8;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.statistic-card .statistic-value {
  font-size: 1.25rem;
  line-height: 120%;
  font-weight: 400;
  color: #144466;
}

.statistic-card .statistic-label {
  font-size: 0.85rem;
  color: #4D5B64;
  display: block;
}

.statistics-content {
  font-size: 1rem;
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-left: 1.5rem;
  padding-right: 1rem;
}

.statistics-content p {
  color: #144466;
  font-weight: 400;
  margin-top: 0;
}

.statistics-content .empty-state-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform: translateY(-15px);
  padding: 0 2rem;
  width: 100%;
  height: 300px;
  font-size: 1.5rem;
  font-weight: 350;
  color: #9AB9D5;
  text-align: center;
  line-height: 1.5;
}

.statistics-content .empty-state-content .icon {
  margin-bottom: 1rem;
}

.statistics-content .markets-container {
  flex-grow: 1;
  overflow-y: auto;
  max-height: 100%;
  padding-right: 12px;
}

.statistics-claim-account {
  background: #f8f8f8;
  margin: 8px 1rem 0 1.5rem;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  font-size: 11px;
  color: inherit !important;
  text-decoration: none !important;
}

.statistics-claim-account .image {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 1px solid #E8E8E8;
  border-radius: 4px;
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
}

.statistics-claim-account .image .icon {
  width: 16px;
  height: 16px;
  color: #F8F8F8;
}

.statistics-claim-account .claim-account-text {
  margin-left: 8px;
}

.statistics-claim-account .sign-up-link {
  font-weight: 600;
  text-decoration: underline;
}

.market-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.markets-container li {
  display: flex;
  height: 60px;
  padding: 6px;
  background: #f8f8f8;
}

.market-identifier {
  width: calc(100% - 48px);
  height: 100%;
  overflow: hidden;

  display: flex;
  align-items: center;
}

.market-identifier > * {
  height: 100%;
}

.market-logo {
  flex: 0 0 48px;
  aspect-ratio: 16/9;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #E8E8E8;
}

.market-name-text {
  display: flex;
  flex: 0 0 calc(100% - 48px);
  width: calc(100% - 48px);
  height: 100%;
  padding-left: 8px;
  color:#144466;
  font-weight: 400;
  line-height: 48px;
}

.market-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-group {
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  margin-left: 4px;
}

.badge-pill {
  display: flex;
  align-items: center;
  padding: 0 10px 0 34px;
  border-radius: 999px;
  color: #144466;
  font-size: 0.75rem;
  line-height: 120%;
  height: 30px;
  margin-top: 1px;
  transition: opacity 0.5s ease;
  opacity: 0;
}

.badge-group:hover .badge-pill {
  opacity: 1;
}

.badge-pill.Verified {
  background: rgba(68, 131, 215, 0.15);
}

.badge-pill.Partner {
  background-color: rgba(166, 93, 230, 0.15);
}

.badge {
  position: absolute;
  left: 6px;
}

.markets-container .market-opportunities {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.market-opportunities p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 120%;
  margin-bottom: 4px;
}

.opportunities-value {
  font-size: 1.2rem;
  line-height: 120%;
  color: #144466;
  text-decoration: none;
}

.markets-container li .find-out-more {
  width: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  height: 100%;
}

.find-out-more .icon {
  margin-bottom: 2px;
}

.map-color-legend {
  position: absolute;
  bottom: 5rem;
  right: 5rem;
  width: 150px;
  height: 60px;
  background-color: #f8f9fa;
  border-radius: 6px;
  box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.15);
  padding: 5px 8px;
  z-index: 0;
  display: flex;
  flex-direction: column;

  @media (max-width: 768px) {
    transform: translateX(-50%);
    left: 50%;
    right: 0;
    bottom: 3rem;
  }
}

.map-color-legend .title {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-align: center;
  margin-bottom: 6px;
  line-height: 100%;
}

.map-color-legend .legend-gradient {
  height: 13px;
  width: 100%;
  background: linear-gradient(90deg, #EAD8F8, #6C25B8);
  margin-bottom: 5px;
}

.map-color-legend .legend-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  line-height: 100%;
}
