@import './common-style.less';

.hackathon2018-banner {
  background: url('https://download.pingcap.com/images/banners/hackathon-banner-pc.jpg') no-repeat;
  padding-top: 37%;
}

.hackathon-section-title {
  color: white !important;
}

.hackathon-section-title::after {
  border-top: 3px solid white !important;
}

.about-hackathon {
  p {
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.7;
  }

  .hackathon-intro {
    padding: 0 0 1.5rem;
  }

  .hackathon-date {
    padding: 0 0 4rem;
  }
}

.awarded-projects {
  background-color: #272727;
}

.awarded-list,
.project-list,
.tutor-list {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
}

.team {
  position: relative;
  width: 30%;
  height: auto;
  margin: 15px 0;
  text-align: center;

  .team-info {
    border-radius: 2px;
    position: relative;
  }

  .team-bg {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 3px;
  }

  .middle-cover,
  .award-info {
    opacity: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
  }

  .middle-overlay {
    transition: .5s ease;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    text-align: center;
    background-color: #3A58F0;
    overflow: auto;
  }

  .team-project-desc {
    padding: 1rem;
    line-height: 1.8;
    font-size: 14px;
    color: white;
    position: absolute;
    top: 50%;
    text-align: left;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
  }

  .award-icon {
    width: 80%;
    height: auto;
  }

  .award-info {
    top: 43% !important;
    width: 55%;
    line-height: 1.7;

    .award {
      font-size: 0.8rem;
      margin-bottom: 10px;
    }

    p {
      font-size: 0.65rem;
      margin: 10px;
    }
  }

  .awarded-github-btn {
    display: inline-block;
    transition: .5s ease;
    margin: 30px 0;
    color: #fff;
    font-size: 15px;
    border-radius: 2px;
    background: #6780ff;
    padding: 10px 20px;
    border: none;
    cursor: pointer;

    &:hover {
      background: #3A58F0;
    }
  }

  .team-info:hover {
    .middle-overlay {
      opacity: 1;
    }

    .middle-cover,
    .award-info {
      opacity: 0;
    }

    .awarded-github-btn {
      background: #3A58F0;
    }
  }
}

.project {
  position: relative;
  width: 245px;
  height: 300px;
  margin: 15px 0;
  text-align: center;
  background-color: #F4F4F4;
  border-radius: 4px;

  .project-thumbnail {
    position: relative;

    .project-desc {
      position: absolute;
      background-color: #172D72;
      color: white;
      opacity: 0;
      transition: 0.5s ease-in-out;
      width: 100%;
      height: 100%;
      top: 0;
      font-size: 12px;
      line-height: 1.8;
      padding: 1rem;
      text-align: left;
      overflow: auto;
    }
  }

  .project-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px 4px 0 0;
  }

  .project-github {
    position: absolute;
    width: 100%;
    bottom: 18px;
  }

  .project-name {
    font-size: 13px;
    padding: 10px 14px 0;
    position: absolute;
    top: 72%;
    text-align: center;
    width: 196px;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .project-github-btn {
    color: #fff;
    font-size: 12px;
    border-radius: 2px;
    background: #172D72;
    transition: 0.1s ease-in-out;
    padding: 8px 13px;
    border: none;
    cursor: pointer;
  }

  &:hover {
    .project-thumbnail .project-desc {
      opacity: 1;
    }

    .project-github-btn {
      background: #3351FF;
    }

    .project-github-btn.unclickable-btn {
      background: #172d72 !important;
    }
  }
}

.tutor-members {
  background-color: #272727;
}

.tutor-list {
  justify-content: center;
}

.tutor {
  background: none;
  color: #C7962D;

  .tutor-avatar {
    border-radius: 50%;
    width: 140px;
    height: 140px;
    object-fit: cover;
  }

  .tutor-name {
    font-size: 0.9rem;
    padding: 15px 10px 5px;
  }

  .tutor-title {
    font-size: 14px;
    padding: 0 10px;
  }
}

.hackathon-moments {
  background-color: #F5F5F5;
}

.review-card {
  width: 100%;
  margin: 1rem 0;
  position: relative;
  box-shadow: 0 1px 2px 0 #ddd;
  transition: 0.1s ease-in-out;
  height: 250px;

  &:hover {
    box-shadow: 3px 3px 13px #DDDDDD;
  }
}

.review-thumbnail {
  display: inline-block;
  overflow: hidden;
  width: 375px;
  height: 250px;

  img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
  }
}

.review-content {
  float: right;
  width: calc(~'100% - 375px');
  height: 250px;
  overflow: auto;
  padding: 1rem 2rem;
  display: inline-block;

  .review-title {
    font-weight: 600;
    font-size: 1rem;
  }

  .review-desc {
    font-size: 14px;
    padding: 20px 0;
    line-height: 1.8;
  }
}

@media (max-width: 600px) {
  .hackathon2018-banner {
    background: url('https://download.pingcap.com/images/banners/hackathon-banner-mobile.jpg') no-repeat;
    padding-top: 58%;
  }

  .about-hackathon {
    .hackathon-intro {
      padding: 1.5rem 0;
    }

    .hackathon-date {
      padding: 0 0 2rem;
    }
  }

  .team {
    width: 48%;
    margin: 6px 0;

    .award-icon {
      width: 91%;
    }

    .award-info {
      width: 63%;

      p {
        margin: 2px;
      }

      .award {
        font-size: 0.7rem;
        margin-bottom: 5px;
      }
    }

    .team-project-desc {
      font-size: 12px;
      line-height: 1.7;
      position: relative;
      top: auto;
      left: auto;
      transform: none;
      padding: 0.8rem;
    }

    .awarded-github-btn {
      margin: 16px 0;
      font-size: 12px;
      padding: 7px 11px;
    }
  }

  .project {
    width: 48%;
    height: 225px;

    .project-github {
      bottom: 10px;
    }

    .project-name {
      font-size: 12px;
      top: 70%;
      width: 177px;
    }

    .project-github-btn {
      padding: 6px 10px;
      font-size: 11px;
    }

    .project-thumbnail .project-desc {
      line-height: 1.6;
      padding: 0.8rem;
    }
  }

  .tutor {
    .tutor-avatar {
      width: 100px;
      height: 100px;
    }

    .tutor-name {
      font-size: 1rem;
    }

    .tutor-title {
      font-size: 12px;
    }
  }

  .review-card {
    height: auto;
    box-shadow: none;

    .review-thumbnail {
      width: 100%;
      height: 100%;
    }

    .review-content {
      float: none;
      width: 100%;
      height: auto;
      padding: 1rem 0;

      .review-desc {
        font-size: 13px;
      }
    }
  }
}

@media (max-width: 360px) {
  .project {
    height: 200px;
  }
}

@media (max-width: 320px) {
  .team {
    width: 80%;
    margin: 0 auto 1rem;

    .award-icon {
      width: 91%;
    }

    .award-info {
      p {
        margin: 2px;
        font-size: .75rem;
      }

      .award {
        font-size: 0.9rem;
      }
    }

    .team-project-desc {
      font-size: 0.75rem;
    }
  }

  .project {
    width: 80%;
    height: 267px;
    margin: 15px auto;

    .project-github {
      bottom: 12px;
    }

    .project-name {
      top: 73%;
    }
  }

  .tutor {
    width: 48% !important;
    height: 220px !important;
  }
}
