@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Nanum+Pen+Script&display=swap");

$blue: #007bff;
$blue-hover: #0056b3;
$gray-border: #e0e0e0;
$gray-tab: #495057;

body,
html {
  overflow-x: hidden;
}

body {
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  max-height: 100vh;
}

#page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 60px;
  margin: 0 auto;
  height: 60px;
  background-color: #fff;
  border-bottom: 1px solid $gray-border;
  box-sizing: border-box;
  @media screen and (max-width: 600px) {
    padding: 0 30px;
  }

  .header-logo ul.logo {
    list-style: none;
    padding-left: 0;
  }

  .header-menu ul.menu {
    display: flex;
    align-items: center;
    list-style: none;
    padding-left: 0;
    margin: 0;
    gap: 12px;
  }

  .create-code-btn {
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 25px;
    padding: 5px 15px;
    cursor: pointer;
    color: #000;

    @media screen and (max-width: 600px) {
      display: none;
    }

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

  .user-name-text {
    text-decoration: none;
    color: #000;
  }

  .login-btn {
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 25px;
    padding: 5px 15px;
    cursor: pointer;
    color: #000;

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

  .logout-btn {
    cursor: pointer;
    svg {
      display: none;
      margin-left: 10px;
      height: 1.5em;
      width: auto;
      fill: #000;
    }
    @media screen and (max-width: 600px) {
      div {
        display: none;
      }
      svg {
        display: block;
      }
    }
  }
}

.tab-menu {
  padding: 0 60px;
  display: flex;
  justify-content: space-between;
  ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
    @media screen and (max-width: 600px) {
      span {
        display: none;
      }
    }
    .tab-button {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 12px 6px 8px 0;
      text-decoration: none;
      color: $gray-tab;
      font-weight: 600;
      border-bottom: 3px solid transparent;
      transition: color 0.2s ease, border-color 0.2s ease;

      &:hover {
        color: $blue-hover;
      }

      &.active {
        color: $blue;
        border-bottom-color: $blue;
      }
    }
    .tab-icon {
      height: 1.8em;
      width: auto;
    }
  }
  .category-box {
    display: flex;
    margin-top: 15px;
    gap: 10px;
    .category {
      text-align: center;
      background-color: white;
      border-radius: 5px;
      height: 30px;
      width: 65px;
      &:focus {
        outline: none;
      }
      &:not(:last-child) {
        @media screen and (max-width: 600px) {
          display: none;
        }
      }
    }
    .category-assignment {
      width: 120px;
      min-width: 80px;
    }
  }
}

#main-content {
  #post-list-container {
    .detail-page {
      text-decoration: none;
      p {
        color: #000;
      }
    }
    display: grid;
    gap: 40px;
    padding: 12px 50px 0;
    grid-template-columns: repeat(auto-fill, 318px);
    justify-content: center;
    @media screen and (min-width: 1920px) {
      padding: 12px 50px 0;
      grid-template-columns: repeat(auto-fill, 330px);
    }
    .post-list-box {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      overflow: hidden;
      width: 100%;
      min-height: 380px;
      background-color: #fff;
      box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
      border-radius: 5px;

      .code-text {
        padding: 10px;
        overflow-x: hidden;

        pre {
          margin: 0;
          padding: 0;
          overflow: hidden;
        }

        code {
          display: block;
          height: 270px;
          overflow: hidden;
          white-space: pre-wrap;
        }
      }
    }
    .code-information {
      display: flex;
      padding: 5px 20px 0 15px;
      border-top: 1px solid $gray-border;
      justify-content: space-between;
      gap: 10px;
      .info-box {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        margin: 0;
        padding: 0;
        p {
          margin: 0;
          padding: 0;
        }
        .title {
          font-size: 1.15rem;
          font-weight: 400;
        }
        .student-info {
          font-size: 0.7rem;
        }
      }
      .like-box {
        display: flex;
        gap: 4px;
        #code-likes {
          cursor: default;
        }
      }
    }
  }
}

#page-footer {
  padding: 10px;
  text-align: center;
  font-size: 0.8em;
  margin-top: auto;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 45px;
  margin-bottom: 10px;
  .page-list {
    display: flex;
    justify-content: center;
    gap: 10px;
  }
  svg {
    height: 1.5rem;
    width: 1.5rem;
    fill: #000;
  }
  .page-button.active {
    border-color: $blue;
    border-width: 1.5px;
  }
  .page-button {
    padding: 5px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    min-width: 2.5rem;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
