@import 'open-color/open-color.css';

:root {
  --modalTriangleWidth: 8px;
  --modalTriangleHeight: 8px;
  --modalTriangleOffset: 6px;
  --tipso-triangle-back: rgba(212, 212, 212, 0.3);

  --speed: .2s;
  --easing: cubic-bezier(.55,0,.1,1);
  --modalContentOpacity: 0;
  --scale: scale(0.8);
  --scaleActive: scale(1);
}

.baseLink {
  display: block;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  pointer-events: auto;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background-color: transparent;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  color: var(--oc-white);
  font-size: 14px;
  padding: 0 25px;
  pointer-events: none;
  display: flex;
  align-items: center;

  width: 80%;
  margin: auto;
  justify-content: flex-start;
}

.topbarLink {
  composes: baseLink;
  color: var(--oc-gray-1);
  margin: 0 10px;
  transition: color 0.3s;

  &:hover {
    color: var(--oc-white);
    text-decoration: underline;
  }
}

.topbarSelector {
  display: inline-block;
  height: 2em;
  line-height: 2em;
  overflow: hidden;

  &:hover {
    overflow: visible;
  }

  & a {
    line-height: 2em;
  }
}

.loginPannel {
  color: var(--oc-white);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  pointer-events: none;

  width: 80%;
  justify-content: flex-start;
  align-items: flex-start;
}

.loginIntro {
  font-size: 1rem;
  color: var(--oc-gray-1);
}

.logo {
  font-size: 10rem;
}

.loginButton {
  margin-top: 25px;
  margin-bottom: 25px;
}

.githubLoginLink {
  composes: baseLink;
  color: var(--oc-gray-8);
  padding: 10px 15px;
}

.statisticContainer {
  margin-top: 25px;
  position: relative;

  &:hover {
    & .statistic {
      opacity: 1;
    }

    & .statisticModal {
      z-index: var(--zIndex99);
      visibility: visible;
      opacity: 1;
      transform: var(--scaleActive) translateY(-50%) translateX(20px);

      &.statisticModalBottom {
        transform: var(--scaleActive) translateY(10px) translateX(-50%) !important;
      }
    }
  }
}

/* loading */
@-webkit-keyframes ball-beat {
  50% {
    opacity: 0.2;
    transform: scale(0.75);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ball-beat {
  50% {
    opacity: 0.2;
    transform: scale(0.75);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.statisticLoading {
  opacity: 0.5;
}

.statisticLoading > div {
  background-color: var(--oc-gray-5);
  width: 15px;
  height: 15px;
  border-radius: 100%;
  margin: 2px;
  animation-fill-mode: both;
  display: inline-block;
  animation: ball-beat 0.7s 0s infinite linear;
}

.statisticLoading > div:nth-child(2n-1) {
  animation-delay: -0.35s !important;
}


.statistic {
  font-family: 'Geo', 'PingFangSC-Light', 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', monospace, sans-serif;

  /* font-family: 'Open Sans', 'PingFangSC-Light', 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', monospace, sans-serif; */
  color: var(--oc-gray-1);
  opacity: 0.5;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.2s;

  & span {
    font-size: 3.5em;
  }
}

.statisticModal {
  position: absolute;
  top: 50%;
  left: 100%;
  max-width: 250px;
  background-color: var(--bg);
  border-radius: 2px;
  box-shadow: var(--shadow3);

  z-index: var(--zIndex0);
  opacity: var(--modalContentOpacity);
  visibility: hidden;
  backface-visibility: hidden;
  transform: var(--scale) translateY(-50%) translateX(10px);
  transition: all var(--speed) var(--easing);

  color: var(--oc-gray-7);
  text-align: left;
  padding: 10px 20px;
  min-width: 190px;
  line-height: 1.5em;

  &::before,
  &::after {
    width: 0;
    height: 0;
    top: 50%;
    content: '';
    display: block;
    position: absolute;
    transform: translateY(-50%);
    border-top: var(--modalTriangleWidth) solid transparent;
    border-bottom: var(--modalTriangleWidth) solid transparent;
  }

  &::after {
    z-index: var(--zIndex1);
    left: calc(0 - var(--modalTriangleHeight));
    border-right: var(--modalTriangleHeight) solid var(--oc-white);
  }

  &::before {
    z-index: var(--zIndexHidden);
    left: calc(0 - var(--modalTriangleOffset));
    border-right: var(--modalTriangleHeight) solid var(--tipso-triangle-back);
  }
}

.statisticModalBottom {
  top: 100%;
  left: 50%;
  transform: var(--scaleActive) translateY(10px) translateX(-50%) !important;

  &::before,
  &::after {
    left: 50%;
    transform: translateX(-50%);
    border-top: none;
    border-left: var(--modalTriangleWidth) solid transparent;
    border-right: var(--modalTriangleWidth) solid transparent;
  }

  &::after {
    z-index: var(--zIndex1);
    top: -var(--modalTriangleHeight);
    border-bottom: var(--modalTriangleHeight) solid var(--oc-white);
  }

  &::before {
    z-index: var(--zIndexHidden);
    top: -var(--modalTriangleOffset);
    border-bottom: var(--modalTriangleHeight) solid var(--tipso-triangle-back);
  }
}

@media (max-width: 800px) {
  .statistic {
    & span {
      font-size: 2em;
    }
  }
}

@media (max-width: 500px) {
  .logo {
    font-size: 4rem;
  }

  .statistic {
    & span {
      font-size: 1.8em;
    }
  }

  .loginIntro {
    font-size: 0.8rem;
  }
}

@media (max-width: 300px) {
  .logo {
   font-size: 3rem;
  }

  .statistic {
    & span {
      font-size: 1.5em;
    }
  }
}
