@import '../variables.less';

@primaryBlue: #4450e6;
@secondaryGreen: #37f4ad;
@mainColor: #333;

@REM: 16px;
@H3: 1.125em;

.h-center {
  left: 50%;
  transform: translate3d(-50%, 0, 0);
}

.v-center {
  top: 50%;
  transform: translate3d(0, -50%, 0);
}

.align-left {
  text-align: left;
}

.upper-first {
  text-transform: capitalize;
}

.uppercase {
  text-transform: uppercase;
}

.hackathon2020 {
  background-color: #f7f8f9;
  font-size: @REM;

  h1,
  h2,
  h3,
  h4 {
    font-weight: 500;
    font-family: inherit !important;
  }

  ul {
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .btn {
    min-width: 8.5em;
    padding: 0.6em 1.2em;
    border: none;
    border-radius: 4px;
    background-color: @primaryBlue;
    font-size: @H3;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;

    &.btn-disabled {
      cursor: not-allowed;
    }

    &.secondary {
      background-color: @secondaryGreen;
      color: @mainColor;

      &:hover {
        background-color: #26dd98;
      }
    }

    &:hover {
      background-color: #2323db;
    }
  }

  .modal-overlay {
    background-color: rgba(26, 26, 36, 0.8);
  }

  .modal {
    flex-direction: column;
    border-radius: 20px;
  }

  .modal__header {
    position: relative;
    width: 100%;
    height: 10em;
    padding: 3em;
    background: center / cover no-repeat
      url('https://download.pingcap.com/images/community/hackathon2020/bg-banner.jpg');

    .title {
      color: #fff;
      font-size: 1.875em;
    }

    .upper-first {
      font-size: 1.25em;
    }

    &::after {
      content: '';
      position: absolute;
      height: 8em;
      width: 16em;
      top: 1em;
      right: 3em;
      background: center / contain no-repeat
        url('https://download.pingcap.com/images/community/hackathon2020/modal-header-inner.svg');
    }
  }

  .modal__content {
    padding: 3em;
    max-height: 27em;
    overflow: auto;
    color: @mainColor;
  }

  .modal__content-agenda {
    .list-flex {
      justify-content: flex-start;
    }

    .agenda-item {
      width: 50%;

      .title {
        margin-bottom: 1em;
        font-size: 1.5em;
        color: @mainColor;
      }

      .time {
        width: 5em;
      }

      .content {
        width: 18em;
      }

      ul {
        li {
          display: flex;
          line-height: 2;
        }
      }
    }
  }

  .modal__content-criteria {
    padding-left: 5em;

    .grading-item {
      position: relative;
      line-height: 3;

      &::before {
        content: '';
        position: absolute;
        left: -2em;
        transform: translate3d(0, 0.85em, 0);
        display: block;
        width: 1.5em;
        height: 1.5em;
        border-radius: 50%;
        background: center / cover no-repeat
          url('https://download.pingcap.com/images/community/hackathon2020/spot.svg');
      }
    }

    .grading-item.en {
      line-height: 2;

      .label {
        font-size: 1.125em;
        font-weight: 500;
      }
    }
  }
}

.hackathon2020__section {
  padding-top: 4em;
  text-align: center;
  line-height: 1.5;

  .container {
    padding: 1em 0.75em;
  }
}

.section__title {
  display: inline-block;
  margin-bottom: 2 * @REM;
  position: relative;
  color: @mainColor;
  font-size: 1.5em;
  text-align: center;
  z-index: 0;

  &::before {
    content: '';
    display: block;
    position: absolute;
    width: 92px;
    height: 25px;
    bottom: -2 * @REM;
    left: 50%;
    margin-left: -46px;
    background: url('/images/community/hacking-camp-2021-s2/title-decoration.svg')
      center center no-repeat;
    background-size: 92px 25px;
  }
}

.section__title-white {
  color: #fff;
  letter-spacing: 4px;
}

.list-flex {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;

  &.container {
    padding: 0;
  }
}

.hacking-cam2021__banner {
  background: url('/images/community/hacking-camp-2021-s2/web-banner.svg')
    no-repeat;
  padding-top: 28%;
  position: relative;
  width: 100%;
  height: 0;
  background-size: cover !important;
  background-position: center !important;
  margin-top: 2rem;
}

.hackathon2020__banner {
  width: 100%;
  height: 0;
  background: center / cover no-repeat
    url('https://download.pingcap.com/images/community/hackathon2020/bg-banner.jpg');
  margin-top: @headerHeight;
  padding: 30em 1em 0 1em;

  .container {
    position: relative;
  }

  .hacking-camp {
    background: center / contain no-repeat
      url('https://download.pingcap.com/images/community/hacking-camp-2021-s1/banner-inner.png');
  }

  .banner__inner {
    position: absolute;
    bottom: 6em;
    left: 0;
    width: 48em;
    height: 16em;
    background: left / contain no-repeat
      url('https://download.pingcap.com/images/community/hackathon2020/banner-inner.svg');
  }

  .banner__buttons {
    position: absolute;
    right: 0;
    bottom: 6em;

    .btn:first-child {
      margin-right: 1em;
    }
  }
}

.hackathon2020__navbar {
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(68, 68, 253, 0.08);

  .navbar {
    display: flex;
    font-size: 1em;
  }

  .navbar__item {
    position: relative;
    padding: 1em 0;
    margin: 0 1em;
    line-height: 1.5;

    &.active::after {
      content: ' ';
      position: absolute;
      bottom: 0;
      .h-center();
      width: 2.5em;
      height: 6px;
      background-color: @primaryBlue;
    }

    &.active,
    &:hover {
      color: @primaryBlue;
    }
  }

  &.navbar-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: @headerHeight;
    z-index: 99;
  }
}

.hackathon2020__section-about {
  .image-container {
    padding: 1em;

    img {
      max-width: 90%;
    }
  }
}

.hackathon2020__section-awards {
  .award-card {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 296px;
    height: 333px;
    margin: 30px 10px;
    background: url('/images/community/hacking-camp-2021-s2/card.svg') no-repeat;
    background-size: cover;

    h3,
    p {
      padding: 0;
      margin: 0;
      color: #fff;
      font-size: 1.25em;
    }

    h3 {
      margin-bottom: 0.5em;
    }
  }
}

.hackathon2020__section-winners,
.hackathon2020__section-awards,
.hackathon2020__section-tuitors {
  .list-flex {
    justify-content: flex-start;
  }
}

.hackathon2020__intro {
  max-width: 55em;
  margin: 0 auto;

  &.left-align {
    text-align: left;
  }

  &:not(:last-child) {
    margin-bottom: 1.5em;
  }
}

.highlight-card {
  width: 24em;
  height: 20em;
  padding: 1em;
  background-color: @mainColor;
  color: #fff;
  margin: 1em;

  a {
    color: @secondaryGreen;
    text-decoration: underline;
  }

  .card__inner {
    width: 22em;
    height: 18em;
    padding: 1.5em;
    border: 2px solid @secondaryGreen;
  }

  .highlight__title {
    height: 3em;
    line-height: 3em;
    background: center / contain no-repeat
      url('https://download.pingcap.com/images/community/hackathon2020/infinite-blue.svg');
    font-size: 1.25em;
    color: @secondaryGreen;
  }

  .highlight__icon {
    margin: 1.2em 0;

    img {
      display: block;
      height: 2em;
      margin: auto;
    }
  }
}

.hackathon2020__section-winners {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;

  .desc {
    margin: 1rem;
  }

  .winner-team {
    margin: 30px 15px;
    width: 264px;
    height: 280px;
    position: relative;
    background-color: #fff;
    box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.05),
      0 0 0 1px rgba(10, 10, 10, 0.02);
  }

  .team-info {
    text-align: center;
    color: #1a1a24;
    margin-top: 18px;

    p {
      margin: 15px 20px;

      &.en {
        margin: 10px;
      }
    }

    .award {
      position: relative;
      font-weight: 600;
      font-size: 20px;

      &.en {
        font-size: 16px;
      }
    }

    .project-name {
      opacity: 0.5;
      font-size: 16px;

      &.en {
        font-size: 14px;
      }
    }
  }

  .misc {
    margin: 0 15px;
    position: absolute;
    bottom: 15px;
    width: 90%;

    .misc-btns {
      text-align: center;

      a {
        display: inline-block;
        background-color: #e9eaee;
        color: @mainColor;
        border: none;
        padding: 5px 10px;
        border-radius: 4px;
        font-size: 12px;
        cursor: pointer;
        margin-right: 20px;

        &:hover {
          color: #fff;
          background-color: #f86d78;
        }

        &:last-child {
          margin-right: 0;

          &:hover {
            background-color: @primaryBlue;
          }
        }
      }
    }
  }

  .thumbnail {
    &,
    .thumbnail-img {
      width: 100%;
      height: 167px;
      display: block;
    }

    .thumbnail-text-click {
      opacity: 1 !important;
    }

    .thumbnail-text {
      .thumbnail-img();

      text-align: left;
      font-size: 14px;
      position: absolute;
      top: 0;
      bottom: 0;
      z-index: 1;
      background-color: @mainColor;
      color: white;
      opacity: 0;
      padding: 1rem;
      line-height: 1.7;
      transition: opacity 0.5s ease;
      overflow: auto;

      &.thumbnail-text-click {
        height: auto !important;
      }
    }
  }

  .more-project-btn {
    border: 1px solid #0d309e;
    border-radius: 30px;
    color: #0d309e;
    background-color: white;
    padding: 15px 25px;
    font-size: 16px;
    margin: 4rem 0;
    cursor: pointer;

    &:hover {
      background-color: #0d309e;
      color: white;
    }
  }
}

.moments {
  display: flex;
  justify-content: center;
  margin-top: 1.5em !important;
}

.moment-item {
  position: relative;
  width: 25%;
  margin-top: -1.5em;
  z-index: 0;
  color: @mainColor;

  &.active {
    color: @primaryBlue;

    .moment__milestone {
      background-color: @primaryBlue;
    }
  }

  &::after {
    content: '';
    position: absolute;
    top: 1.5em;
    left: 0;
    height: 0;
    width: 100%;
    border-top: 1px dashed @mainColor;
    z-index: -1;
    opacity: 0.5;
  }

  &:first-child {
    &::after {
      width: 50%;
      left: 50%;
    }
  }

  &:last-child {
    &::after {
      width: 50%;
      right: 50%;
    }
  }
}

.moment__milestone {
  width: 3em;
  height: 3em;
  margin: auto;
  border-radius: 50%;
  background-color: @mainColor;

  .spot {
    display: block;
    width: 1em;
    height: 1em;
    margin: auto;
    transform: translate3d(0, 1em, 0);
    border-radius: 50%;
    background-color: @secondaryGreen;
  }
}

.moment__content {
  margin: 1em auto 0;

  p {
    line-height: 1.5;
  }
}

.schedule-card {
  position: relative;
  width: 36em;
  min-height: 18em;
  margin: 1em 1.5em;
  padding: 2em 3em;
  border-radius: 10px;
  background: center / cover no-repeat
    url('https://download.pingcap.com/images/community/hackathon2020/bg-banner.jpg');
  color: #fff;

  .btn {
    display: block;
    position: absolute;
    bottom: 2em;
    .h-center();
    font-size: 1em;
  }

  &::before {
    content: attr(data-step);
    position: absolute;
    top: 1 * @REM;
    left: 2 * @REM;
    font-size: 40px;
    color: @primaryBlue;
    font-weight: 600;
  }
}

.schedule__title {
  height: 4em;
  line-height: 2em;
  background: center / contain no-repeat
    url('https://download.pingcap.com/images/community/hackathon2020/infinite-dark-blue.svg');
  color: @secondaryGreen;

  .name {
    font-size: 1.25em;
  }
}

.schedule__detail {
  margin: 1em 0;
}

.prize-container {
  justify-content: center;
  padding: 1em 0.75em !important;
}

.tutor-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 200px;
  margin: 1em 3em 3em;
}

.tutor__avatar {
  width: 120px;
  height: 120px;
  margin-bottom: 1em;

  img {
    width: 100%;
    height: 100%;
    display: block;
  }
}

.tutor__name {
  margin-bottom: 0.5em;
  font-size: 1.125em;
  font-weight: 600;
}

.hackathon2020__section-faq {
  background: #20202c;

  .faq-list {
    max-width: 48em;
    padding: 1.5em 1.5em 4em;
    margin: 0 auto;
  }

  .expand {
    &::before {
      content: '-';
      color: @secondaryGreen;
      border: 1px solid @secondaryGreen;
    }

    &::after {
      border-bottom: 1px dashed @secondaryGreen;
    }
  }
}

.faq__question {
  color: white;
  font-size: 16px;
  position: relative;
  padding: 1em 0 0.5em;
  cursor: pointer;
  line-height: 1.7;

  &::after {
    content: '';
    border-bottom: 1px dashed #3a58f0;
    position: absolute;
    width: 100%;
    bottom: 0;
    left: 0;
  }

  &:hover {
    &::before {
      color: @secondaryGreen;
      border: 1px solid @secondaryGreen;
    }

    &::after {
      border-bottom: 1px dashed @secondaryGreen;
    }
  }

  &::before {
    content: '+';
    color: @secondaryGreen;
    border: 1px solid @secondaryGreen;
    border-radius: 50%;
    position: absolute;
    width: 20px;
    height: 20px;
    line-height: 20px;
    right: 0;
    bottom: 0;
    margin-bottom: 16px;
    text-align: center;
  }
}

.faq__answer {
  color: white;
  font-size: 16px;
  padding: 1rem 2rem;
  display: none;
  line-height: 1.7;
}

.partners {
  max-width: 1024px;
  margin: 4rem auto;
}

.sponsor-type {
  font-weight: bold;
}

.partners-list {
  align-items: center;
  padding-bottom: 5rem;

  .exclusive-sponvers {
    margin: 2rem 0 3rem;

    .list-flex {
      height: 144px;
    }
  }

  .common-sponsors {
    .sponsor-type {
      margin-bottom: 20px;
    }

    .list-flex {
      min-height: 80px;

      .img-wrapper {
        margin-bottom: 20px;
      }
    }

    margin-bottom: 20px;
  }

  .list-flex {
    align-items: center;

    .img-wrapper {
      margin: 0 4em;
    }

    img {
      height: 3em;
      width: auto;

      &.logo-feature-capital {
        height: 2.5em;
      }

      &.logo-ggv-capital,
      &.logo-juice-fs {
        height: 2em;
      }

      &.logo-10fund {
        height: 4em;
      }

      &.logo-matrix,
      &.logo-chuxin-capital {
        height: 5em;
      }
    }
  }
}

.reviews-list {
  padding: 1em 0 5em;

  .review-item {
    margin: 1em;

    img {
      display: block;
      width: auto;
      height: 16.25em;
      margin-bottom: 1em;
      border-radius: 10px;

      &:hover {
        box-shadow: 0 5px 14px 3px rgba(0, 0, 0, 0.3);
      }
    }
  }
}

// for english page
.hackathon2020-en {
  font-family: 'Helvetica Neue', Arial, sans-serif;

  .highlight-card {
    height: 22em;

    .card__inner {
      height: 20em;
    }
  }

  .schedule-card {
    min-height: 20em;
  }

  .hackathon2020__section:last-child {
    padding-bottom: 5em;
  }

  .tutor__title {
    max-width: 12em;
  }

  .modal__content-criteria {
    padding: 2em 5em;
  }
}

@media (min-width: 1408px) {
  .hackathon2020__banner {
    .banner__inner {
      left: -2em;
    }
  }

  .hackathon2020__navbar .navbar {
    margin-left: -1.75em;
  }
}

@media (max-width: 768px) {
  .list-flex {
    justify-content: center !important;
  }

  .hackathon2020 {
    font-size: 0.875 * @REM;

    .modal {
      max-width: 90%;
    }
  }

  .hackathon2020__banner {
    padding-top: 24em;

    .banner__inner {
      bottom: 8em;
      height: 14em;
      max-width: 100%;
    }

    .banner__buttons {
      display: flex;
      bottom: 3em;
      width: 100%;
      text-align: center;
    }
  }

  .hackathon2020__navbar .navbar {
    justify-content: center;
  }

  .hackathon2020__intro {
    max-width: 100%;
  }

  .schedule-card {
    min-height: 20em;
    padding: 2em;
  }

  .tutor-item {
    margin: 2em 1em;
    width: 42%;
  }

  .moments {
    flex-direction: column;
    align-items: center;
  }

  .moment-item {
    height: 9em;
    width: 100%;

    &::after {
      width: 0;
      height: 100%;
      left: 50%;
      border-top: none;
      border-left: 1px dashed @mainColor;
    }

    &:last-child {
      height: 3em;

      &::after {
        height: 0;
      }
    }

    .moment__content {
      position: absolute;
      width: 10em;
      margin-top: -3em;
    }

    &:nth-child(2n + 1) {
      .moment__content {
        right: calc(~'50% + 2.5em');
        text-align: right;
      }
    }

    &:nth-child(2n) {
      .moment__content {
        left: calc(~'50% + 2.5em');
        text-align: left;
      }
    }
  }

  .reviews-list .review-item img {
    width: 90%;
    height: auto;
    margin: 0 auto 1em;
  }

  .hackathon2020-en {
    .schedule-card {
      min-height: 24em;

      &:first-child {
        .btn {
          width: 14em;
        }
      }
    }
  }
}

@media (max-width: 428px) {
  .hacking-cam2021__banner {
    background: url('/images/community/hacking-camp-2021-s2/mobile-banner.svg')
      no-repeat;
    padding-top: 68%;
    margin-top: 3rem;
  }

  .hackathon2020 .modal__header {
    padding: 3em 1em;

    &::after {
      height: 6em;
      width: 12em;
      top: 2em;
      right: 1em;
    }
  }

  .hackathon2020 .modal__content {
    padding: 1em;
  }

  .hackathon2020 .modal__content-agenda .list-flex {
    flex-direction: column;
    align-items: center;

    .agenda-item {
      width: 100%;
      margin-bottom: 2em;
    }
  }

  .hackathon2020 .modal__content-criteria {
    padding-left: 3em;
  }
}

@media (max-width: 320px) {
  .hackathon2020 {
    font-size: 0.75 * @REM;
  }

  .hackathon2020__banner .banner__buttons .btn {
    font-size: 0.75 * @REM;
  }

  .hackathon2020 .modal__header {
    &::after {
      display: none;
    }
  }
}
