/*
    
CIS166AA: Introduction to JavaScript
Final Project

Author: Sammy Bernstein
Date:   May 10, 2024

*/


/* Apply to All */

* {
    margin: 0;
    padding: 0;
    text-decoration: none;
    list-style: none;
    font-family: sans-serif;
    box-sizing: border-box;
}


/* Typography Styles */

h1 {
    text-align: center;
    font-size: 34px;
    padding-bottom: 30px;
    margin: 75px 50px 10px 50px;
}

h2 {
    margin-top: 25px;
    margin-bottom: 40px;
}

div.paragraph {
    margin-left: 125px;
    margin-right: 125px;
    font-size: 18px;
}

p {
    text-align: center;
    line-height: 1.75em; 
    margin-bottom: 40px;
}

footer {
    font-size: 14px;
    text-align: center;
    margin-top: 75px;
    margin-bottom: 5px;
}

a {
    color: black;
}

a:hover {
    color: #45a049;
}


/* Header Styles */

label.logo {
    font-weight: bold;
    font-size: 28px;
    padding: 0 50px;
    line-height: 80px;
}


/* Navigation Styles */

nav  {
    height: 80px;
    width: 100%;
}

nav ul {
    float: right;
    margin-right: 50px;
}

nav li {
    display: inline-block;
    margin: 0 8px;
    line-height: 80px;
}

nav a {
    font-size: 18px;
    padding: 7px 10px;
    border: 3px;
    color: black;
}

nav a:hover {
    text-decoration: underline;
}


/* Navigation Icon Styles */

nav #icon {
    line-height: 80px;
    float: right;
    margin-right: 40px;
    margin-top: 8px;
    cursor: pointer;
    display: none;
}


/* Projects Section Styles */

.work-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 40px;
    margin-top: 75px;
    margin-right: 125px;
    margin-left: 125px;
    text-align: center;
}

.work-items label {
    font-size: 75px;
    margin: 25px;
}

.work-items h2 {
    margin: 25px;
}

.button {
    width: 25%;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.button:hover {
    background-color: #45a049;
    color: white;
}

.button:active {
	position: relative;
	top: 1px;
}

.javascriptProjects {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.javascriptProjects:hover {
    transform: scale(1.05); 
    background-color: #f5f5f5;
}


/* Work Grid Styles */

.gridContainer {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    width: 60%;
    grid-gap: 40px;
    text-align: center;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
}

.gridItem1,.gridItem2,.gridItem3,.gridItem4,.gridItem5 {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 25px 0;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.gridItem1:hover,.gridItem2:hover,.gridItem3:hover,.gridItem4:hover,.gridItem5:hover {
    transform: scale(1.05); 
    background-color: #f5f5f5;
}

.gridItem1,.gridItem2,.gridItem3,.gridItem4,.gridItem5 p {
    font-size: 18px;
}

.projectButton {
    font-size: 16px;
    width: 50%;
    padding: 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.projectButton:hover {
    background-color: #45a049;
    color: white;
}


/* Calculator Styles */

form#calculator {
    display: block;
    margin: 20px auto;
    padding: 20px;
    width: 80%;
    max-width: 400px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

input[type="text"], select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

button.calcBtn {
    display: block;
    width: 25%;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button.calcBtn:hover {
    background-color: #45a049;
}

#result {
    margin-top: 15px;
    padding: 10px;
    font-size: 18px;
    text-align: center;
}


/* Number Guessing Game Styles */

.numberForm {
    display: block;
    margin: 20px auto;
    padding: 20px;
    width: 80%;
    max-width: 400px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }
  
  label {
    font-weight: bold;
  }
  
  .guessField {
    padding: 10px;
    width: calc(100% - 120px);
    margin-right: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }
  
  .guessSubmit {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  .guessSubmit:hover {
    background-color: #45a049;
  }
  
  .resultParas {
    margin-top: 20px;
  }
  
  .resultParas p {
    font-size: 18px;
    margin-bottom: 10px;
  }
  
  .guesses {
    font-weight: bold;
  }
  
  .lastResult {
    font-weight: bold;
  }
  
  .lowOrHi {
    font-style: italic;
  }


/* Image Gallery Styles */

div.gallery {
    text-align: center;
    width: 640px;
    margin: 0 auto;
}


.full-img {
    position: relative;
    display: block;
    width: 640px;
    height: 480px;
  }
  
  .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 640px;
    height: 480px;
    background-color: rgba(0,0,0,0);
  }
  
  button.dark {
    width: 75px;
    border: 0;
    background: rgba(150, 150, 150, 0.6);
    border: 1px solid #999;
    font-family: helvetica, arial, sans-serif;
    padding: 5px;
    position: absolute;
    cursor: pointer;
    top: -15px;
    left: 3px;
  }
  
  .thumb-bar img {
    display: block;
    width: 20%;
    float: left;
    cursor: pointer;
  }


/* Keyboard Events Styles */

#myCanvas {
    display: block;
    margin: 0 auto;
    border: 2px solid #333; 
    border-radius: 5px;
  }
  
section.preview {
    text-align: center;
    margin-top: 20px;
  }


/* Color Changing Button Styles */

.button-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.colorButton {
    padding: 10px 20px;
    margin: 0 10px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.colorButton[data-color="red"] {
    background-color: rgb(200, 0, 0);
    color: white;
}

.colorButton[data-color="yellow"] {
    background-color: rgb(245, 210, 0);
    color: black;
}

.colorButton[data-color="green"] {
    background-color: green;
    color: white;
}

.colorButton[data-color="purple"] {
    background-color: purple;
    color: white;
}

.colorButton:hover {
    opacity: 0.8;
}


/* Contact Form Styles */

form {
    margin: 0 auto;
    width: 70%;
    max-width: 600px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

li {
    margin-bottom: 20px;
}

label {
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

input:invalid {
    border-color: red;
}

input:valid {
    border-color: green;
}


/* Button Styles */

button.contactButton {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button.contactButton:hover {
    background-color: #45a049;
}


/* Responsive Styles */

@media (max-width: 1048px) {
    label.logo {
       padding-left: 30px;  
    }

    nav ul {
        margin-right: 30px;
    }
}

@media (max-width: 890px) {
    nav #icon {
        display: block;
    }

    nav ul {
        position: fixed;
        width: 100%;
        height: 100vh;
        background-color: white;
        top: 80px;
        left: 0;
        transition: all 0.5s;
        text-align: center;
        display: none;
    }

    nav ul.show {
        display: block;
    }

    nav li {
        display: block;
        margin: 50px 0;
        line-height: 30px;
    }

    nav a {
        font-size: 20px;
    }

    form {
        width: 80%;
    }

    /* Work Page */
    .gridContainer {
        grid-template-columns: 1fr;
    }
    .gridItem1,.gridItem2, .gridItem3,.gridItem4,.gridItem5 {
        padding: 15px;
    }

    /* Calculator */
    form#calculator {
        width: 75%;
        margin-left: 85px; 
        margin-right: 35px;
    }

    button {
        width: 45%;
        text-align: center;
    }
}

@media (max-width: 428px) {

    h1 {
        text-align: center;
        font-size: 28px;
        margin: 30px 5px 15px 5px;
        padding: 25px;
    }

    div.paragraph {
        width: 60%;
        margin-left: 90px;
        margin-bottom: 30px;
    }   

    p {
        font-size: 16px;

    }

    label.logo {
        font-size: 20px;
    }
    
    nav #icon {
        display: block;
    }

    nav ul {
        position: fixed;
        width: 100%;
        height: 100vh;
        top: 80px;
        left: 0;
        background-color: white;
        transition: all 0.5s;
        text-align: center;
        align-items: center;
        display: none;
    }

    nav ul.show {
        display: block;
    }

    nav li {
        display: block;
        margin: 50px 0;
        line-height: 30px;
    }

    nav a {
        font-size: 18px;
    }

    /* Project Styles */
    .work-items {
        margin: 0 20px;
    }

    .javascriptProjects {
        margin: 20px auto;
        width: 80%;
    }

    .work-items h1 {
        font-size: 50px;
        line-height: 25px;
    }

    .work-items h2 {
        font-size: 18px;
    }

    .button {
        font-size: 14px; 
        padding: 10px 20px; 
        margin-bottom: 10px;
    }

    /* Work Page */
    .gridContainer {
        grid-template-columns: 1fr;
    }

    /* Calculator */
    form#calculator {
        padding: 10px;
        margin-left: 55px;
    }

    input[type="text"], select {
        width: 100%;
    }

    button {
        width: 100%;
    }
    
    #result {
        font-size: 15px;
    }
}