:root {
  --primary-color: #087c35;
  --secondary-color: #cca90c;
  --base-font-size: 16px;
}

@font-face {
  font-family: 'Cairo';
  src: url('assets/fonts/Cairo-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('assets/fonts/Cairo-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('assets/fonts/Cairo-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

body {
  margin: 0;
  font-family: 'Cairo', sans-serif;
  background-color: #f4f4f4;
}

html {
  --width: min(0.3906vw, 7.5px);
  font-size: calc(var(--base-font-size) + var(--width));
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

main {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100svh;
  background-color: white;
}

.wrapper {
  --gap: 40px;
  --menu-width: max(30vw, 200px);

  position: relative;
  display: flex;
  flex: 1;
  flex-direction: row;
}

.home-button {
  position: absolute;
  bottom: calc(var(--gap) * 2);
  right: calc(var(--gap) * 2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  background-color: #fff;
  border: solid 2px #d9d9d9;
  border-radius: 24px;
}

.home-button svg {
  width: 40px;
  height: 40px;
  fill: var(--primary-color);
}

.map {
  flex: 1;
  border-radius: 24px;
  border: solid #f4f4f4 2px;
  margin: var(--gap);
  margin-left: calc(var(--menu-width) + var(--gap) * 2);
  transition: border-radius 500ms ease, margin 500ms ease;
}

.map.expanded {
  margin: 16px;
}

.map-svg {
  border-radius: inherit;
  fill: #d8d8d8;
  stroke-width: 0.4px;
  stroke: #f4f4f4;
  width: 100%;
  height: 100%;
}

.map-svg path {
  transition: fill 1s ease;
}

.active {
  fill: var(--primary-color);
}

.side-menu {
  position: absolute;
  left: var(--gap);
  bottom: var(--gap);
  width: var(--menu-width);
  max-height: calc(100% - var(--gap) * 2);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  border-radius: 24px;
  background-color: #fff;
  border: solid #f4f4f4 2px;
}

.top-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  background-color: var(--primary-color);
  padding: 1rem;
  border-radius: 16px;
}

.top-card .flag-container {
  display: grid;
  justify-items: center;
  align-items: center;
}

.top-card .flag-container img {
  grid-area: 1 / 1;
  width: 100px;
  height: 100px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: solid 1px white;
}

.top-card .flag-container .progress-circle {
  grid-area: 1 / 1;
}

.top-card .title {
  margin: 0;
  font-size: 1.2rem;
  color: #fff;
}

.top-card .users-count {
  margin: 0;
  color: #fff;
  font-size: 0.8rem;
}

.top-card .users-count span {
  color: var(--secondary-color);
  font-size: 2rem;
  font-weight: 900;
}

.countries-list {
  max-height: 90vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  list-style-type: none;
  padding: 0 4px;
  margin: 0;
  overflow: hidden auto;
  transition: max-height 500ms ease;
}

.countries-list.collapsed {
  max-height: 0;
}

@supports not selector(::-webkit-scrollbar) {
  .countries-list {
    scrollbar-width: thin;
    scrollbar-color: #087c35 #f4f4f4;
  }
}

.countries-list::-webkit-scrollbar {
  border-radius: 5px;
  height: 10px;
  width: 10px;
}

.countries-list::-webkit-scrollbar-thumb {
  border-radius: 5px;
  height: 10px;
  width: 10px;
}

.countries-list::-webkit-scrollbar-track {
  border-radius: 5px;
  background-color: #f4f4f4;
}

.countries-list::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background-color: #087c35;
}

.countries-list li {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 16px;
  border: solid 2px #f4f4f4;
  transition: border 500ms ease;
  cursor: pointer;
}

.countries-list li.active {
  border-color: var(--primary-color);
}

.countries-list li img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: solid 1px #f4f4f4;
}

.countries-list li p {
  color: #656565;
  font-size: 16px;
  margin: 0;
}

.bottom-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-evenly;
  gap: 1rem;
}

.bottom-controls button {
  flex: 1;
  display: flex;
  justify-content: center;
  border: none;
  background-color: var(--primary-color);
  border-radius: 16px;
  padding: 0.2rem;
  cursor: pointer;
}

.bottom-controls button svg {
  width: 46px;
  height: 46px;
  fill: white;
  transition: transform 500ms ease;
}

/* #region MARK: Circular progress */

.progress-circle {
  width: 130px;
  height: 130px;
  aspect-ratio: 1 / 1;
}

.progress-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: #095928;
  stroke-width: 6px;
}

.circle {
  stroke: var(--secondary-color);
}

.circle-progress {
  fill: none;
  stroke-width: 6px;
  stroke-dasharray: 610px;
  stroke-dashoffset: 610px;
}

@keyframes progress {
  0% {
    stroke-dashoffset: 610px;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* #endregion */

@media screen and (max-width: 1600px) {
  .countries-list {
    grid-template-columns: 1fr;
  }

  .wrapper {
    --gap: 20px;
  }

  .map {
    margin: 10px;
  }

  .map.expanded {
    margin: 0;
  }

  .side-menu {
    padding: 0.5rem;
  }

  .top-card {
    padding: 0.4rem;
    gap: 1rem;
  }

  .top-card .title {
    font-size: 1rem;
  }

  .top-card .users-count {
    font-size: 0.6rem;
  }

  .top-card .users-count span {
    font-size: 0.8rem;
  }

  .top-card .flag-container img {
    width: 60px;
    height: 60px;
  }

  .progress-circle {
    width: 70px;
    height: 70px;
  }

  .countries-list li {
    padding: 0.2rem;
  }

  .countries-list li img {
    width: 40px;
    height: 40px;
  }

  .bottom-controls button svg {
    width: 30px;
    height: 30px;
  }
}
