@import url("https://fonts.googleapis.com/css2?family=Comic+Relief:wght@400;700&family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap");

* {
  margin: 0;
  padding: 0;
  text-decoration: none;
  box-sizing: border-box;
  border: none;
  outline: none;
}
:root {
  --bg-color: #151f28;
  --main-color: #00abf0;
  --text-color: #333;
  --second-text-color: #555;
  --white-color: #fff;
  --cover-color: linear-gradient(45deg, #00abf0, #006e9a);
  --pages-color: linear-gradient(90deg, #fff, #ddd);
  --border: 0.125rem solid #00abf0;
  --box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.2);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  font-family: "Nunito", sans-serif;
}

.wrapper {
  position: relative;
  width: 66rem;
  height: 45rem;
  padding: 2rem;
  perspective: 250rem;
  animation: show-animate 2s forwards;
}

@keyframes show-animate {
  0%,
  30% {
    opacity: 0;
    transform: rotate(-20deg);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg);
  }
}

.cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background-color: var(--cover-color);
  background-color: #029bca;
  box-shadow: var(--box-shadow);
  border-top-left-radius: 0.6rem;
  border-bottom-left-radius: 0.6rem;
  transform-origin: right;
}

.cover.cover-left {
  z-index: -1;
}

.cover.cover-right {
  z-index: 100;
  transition: transform 1s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.cover.cover-right.turn {
  transform: rotateY(180deg);
}

.book {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  perspective: 250rem;
}

.book .book-page {
  position: absolute;
  width: 50%;
  height: 100%;
  background: var(--pages-color);
  box-shadow: 0 0 0.6rem rgba(0, 0, 0, 0.1);
  display: flex;
  padding: 2rem;
}

.book-page.page-left {
  box-shadow: -0.6rem 0.6rem 0.6rem rgba(0, 0, 0, 0.1);
}

.profile-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.profile-page img {
  max-width: 180px;
  border-radius: 50%;
  border: 0.25rem solid var(--main-color);
  margin-bottom: 0.8rem;
}

.profile-page h1 {
  font-size: 2.7rem;
  line-height: 1;
}

.profile-page h3 {
  color: var(--main-color);
  font-size: 1.5rem;
}

.profile-page .social-media {
  margin: 0.6rem 0.8rem;
}

.profile-page .social-media a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: var(--border);
  border-radius: 50%;
  font-size: 1.3rem;
  color: var(--main-color);
  margin: 0 0.2rem;
  transition: 0.5s;
}

.profile-page .social-media a:hover {
  background-color: var(--main-color);
  color: var(--white-color);
}

.profile-page p {
  text-align: justify;
  font-size: 1.1rem;
}

.profile-page .btn-box {
  margin-top: 1.2rem;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 9.5rem;
  height: 3rem;
  background: var(--main-color);
  border: var(--border);
  border-radius: 0.3rem;
  font-size: 1rem;
  color: var(--white-color);
  font-weight: 500;
  margin: 0 1rem;
  transition: 0.5s;
}

.btn-box .btn:nth-child(2) {
  background: transparent;
  color: var(--main-color);
}

.btn-box .btn:nth-child(1):hover {
  background: transparent;
  color: var(--main-color);
}

.btn-box .btn:nth-child(2):hover {
  background: var(--main-color);
  color: var(--white-color);
}

/* right page */
.book-page.page-right {
  position: absolute;
  right: 0;
  transform-style: preserve-3d;
  transform-origin: left;
  transition: transform 1s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.book-page.page-right.turn {
  transform: rotateY(-180deg);
}

.book-page .page-front,
.book-page .page-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--pages-color);
  padding: 1.5rem 2rem;
}

.book-page .page-front {
  transform: rotateY(0deg) translateZ(1px);
}

.book-page .page-back {
  transform: rotateY(180deg) translateZ(1px);
}

.title {
  text-align: center;
}

.workeduc-box {
  border-left: var(--border);
  margin-top: 2rem;
}

.workeduc-box .workeduc-content {
  position: relative;
  padding-left: 1.6rem;
  padding-bottom: 1.2rem;
}

.workeduc-box .workeduc-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: -0.65rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--main-color);
}

.workeduc-content .year {
  color: var(--main-color);
  font-size: 1.2rem;
}

.workeduc-content h3 {
  font-size: 1.4rem;
  margin: 0.3rem 0;
}

.workeduc-content p {
  font-size: 1.15rem;
  text-align: justify;
}

.workeduc-content .year i {
  margin-right: 0.4rem;
  font-size: 1.2rem;
}

.number-page {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 600;
}

/* next button */
.nextprev-btn {
  position: absolute;
  bottom: 0.9rem;
  right: 1.5rem;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-size: 2rem;
  color: var(--second-text-color);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: 0.5s;
}

.nextprev-btn:hover {
  color: var(--main-color);
}

.nextprev-btn.back {
  left: 1.5rem;
}

/* my services */
.services-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

.services-box .services-content {
  flex: 1 1 10rem;
  border: var(--border);
  border-radius: 0.5rem;
  padding: 0.8rem 0.5rem 1.1rem;
  text-align: center;
  transition: 0.3s ease;
}

.services-box .services-content:hover {
  box-shadow: var(--box-shadow);
}

.services-content i {
  font-size: 2.5rem;
  color: var(--main-color);
}

.services-content h3 {
  font-size: 1.1rem;
}

.services-content p {
  margin: 0.2rem 0 0.8rem;
}

.services-content .btn {
  width: 8rem;
  height: 2.5rem;
}

.services-content .btn:hover {
  background-color: transparent;
  color: var(--main-color);
}

/* skills box */
.skills-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

.skills-box .skills-content {
  flex: 1 1 20rem;
}

.skills-content h3 {
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: 0.6rem;
}

.skills-content .content {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.skills-content .content span {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 6rem;
  height: 5rem;
  border: var(--border);
  border-radius: 0.3rem;
  font-weight: 600;
  transition: 0.3 ease;
}

.skills-content .content span:hover {
  box-shadow: var(--box-shadow);
}

.skills-content .content span i {
  color: var(--main-color);
  font-size: 3rem;
}

/* portfolio */
.portfolio-box {
  margin-top: 2rem;
}

.portfolio-box .img-box {
  display: flex;
  width: 100%;
  height: 15rem;
  border-radius: 0.5rem;
  border: var(--border);
  overflow: hidden;
}

.portfolio-box .img-box img {
  width: 100%;
  object-fit: cover;
  transition: 0.5s ease;
}

.portfolio-box .img-box:hover img {
  transform: scale(1.1);
}

.portfolio-box .info-box {
  margin: 1rem 0 1.5rem;
}

.portfolio-box .info-box .info-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.portfolio-box .info-box .info-title h3 {
  font-size: 1.3rem;
}

.portfolio-box .info-box .info-title a {
  display: flex;
  align-items: center;
  color: var(--main-color);
}

.portfolio-box .info-box .info-title a i {
  margin-left: 0.3rem;
}

.portfolio-box .info-box p:nth-of-type(1) {
  font-weight: 600;
}

.portfolio-box .info-box p {
  text-align: justify;
}

.portfolio-box .btn-box {
  display: flex;
  justify-content: center;
}

.portfolio-box .btn-box .btn {
  margin: 0 1 0.15rem;
}

/* Contact Me! */
.contact-box {
  margin-top: 2rem;
  text-align: center;
}
/* Contact Info Styling */
.contact-info {
  list-style: none;
  padding: 0;
  margin: 2rem auto;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.contact-info li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.1rem;
  color: var(--second-text-color);
  background: #fff;
  border: var(--border);
  border-radius: 0.5rem;
  padding: 0.8rem 1rem;
  width: 100%;
  box-shadow: var(--box-shadow);
  transition: 0.3s ease;
}

.contact-info li:hover {
  transform: translateX(5px);
  box-shadow: 0 0 1rem rgba(0, 171, 240, 0.3);
}

.contact-info li i {
  font-size: 1.4rem;
  color: var(--main-color);
  min-width: 1.8rem;
  text-align: center;
}

.contact-info li a {
  color: var(--main-color);
  font-weight: 600;
  transition: 0.3s;
}

.contact-info li a:hover {
  text-decoration: underline;
}

.back-profile {
  position: absolute;
  bottom: 1.2rem;
  right: 2rem;
  width: 2rem;
  height: 2rem;
  background-color: transparent;
  border: var(--border);
  border-radius: 0.3rem;
  font-size: 1.1rem;
  color: var(--main-color);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: 0.5s;
}

.back-profile:hover {
  background: var(--main-color);
  color: var(--white-color);
}

.back-profile p {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scale(0.5);
  font-size: 1rem;
  opacity: 0;
  transition: 0.5s;
  color: var(--main-color);
}

.back-profile:hover p {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  top: -1.8rem;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large tablets and small laptops */
@media screen and (max-width: 1200px) {
  .wrapper {
    width: 90vw;
    height: auto;
    max-width: 60rem;
  }

  .profile-page h1 {
    font-size: 2.2rem;
  }

  .profile-page h3 {
    font-size: 1.3rem;
  }

  .profile-page p {
    font-size: 1rem;
  }
}

/* Medium tablets */
@media screen and (max-width: 992px) {
  body {
    overflow-y: auto;
    align-items: flex-start;
    padding: 2rem 1rem;
  }

  .wrapper {
    width: 100%;
    height: auto;
    padding: 1rem;
    perspective: none;
    animation: none;
    opacity: 1;
    transform: none;
  }

  .cover {
    display: none;
  }

  .book {
    flex-direction: column;
    gap: 2rem;
    perspective: none;
  }

  .book .book-page {
    position: static;
    width: 100%;
    height: auto;
    min-height: 500px;
    transform: none !important;
    transform-style: initial;
    transition: none;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
  }

  .book-page.page-left {
    order: 1;
    box-shadow: var(--box-shadow);
  }

  /* Reorder pages: Profile, Education, Work Experience, Skills, Services, Portfolio, Contact */
  .book-page.page-right {
    position: static;
    right: auto;
    transform: none !important;
    transform-origin: initial;
  }

  /* Page ordering for responsive */
  .book-page.page-right:nth-of-type(2) {
    order: 3;
  } /* Page 1 & 2 container - Education first */
  .book-page.page-right:nth-of-type(3) {
    order: 4;
  } /* Page 3 & 4 container - Skills first */
  .book-page.page-right:nth-of-type(4) {
    order: 5;
  } /* Page 5 & 6 container - Portfolio first */

  /* Within each page container, reverse the order of front and back */
  .book-page .page-back {
    order: 1; /* Education, Skills, Portfolio come first */
  }

  .book-page .page-front {
    order: 2; /* Work Experience, Services, Contact come second */
  }

  .book-page.page-right {
    display: flex;
    flex-direction: column;
  }

  .book-page .page-front,
  .book-page .page-back {
    position: static;
    transform: none !important;
    display: block;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    min-height: 400px;
    width: 100%;
    box-shadow: var(--box-shadow);
  }

  /* Make sure both front and back pages are visible */
  .book-page .page-back {
    display: block !important;
    order: 1; /* Education, Skills, Portfolio come first */
  }

  .book-page .page-front {
    display: block !important;
    order: 2; /* Work Experience, Services, Contact come second */
  }

  /* Each book-page container should be a flex column */
  .book-page.page-right {
    position: static;
    right: auto;
    transform: none !important;
    transform-origin: initial;
    display: flex !important;
    flex-direction: column;
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
  }

  .nextprev-btn {
    display: none;
  }

  .back-profile {
    display: none;
  }

  .profile-page img {
    max-width: 150px;
  }

  .profile-page h1 {
    font-size: 2rem;
    text-align: center;
  }

  .profile-page h3 {
    font-size: 1.2rem;
    text-align: center;
  }

  .btn {
    width: 8rem;
    height: 2.5rem;
    font-size: 0.9rem;
    margin: 0.5rem;
  }

  .services-box .services-content {
    flex: 1 1 100%;
  }

  .skills-content .content span {
    width: 5rem;
    height: 4rem;
  }

  .skills-content .content span i {
    font-size: 2.5rem;
  }

  .portfolio-box .img-box {
    height: 12rem;
  }
}

/* Small tablets */
@media screen and (max-width: 768px) {
  .wrapper {
    padding: 0.5rem;
  }

  .book .book-page {
    padding: 1.5rem;
    min-height: 400px;
  }

  .book-page .page-front,
  .book-page .page-back {
    padding: 1.5rem;
    min-height: 350px;
  }

  .profile-page img {
    max-width: 120px;
  }

  .profile-page h1 {
    font-size: 1.8rem;
  }

  .profile-page h3 {
    font-size: 1.1rem;
  }

  .profile-page p {
    font-size: 0.95rem;
  }

  .btn {
    width: 7rem;
    height: 2.3rem;
    font-size: 0.85rem;
    margin: 0.3rem;
  }

  .profile-page .btn-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .workeduc-content h3 {
    font-size: 1.2rem;
  }

  .workeduc-content p {
    font-size: 1rem;
  }

  .services-content h3 {
    font-size: 1rem;
  }

  .services-content p {
    font-size: 0.9rem;
  }

  .skills-content .content {
    justify-content: center;
  }

  .skills-content .content span {
    width: 4.5rem;
    height: 3.5rem;
    font-size: 0.8rem;
  }

  .skills-content .content span i {
    font-size: 2rem;
  }

  .portfolio-box .info-box .info-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .portfolio-box .btn-box {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .contact-box .field {
    font-size: 0.9rem;
    padding: 0.7rem;
  }

  .contact-box textarea {
    height: 12rem;
  }
}

/* Mobile phones */
@media screen and (max-width: 480px) {
  body {
    padding: 1rem 0.5rem;
  }

  .book .book-page {
    padding: 1rem;
    margin-bottom: 1.5rem;
    min-height: 350px;
  }

  .book-page .page-front,
  .book-page .page-back {
    padding: 1rem;
    min-height: 300px;
  }

  .profile-page img {
    max-width: 100px;
    margin-bottom: 0.5rem;
  }

  .profile-page h1 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
  }

  .profile-page h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .profile-page p {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .profile-page .social-media {
    margin: 0.4rem 0.5rem;
  }

  .profile-page .social-media a {
    width: 2rem;
    height: 2rem;
    font-size: 1.1rem;
    margin: 0 0.1rem;
  }

  .btn {
    width: 6.5rem;
    height: 2.2rem;
    font-size: 0.8rem;
    margin: 0.2rem;
  }

  .profile-page .btn-box {
    margin-top: 0.8rem;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .workeduc-box {
    margin-top: 1.5rem;
  }

  .workeduc-content {
    padding-left: 1.2rem;
    padding-bottom: 1rem;
  }

  .workeduc-content .year {
    font-size: 1rem;
  }

  .workeduc-content h3 {
    font-size: 1.1rem;
    margin: 0.2rem 0;
  }

  .workeduc-content p {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .services-box {
    gap: 1rem;
    margin-top: 1.5rem;
  }

  .services-content {
    padding: 0.6rem 0.4rem 0.8rem;
  }

  .services-content i {
    font-size: 2rem;
  }

  .services-content h3 {
    font-size: 0.95rem;
    margin: 0.3rem 0;
  }

  .services-content p {
    font-size: 0.85rem;
    line-height: 1.3;
  }

  .skills-box {
    gap: 1rem;
    margin-top: 1.5rem;
  }

  .skills-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .skills-content .content span {
    width: 4rem;
    height: 3rem;
    font-size: 0.75rem;
  }

  .skills-content .content span i {
    font-size: 1.8rem;
  }

  .portfolio-box {
    margin-top: 1.5rem;
  }

  .portfolio-box .img-box {
    height: 10rem;
  }

  .portfolio-box .info-box {
    margin: 0.8rem 0 1rem;
  }

  .portfolio-box .info-box .info-title h3 {
    font-size: 1.1rem;
  }

  .portfolio-box .info-box p {
    font-size: 0.85rem;
    line-height: 1.4;
  }

  .contact-box {
    margin-top: 1.5rem;
  }

  .contact-box .field {
    font-size: 0.85rem;
    padding: 0.6rem;
    margin-bottom: 1rem;
  }

  .contact-box textarea {
    height: 10rem;
  }

  .number-page {
    bottom: 0.5rem;
    font-size: 0.9rem;
  }
}

/* Very small mobile phones */
@media screen and (max-width: 320px) {
  .book .book-page {
    padding: 0.8rem;
  }

  .book-page .page-front,
  .book-page .page-back {
    padding: 0.8rem;
  }

  .profile-page h1 {
    font-size: 1.3rem;
  }

  .btn {
    width: 6rem;
    height: 2rem;
    font-size: 0.75rem;
  }

  .skills-content .content {
    gap: 0.5rem;
  }

  .skills-content .content span {
    width: 3.5rem;
    height: 2.8rem;
    font-size: 0.7rem;
  }

  .skills-content .content span i {
    font-size: 1.5rem;
  }
}
