/* Fix for fixed background across devices */
body {
  position: relative;
  z-index: 0;
  font-family: "Trirong", 'Arial', sans-serif;
  padding: 0;
  margin: 0;
  box-shadow: gray;
  text-shadow: gray;
}

/* Background image stays fixed on all screens */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background-image: url('../media/bgimg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
}

.intro-section {
  margin-top: 5px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('../media/introbg.jpg');
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 100px 20px;
  box-shadow: 10px 10px 10px rgb(56, 54, 54);
  border-radius: 20px;
}

.intro-paragraph {
  text-align: justify;
  max-width: 700px;
  line-height: 1.6;
}

.profile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 900px;
  margin: auto;
}

.profile-picture {
  width: 200px;
  height: 200px;
  border: 2px solid #000000;
  border-radius: 50%;
  margin-bottom: 20px;
  box-shadow: 10px 10px 10px rgb(0, 0, 0);
}

.intro-text {
  color: #fff;
  flex: 1;
  max-width: 700px;
}

.intro-text h1 {
  font-size: 2em;
  margin-bottom: 10px;
}

/* Landscape mode */
@media (min-width: 800px) {
  .intro-section {
    flex-direction: row;
    justify-content: center;
    padding: 85px 20px;
  }

  .profile-container {
    flex-direction: row;
    align-items: center;
    gap: 40px;
    text-align: left;
  }

  .intro-text {
    max-width: 700px;
  }
}

/* Portrait mode */
@media (max-width: 800px) {
  .intro-section {
    padding: 80px 20px;
  }

  .profile-container {
    flex-direction: column;
    text-align: center;
  }

  .profile-picture {
    margin-bottom: 10px;
    margin-right: 0;
  }

  .language-card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

.contact-button {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 25px;
  background-color: #ffffff;
  color: #000000;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  box-shadow: 10px 10px 10px rgb(0, 0, 0);
  transition: transform 0.3s ease-in-out;
}

.contact-button:hover {
  transform: scale(0.95);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.education-section,
.projects-section,
.language-experience,
.contact-section,
.tools-technologies {
  padding: 20px 10%;
  text-align: left;
}

.project-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.project-card {
  background-color: #fff;
  border: 2px solid #000;
  border-radius: 10px;
  box-shadow: 5px 5px 10px rgba(56, 54, 54, 0.7);
  overflow: hidden;
  height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: scale(1.05);
  z-index: 1;
  box-shadow: 10px 10px 10px rgb(56, 54, 54);
}

.project-card img {
  width: 100%;
}

.project-info {
  padding: 15px;
  overflow-y: auto;
  height: 100%;
}

.project-info::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 3px;
}

.visit-button {
  display: inline-block;
  padding: 5px 10px;
  background-color: #000000;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  margin-top: 10px;
}

.contact-icons {
  display: flex;
  justify-content: center;
  align-items: center;
}

.contact-icons a {
  margin: 0 10px;
}

.contact-icons img {
  width: 40px;
  height: 40px;
}

.duration {
  color: gray;
  font-size: smaller;
}

.navbar {
  background-image: url('https://i.pinimg.com/736x/7d/59/c6/7d59c6669c9dbaa7a747667f7a1a87a2.jpg');
  border-radius: 20px;
  padding: 10px;
  text-align: center;
}

.navbar ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.navbar li {
  display: inline;
  padding: 20px;
  margin-right: 20px;
}

.navbar a {
  text-decoration: none;
  color: #fff;
  font-weight: bold;
}

.language-experience {
  text-align: left;
  margin-top: 10px;
}

.section-title {
  font-size: 24px;
  margin-bottom: 20px;
}

.language-card {
  margin-top: 20px;
  margin-bottom: 20px;
  flex: 1 1 calc(33.33% - 20px);
  max-width: calc(33.33% - 20px);
  box-sizing: border-box;
  text-align: left;
}

.language-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.language-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.progress-bar {
  width: 100%;
  margin: 0 auto;
  background-color: #fff;
  height: 15px;
  border-radius: 8px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background-color: #000;
}

.tools-technologies {
  padding: 50px 10%;
  text-align: left;
}

.education-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  padding-top: 20px;
}

.education-card {
  background-color: #fff;
  border: 2px solid #000;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 5px 5px 10px rgba(56, 54, 54, 0.7);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 200px;
}

.education-card:hover {
  transform: scale(1.05);
}

.tools-card {
  background-color: #fff;
  border: 2px solid #000;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 5px 5px 10px rgba(56, 54, 54, 0.7);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 1000px;
  margin-top: 10%;
}

.tools-card:hover {
  transform: scale(1.05);
  box-shadow: 10px 10px 10px rgba(56, 54, 54, 0.9);
}

.tools-card ul {
  list-style-type: disc;
  padding-left: 20px;
  margin: 0;
}

.tools-card li {
  padding: 5px 0;
  font-weight: bold;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px 30px;
  padding: 10px 20px;
  font-weight: bold;
  text-align: center;
}

@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
