@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@800&family=Titan+One&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@800&family=Titan+One&display=swap");

/* Common style */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #fb99bf;
  bottom: 0;
}

body {
  display: flex;
  flex-direction: column;
}

.section {
  display: none;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

/* Home */
.section-title {
  font-family: "Lexend", sans-serif;
  font-size: 29px;
  position: relative;
  margin-top: 30px;
  font-weight: 500;
  text-align: center;
}

.certificate-slider-container,
.achievement-slider-container {
  overflow-x: auto;
  white-space: nowrap;
  display: flex;
  margin: 10px;
  justify-content: center;
  box-sizing: border-box;
  max-width: 100%;
  padding: 20px;
}

.certificate-slider,
.achievement-slider {
  display: flex;
  max-width: 100%;
}

.certificate-card,
.achievement-card {
  width: 300px;
  max-width: 100%;
  height: auto;
  flex: 0 0 auto;
  margin-right: 20px;
  border: 2px solid #000;
  border-radius: 10px;
  overflow: hidden;
  background-color: #f9f0df;
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.certificate-details,
.achievement-details {
  padding: 15px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center; /* Center children horizontally */
  text-align: center;
}

.certificate-title,
.achievement-title {
  font-family: "Lexend", sans-serif;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 10px;
  white-space: normal;
  width: 100%;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.certificate-description,
.achievement-description {
  font-family: "Lexend", sans-serif;
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  white-space: normal;
  width: 100%;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
  text-overflow: ellipsis;
  text-align: center;
}

.certificate-img,
.achievement-img {
  width: 100%;
  height: auto;
  margin: 10px;
  border: 2px solid #000;
  max-height: 200px;
  border-radius: 10px;
  max-width: 270px;
  align-self: center;
}

.certificate-img-container,
.achievement-img-container {
  overflow: hidden;
  display: flex;
  justify-content: center;
}

/* Modal Styles */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.modal-container {
  width: 85%;
  max-width: 700px;
  height: 80vh;
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  border: 2px solid black;
  border-radius: 15px;
  overflow: hidden;
}

.modal-content {
  height: 100%;
  overflow-y: auto;
  margin: auto;
  padding: 20px;
  box-sizing: border-box;
  background-color: #fff;
  position: relative;
  background-color: #f9f0df;
  text-align: center;
  border-radius: 15px;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #000;
  cursor: pointer;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close-modal:hover,
.close-modal:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.modal-details {
  text-align: center;
}

.modal-title {
  font-family: "Lexend", sans-serif;
  font-size: 24px;
  margin: 0;
  margin-bottom: 10px;
}

.modal-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 15px;
  border: 2px solid black;
}

.modal-description {
  font-family: "Lexend", sans-serif;
  font-size: 16px;
  color: #666;
}

.modal-link {
  font-family: "Lexend", sans-serif;
  font-size: 14px;
  text-decoration: none;
  display: block;
  margin: 10px;
  z-index: 3;
  transition: color 0.3s ease;
}

.modal-link:hover {
  text-decoration: underline;
}

#button-link {
  position: absolute;
  top: 80%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

#button-image {
  width: 20%;
  height: auto;
  cursor: pointer;
  transition: transform 0.3s ease-in-out;
}

#button-link:hover #button-image {
  transform: scale(1.1);
}

.home-img {
  max-width: 80%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.home-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

#certificate-modal-container .modal-link {
  font-family: "Lexend", sans-serif;
  font-size: 14px;
  text-decoration: none;
  display: block;
  margin: 10px;
  transition: color 0.3s ease;
}

#certificate-modal-container .modal-link:hover {
  text-decoration: underline;
}

/* For mobile devices */
@media screen and (max-width: 768px) {
  .section-1 {
    display: flex;
    margin-top: 80px;
    margin-bottom: 20px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
  }

  .section-title {
    font-size: 20px;
  }

  .home-container {
    margin-top: 90px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .home-img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
  }

  .button-explore {
    display: none;
  }

  /* Navbar */
  .navbar {
    position: fixed;
    width: 100%;
    background-color: #f8f9fa;
    z-index: 5;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    margin-right: 20px;
    height: 17px;
    cursor: pointer;
    transition: transform 0.4s ease-in-out;
  }

  .menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #000;
    transition: transform 0.4s ease-in-out, opacity 0.2s ease-in-out;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  #menu-links {
    display: flex;
    flex-direction: column;
    padding: 10px;
    text-align: center;
    background-color: #f9f0df;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    border-radius: 5px;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    opacity: 0;
    transform: translateY(-20px);
  }

  #menu-links.active {
    opacity: 1;
    transform: translateY(0);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    margin-top: 10px;
    margin-bottom: 30px;
  }

  .logo-container {
    text-align: center;
  }

  .certificate-slider-container,
  .achievement-slider-container {
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    flex-wrap: nowrap;
    padding: 10px;
  }

  .certificate-slider,
  .achievement-slider {
    display: flex;
    flex-wrap: nowrap;
  }

  .certificate-card,
  .achievement-card {
    flex: 0 0 auto;
    width: 180px;
    border: 1px solid #000;
    max-width: calc(70%);
    margin-right: 15px;
  }

  .certificate-img,
  .achievement-img {
    width: 90%;
    height: auto;
    margin: 10px;
    border: 1px solid #000;
    max-height: 200px;
    border-radius: 10px;
    max-width: 270px;
    align-self: center;
  }

  .certificate-img-container,
  .achievement-img-container {
    width: 100%;
  }

  .certificate-details,
  .achievement-details {
    padding: 10px;
  }

  .certificate-title,
  .achievement-title {
    font-size: 12px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }

  .certificate-description,
  .achievement-description {
    font-size: 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }

  .modal-container {
    width: 85%;
    max-width: 700px;
    height: 320px;
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    border: 1px solid black;
    border-radius: 15px;
    overflow: hidden;
  }

  .modal-content {
    height: 100%;
    overflow-y: auto;
    margin: auto;
    padding: 20px;
    box-sizing: border-box;
    background-color: #fff;
    position: relative;
    background-color: #f9f0df;
    text-align: center;
    border-radius: 15px;
  }

  .close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #000;
    cursor: pointer;
    float: right;
    font-size: 28px;
    font-weight: bold;
  }

  .close-modal:hover,
  .close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
  }

  .modal-details {
    padding: 10px;
  }

  .modal-title {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .modal-img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid black;
  }

  .modal-description {
    font-size: 14px;
  }

  .close-modal {
    font-size: 20px;
  }
}
