/* To fix the horizontal overflow */
*, *::before, *::after {
  box-sizing: border-box;
}

/* CSS Variables for color themes */
/* Define color variables */
:root {
  /* background colors for changes */
  --main-color: #F77E6E; /* Menu, Footer, Buttons */
  --welcome-color: #C4567F; /* Welcome with users color form */
  --projects-dark: #1C346A; /* Projects section */
  --about-contact: #794381; /* About me, Contacts */
  /* text colors */
  --text-color: #ffffff; /* Main text color */
  --text-welcome: #ffffff;
  --text-projects: #ffffff;
  --text-about: #ffffff;
  --text-main-contrast: #000000; /* For buttons on main color */ 
}


/* Global document styles */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');
body {
  font-family: 'Open Sans', sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: 16px;
}
h1 {
  display: block;
  font-size: 2rem;
  margin-bottom: 10px;
}
h3 {
  display: block;
  font-size: 1.5rem;
  line-height: 2rem;
  margin: 0 auto;
  max-width: 80%;
}
p {
  display: block;
  font-size: 0.8rem;
}
.font-italic {
  font-style: italic;
}



/* Navigation styles */
#navbar {
  font-size: 1.2rem;
  font-weight: bold;
  text-decoration: none;
  position: fixed;
  top: 0;
  background-color: var(--main-color);
  margin: 0;
  width: 100%;
  height: 80px;
}

.nav-list {
  display: flex;
  justify-content: flex-end;
  list-style-type: none;
  padding: 30px;
}
.nav-list li {
  display: inline-block;
  margin-left: 30px;
}
#logo {
  position: fixed;
  display: inline-block;
  top: 8px;
  left: 20px;
  cursor: pointer;
  width: fit-content;
  height: 80px
}
#logo img {
  display: inline-block;
  width: 100px;
  height: auto;
  transition: width 0.3s ease-in-out;
}
#logo div {
  display: inline-block;
  position: relative;
  top: -28px;
}


/* link Initial state */
.nav-list a {
  color: var(--text-color);
  text-decoration: none;
  display: inline-block;
  transition: transform 0.3s ease-in-out;
}
/* link Hover state */
.nav-list a:hover {
  transform: scale(1.16);
  cursor: pointer;
}


/* Welcome section styles */ 
#welcome-section {
  background-color: var(--welcome-color);
  color: var(--text-welcome); 
  /* Uses specific variable */
  display: flex;
  justify-content: center;
  flex-flow: column;
  align-items: center;
  width: 100%;
  height: 100vh;
}

.input-container {
  display: block;
  margin: 20px;
  text-align: center;
}

input {
  width: 100%;
  height: 1.6em;
  border: 0;
  border-radius: 3px;
  text-align: center;
}

input::placeholder {
  opacity: 0.8;
  color: var(--welcome-color);
}

#color-button {
  background-color: var(--main-color);
  color: var(--text-color);
  border: 0;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 2px;
  margin: 10px;
}

/* Buttons (using main color) */
.btn-submit {
  background-color: var(--main-color);
  color: var(--text-main-contrast); 
  border: none;
  cursor: pointer;
}


/* Projects section styles */
#projects {
  background-color: var(--projects-dark);
  color: var(--text-projects); 
  /* Uses specific variable */
  display: flex;
  text-align: center;
  justify-content: center;
  align-items: center;
  flex-flow: column;
  width: 100%;
  height: fit-content;
  padding: 8vh 0;
}
#projects h3 {
  color: var(--text-color);
}
.flex-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-around;
  height: 80vh;
  min-height: fit-content;
  width: 100%;
  margin: 6vh auto;
  flex-shrink: 0;
}
.flex-container a, .flex-container p {
  text-decoration: none;
  display: block;
  margin: 10px 0;
  font-size: 1rem;
}

.project-tile {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-flow: column;
  border-radius: 3px;
  line-height: 1.5rem;
  margin: 1.6vw;
  width: 30%;
  height: 22vw;
  min-height: 280px;
  background-color: var(--about-contact);
  /* box-shadow: 1px 1px 2px var(--text-projects); */
  /* border: var(--main-color) 0.6px solid; */
}
.project-image {
  width: 6vw;
  height: 6vw;
  display: inline-block;
  object-fit: cover;
  overflow: hidden;
  border-radius: 3px;
  min-width: 80px;
  min-height: 80px;
  /* this line to prevent shrinking */
  flex-shrink: 0;
}
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: width 0.3s ease-in-out;
}

.project-link {
  display: inline-block;
  margin: 20px;
  /*text-align: left;*/
  width: 100%;
  transition: transform 0.3s ease-in-out;
}
.project-link:hover {
  cursor: pointer;
  transform: scale(1.1);
}

.button-container {
  display: block;
  width: fit-content;
  height: fit-content;
  background-color: var(--about-contact);
  border-radius: 2px;
  cursor: pointer;
  border: 0;
  padding: 0.8rem;
  margin-top: 3vh;
  font-size: 0.8rem;
}
.button-container a {
  color: var(--text-color);
  text-decoration: none;
}


/* About & Contact Sections */
#about-contact-bg {
  background-color: var(--about-contact);
  width: 100%;
  height: 80vh;
}
.about-section {
  display: flex;
  justify-content: center;
  text-align: center;
  padding-top: 30px;
  font-size: 1.2rem;
  margin-bottom: -10px;
}
aside {
  width: 20vw;
  min-width: 160px;
  height: fit-content;
  float: left;
  padding-left: 0.5rem;
  margin-left: 0.5rem;
  margin-right: 1rem;
  font-style: italic;
}
.about-text {
  width: 42vw;
  max-width: 800px;
  height: fit-content;
  text-align: left;
}

#about, #contact, #toolkit {
  background-color: var(--about-contact);
  color: var(--text-about); 
  /* Uses specific variable */
  width: 100%;
  height: fit-content;
}
#about p, #toolkit p {
  font-size: 1rem;
  line-height: 1.5rem;
  display: block;
  height: fit-content;
  text-align: left;
  margin: 1vh auto;
}
#about h1, #toolkit h1{
  display: block;
  height: fit-content;
  text-align: left;
  margin: 1vh auto;
}
#toolkit {
  width: 100%;
  height: fit-content;
  margin: 0 auto;
}

#contact {
  display: flex;
  justify-content: center;
  flex-flow: column;
  text-align: center;
  width: 100%;
  height: 30vh;
  min-height: fit-content;
  font-size: 1.2rem;
  padding-bottom: 8vh;
}

.contacts-container {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 40px;
  align-items: center;
}
/* Contacts link Initial state */
.contacts-container a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  transition: transform 0.3s ease-in-out;
}
/* Contacts link Hover state */
.contacts-container a:hover {
  transform: scale(1.16);
  cursor: pointer;
}

/* Footer styles */
footer {
  width: 100%;
  height: 60px;
  background-color: var(--main-color);
  color: var(--text-color);
}
.footer-content {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  padding: 0 20px;
}
.footer-content p {
  font-size: 0.8rem;
}
#caption {
  font-weight: bold;
}

/* Media Queries for responsiveness */
@media (max-width: 600px) {
  /* To fix the horizontal overflow */
  .nav-list {
    /*padding: 20px auto;*/
    justify-content: center; /* Center nav on mobile */
  }
  .project-tile {
    display: flex;
    justify-content: flex-start;
    width: 90%;
    height: 60vw;
    margin: 20px auto;
    line-height: 1.3rem;
    padding: 0;
  }
  .project-image {
    width: 20vw;
    height: 20vw;
    display: inline-block;
  }
  .flex-container {
  flex-flow: column;
  flex-direction: column-reverse;
  /* To fix the horizontal overflow */
  height: auto; 
  min-height: 80vh;
  }
  #projects {
    padding: 30px 0;
    font-size: 1.2rem;
  }
  .project-link {
    display: inline-block;
    margin: 0 20px 10px 20px;
    text-align: left;
  }

  #about, #contact {
    width: 100%;
    height: fit-content;
    padding: 30px auto;
  }
  #contact h3, #projects h3 {
    font-size: 1.3rem;
  
  }
  #contact a {
    font-size: 0.9rem;
  }
  #about p {
  /* To fix the horizontal overflow */
  width: 90%; /* Increased from 56vw for better mobile readability */
  max-width: 800px;
  margin: 1vh auto;
  }
  .contacts-container {
  /* To fix the horizontal overflow */
    flex-direction: column; /* Stack links vertically */
    gap: 15px;
  }
  .footer-content {
    justify-content: center;
  }
}

@media (max-width: 370px) {
  body {
    font-size: 12px;
  }
  #projects {
    padding: 10px 0;
    font-size: 0.9rem;
    text-align: left;
    justify-content: center;
    align-items: center;
    flex-flow: column;
    width: 100%;
    height: fit-content;
  }
  .project-tile {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    flex-flow: column;
    width: 90%;
    height: 60vw;
    margin: 10px auto;
    line-height: 1.2rem;
    padding: 0;
  }
  .project-image {
    width: 20vw;
    height: 20vw;
    display: block;
    border-radius: 2px;
    min-width: 40px;
    min-height: 40px;
    margin: 1vw auto;
  }
  .project-link {
    display: block;
    margin: 0;
    text-align: center;
  }
}