/* The color theme used here serves to compliment and work with the logo. I added some darker greys to draw the attention of younger users */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #424242;
  color: #f0f0f0;
}

/* Here I am using Flexbox to arrange the child elements in a column and align these elements to the center of the page. 
*/
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background-color: #FFF;
  border: 2px solid #02a1e3;
}

.logo {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo img {
  max-width: 700px;
}

.intro, .features, .hello-world, .java-concepts {
  margin-bottom: 2rem;
}

/* By using the Flexbox model configured such this I am able to seperate the image from the other content in this class while not using absolute positioning. Absolute positioning lead to issues on smaller resolutions. */
.hello-world {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
}

.hello-world-image {
  max-width: 50%;
  height: auto;
  flex: 1;
}

/* By adding most of the content in this website to a contianer like this we are able to give it a modern look that stands out and organizes the content neatly. The border-radius property gives us nicely rounded corners that helps this website to be more appealing. */
.intro {
  text-align: center;
  padding: 2rem;
  background-color: #3a3a3a;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.intro h2, .intro h2 {
  margin-bottom: 1rem;
}

.intro h2 {
  background-color: #02a1e3;
  padding: 1rem;
  border-radius: 10px;
}

.features {
  background-color: #2d2d2d;
  padding: 2rem;
  border-radius: 10px;
}

.features h2 {
  padding: 1rem;
  background-color: #ed2554;
  border-radius: 10px;
  display: inline-block;
}

/* Breaking this unordered list into two columns help to make use of the horizontal space most desktops are going to have. By using the -webkit- and -moz- prefix, there is greater compatibility among all versions of Chrome, Safari, and Firefox */
.features ul {
  columns: 2;
  -webkit-columns: 2;
  -moz-columns: 2;
}

.features li {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.setup-content {
  background-color: #3a3a3a;
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.setup-content h2 {
  background-color: #02a1e3;
  padding: 1rem;
  border-radius: 10px;
}

.setup-content h3 {
  margin-bottom: 1rem;
}

.setup-content ol {
  padding-left: 1.5rem;
}

.setup-content li {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.programming-content {
  background-color: #3a3a3a;
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.programming-content h2 {
  background-color: #02a1e3;
  padding: 1rem;
  border-radius: 10px;
}

.programming-content h3 {
  margin-bottom: 1rem;
}

.programming-content ol, .programming-content ul {
  padding-left: 1.5rem;
}

.programming-content li {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.java-concepts {
  margin-bottom: 2rem;
}

/* Using border-collapse we can combine borders into a single border which creates a cleaner look. */
.java-concepts table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.1rem;
}

.java-concepts th, .java-concepts td {
  padding: 10px;
  border: 1px solid #f0f0f0;
}

.java-concepts th {
  background-color: #02a1e3;
  color: #f0f0f0;
}

/* Each row can be viewed more easily by giving odd and even rows different colors */
.java-concepts tr:nth-child(even) {
  background-color: #3a3a3a;
}

.java-concepts tr:nth-child(odd) {
  background-color: #2d2d2d;
}

.java-concepts p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.resources-content {
  background-color: #3a3a3a;
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.resources-content h2 {
  background-color: #02a1e3;
  padding: 1rem;
  border-radius: 10px;
}

.resources-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
  font-weight: bold;  
}

.resources-content ul {
  border-top: 1px solid #02a1e3;
  list-style-type: disc;
  padding-top: 1rem;
  margin-top: 1rem;
  padding-left: 1.5rem;
}

.resources-content ul li:first-child {
  margin-top: 1rem;
}

.resources-content p {
  margin: 2rem 0;
  
}

.resources-content li {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.resources-content a {
  color: #02a1e3;
}

.resources-content a:hover {
  text-decoration: underline;
}

nav {
  width: 100%;
  background-color: #FFF;
}

/* Using Flexbox here helps to wrap the child elements or page link onto the next line as neeeded for smaller displays so all pages are accessible from any display */
nav ul {
  display: flex;
  list-style-type: none;
  justify-content: center;
  padding: 0.5rem;
  flex-wrap: wrap;
}

nav li {
  padding: 0.5rem 3%;
}

nav a {
  color: #FFF;
  background-color: #02a1e3;
  text-decoration: none;
  display: block;
  padding: 0.5rem;
  font-size: 2em;
  border: 2px solid #424242;
  border-radius: 10px;
}

nav a:hover {
  text-decoration: none;
  background-color: #ed2554;
}

.features ul, .java-concepts ul {
  list-style-type: disc;
  padding-left: 1.5rem;
}

/* It was important to make the code being displayed stand out from the rest of the content. */
pre {
  background-color: #555;
  padding: 1rem;
  border-radius: 5px;
  white-space: pre-wrap; /* Preserve white space used */
  word-wrap: break-word; /* Break long words onto the next line */
  margin: 1rem 0;
  max-width: 500px;
}

a {
  color: #02a1e3;
}

a:hover {
  text-decoration: underline;
}

h2 {
  width: 100%;
  background-color: #ed2554;
  text-align: center;
  margin-bottom: 1rem;
}

main {
  padding: 2rem;
}

footer {
  background-color: #02a1e3;
  padding: 1rem;
  text-align: center;
}

/* Minor adjustments for optimal viewing on smaller resolution displays */
@media screen and (max-width: 768px) {
  .features ul {
    columns: 1;
    -webkit-columns: 1;
    -moz-columns: 1;
  }

  nav a {
    font-size: 1.5em;
    padding: 0.25rem;
  }
}
