body {
  margin: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: "Montserrat", sans-serif;
  background-color: #fcfcfc;
  display: flex;
}

/* left column */
/* GRAPH and HEADER */
.main {
  flex: 1;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}
/* header */
.area-header {
  text-align: center;
  padding-top: 40px;
  position: absolute;
  width: 100%;
  top: 0;
  pointer-events: none;
  z-index: 10;
}
.area-header h1 {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 6vw, 72px);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
  color: #000;
}
/* graph */
#viz-container {
  width: 100%;
  height: 100%;
  padding-top: 60px;
  box-sizing: border-box;
}

/* right column */
/* SIDEBAR */
.sidebar {
  width: 320px;
  height: 100%;
  margin-top: 100px;
  padding: 40px 30px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: transparent;
  z-index: 20;
  justify-content: center;
}
/* TOGGLE*/
.control-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
/* container */
.toggle-container {
  padding: 4px; /* glider to not touch edges */
  display: flex;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  height: 45px;

  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  border-radius: 20px;
}
/* moving part */
.toggle-glider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background-color: #000;
  border-radius: 25px;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 1; /* BEHIND the text */
}

/* BUTTON STYLE */
.toggle-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 25px;
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  z-index: 2;
  position: relative;
  transition: color 0.3s ease;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* Active */
/* text turns white  */
.toggle-btn.active {
  color: #fff;
}

/* move glider */
.toggle-container.slide-right .toggle-glider {
  transform: translateX(100%);
}

/* SUB MENU */
/* medal won and medals per capita */
#medals-sub-menu {
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease;

  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  border-radius: 20px;
}

#medals-sub-menu.visible {
  opacity: 1;
  height: auto;
  padding: 15px;
}

#athletes-sub-menu {
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease;

  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  border-radius: 20px;

  display: none;
}
#athletes-sub-menu.visible {
  opacity: 1;
  height: auto;
  padding: 15px;
}

.discipline-label {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  text-anchor: middle;
  pointer-events: none;
  fill: #333;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

.info-box {
  padding-top: 20px;
  border-radius: 20px;
  font-size: 11px;
  color: #000;
  line-height: 1.5;
}

/* LEGEND */
.legend-box {
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  border-radius: 20px;
}
.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: #000;
  font-weight: 500;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 12px;
}

.sidebar-footer {
  margin-bottom: auto;
  font-size: 11px;
  color: #888;
  line-height: 1.4;

  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  border-radius: 20px;
}
.sidebar-footer strong {
  color: #000;
  display: block;
  margin-bottom: 2px;
}

/* TOOLTIP */
.custom-tooltip {
  position: absolute;
  visibility: hidden;
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 10px;
  border-radius: 8px;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
}

circle {
  transform-origin: center;
  transform-box: fill-box;
}

/* STROKE */
.continentStroke {
  stroke-dasharray: 8, 5;
}

@media (max-width: 900px) {
  body {
    flex-direction: column;
    overflow: auto;
  }
  .sidebar {
    width: 100%;
    height: auto;
    padding: 20px;
  }
  .area-header h1 {
    font-size: 32px;
  }
  #viz-container {
    height: 60vh;
  }
}

/* ATLETI */
.athlete-text {
  font-family: "Montserrat", sans-serif;
  fill: #333;
}
.athlete-title {
  font-size: 14px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-anchor: middle;
}
.axis-line {
  stroke: #9ea2a4;
  stroke-width: 1px;
}
.axis-text {
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 300;
  text-anchor: middle;
  fill: #333;
}

/* dropdown */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  overflow-y: auto;
  padding: 5px 0;
  margin: 2px 0 0;
  font-size: 14px;
  text-align: left;
  list-style: none;

  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  border-radius: 20px;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu li {
  padding: 0;
  margin: 0;
}

.dropdown-menu li a {
  display: block;
  padding: 3px 20px;
  clear: both;
  font-weight: 400;
  line-height: 1.42857143;
  color: #333;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.dropdown-menu li a:hover,
.dropdown-menu li a:focus {
  color: #262626;
  text-decoration: none;

  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  border-radius: 20px;
}

.dropdown-menu input[type="checkbox"] {
  margin-right: 8px;
  pointer-events: none;
}

#sub-toggle-athletes {
  position: relative;
}
