@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap");
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&display=swap');

/* ===================== RESET ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  outline: none;
  border: none;
  text-transform: capitalize;
  transition: all 0.3s ease;
}

html {
  font-size: 62.5%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  background: #f0f6ff;
  font-family: 'Poppins', sans-serif;
}

*::selection {
  background: #0066ff;
  color: #fff;
}

/* ===================== SCROLLBAR ===================== */
html::-webkit-scrollbar {
  width: 0.8rem;
}

html::-webkit-scrollbar-track {
  background: #e8f0fe;
}

html::-webkit-scrollbar-thumb {
  background: #0066ff;
  border-radius: 4px;
}

/* ===================== NAVBAR ===================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.7rem 10%;
  height: 6.5rem;
  background-color: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 102, 255, 0.1);
  border-bottom: 2px solid #e8f0fe;
}

section {
  min-height: 100vh;
  padding: 2rem 9%;
}

.heading {
  font-size: 3.5rem;
  color: rgb(32, 32, 32);
  font-weight: 800;
  text-align: center;
}

.heading span {
  color: #0066ff;
}

header .logo {
  font-size: 1.9rem;
  font-weight: 800;
  text-decoration: none;
  color: #0e2431;
}

header .logo .logo-avatar {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  transition: transform 0.3s ease;
}

header .logo:hover .logo-avatar {
  transform: scale(1.1);
}

header .logo:hover {
  color: #0066ff;
}


header .navbar ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

header .navbar li {
  margin-left: 2.5rem;
}

header .navbar ul li a {
  font-size: 1.57rem;
  color: #0e2431;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.04rem;
  transition: 0.2s;
}

header .navbar ul li a.active,
header .navbar ul li a:hover {
  color: #0066ff;
  border-bottom: 0.2rem solid #0066ff;
  padding: 0.5rem 0;
}

/* ===================== HAMBURGER ===================== */
#menu {
  font-size: 3rem;
  cursor: pointer;
  color: rgb(24, 2, 63);
  display: none;
}

@media (max-width: 768px) {
  #menu {
    display: block;
  }

  header .navbar {
    position: fixed;
    top: 6.5rem;
    right: -120%;
    width: 75%;
    height: 100%;
    text-align: left;
    align-items: flex-start;
    background-color: #0052cc;
  }

  header .navbar ul {
    flex-flow: column;
    padding: 1rem;
  }

  header .navbar ul li {
    text-align: center;
    width: 100%;
    margin: 1rem 0;
    border-radius: 0.5rem;
    width: 26rem;
  }

  header .navbar ul li a {
    display: block;
    padding: 1rem;
    text-align: left;
    color: #fff;
    font-size: 2rem;
  }

  header .navbar ul li a.active,
  header .navbar ul li a:hover {
    padding: 1rem;
    color: #fff;
    border-radius: 0.5rem;
    border-bottom: 0.5rem solid #00c8ff;
  }

  .fa-times {
    transform: rotate(180deg);
  }

  header .navbar.nav-toggle {
    right: 0;
  }
}

/* ===================== WORK / PROJECTS SECTION ===================== */
.work {
  background: linear-gradient(135deg, #f0f6ff 0%, #e8f0fe 100%);
  margin-top: 5rem;
}

.work h2 {
  color: #001a4d;
  padding: 1rem;
}

.work .heading span {
  color: #0066ff;
}

/* --- Filter Buttons --- */
.work .button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem auto;
  width: 60%;
  justify-content: center;
  align-items: center;
}

.work .button-group .btn {
  outline: none;
  padding: 0.9rem 2rem;
  background: transparent;
  color: #0066ff;
  border: 1.5px solid #0066ff;
  border-radius: 3rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.4rem;
  font-family: 'Poppins', sans-serif;
  transition: all 0.25s ease;
}

.work .button-group .btn:hover {
  background-color: #0066ff;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 102, 255, 0.35);
}

.work .button-group .btn.is-checked {
  background-color: #0066ff;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 102, 255, 0.35);
}

/* --- Project Cards --- */
.work .box-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 2rem;
}

.work .box-container .grid-item {
  width: 380px;
  margin: 1rem;
}

.work .box-container .box {
  flex: 1 1 30rem;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 102, 255, 0.12);
  position: relative;
  overflow: hidden;
  height: 30rem;
  background: #fff;
  border: 1px solid #cce0ff;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.work .box-container .box:hover {
  box-shadow: 0 10px 30px rgba(0, 102, 255, 0.25);
  transform: translateY(-4px);
}

.work .box-container .box img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.work .box-container .box:hover img {
  transform: scale(1.05);
}

.work .box-container .box .content {
  height: 75%;
  width: 100%;
  position: absolute;
  top: 85%;
  left: 0;
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(4px);
  overflow: hidden;
}

/* Card Tag Bar */
.work .box-container .box .content .tag {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 4.5rem;
  width: 100%;
  padding-left: 1.2rem;
  background: linear-gradient(90deg, #0066ff, #0099ff);
  color: #fff;
}

.work .box-container .box .content .tag h3 {
  font-size: 1.8rem;
  color: #fff;
  font-weight: 700;
}

.work .box-container .box:hover .content {
  top: 25%;
}

/* Card Description */
.work .desc {
  margin: 1.2rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  overflow: hidden;
}

.work .desc p {
  font-size: 1.4rem;
  color: #334466;
  font-family: 'Nunito', sans-serif;
  text-transform: none;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Cố định chiều cao = 3 dòng: 1.4rem × 1.6 × 3 */
  height: 6.72rem;
  flex-shrink: 0;
}

.work .desc .btns {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
  flex-shrink: 0;
}

.work .desc .btns .btn {
  line-height: 0;
  display: inline;
  padding: 1.5rem 2.2rem;
  border-radius: 0.5rem;
  font-size: 1.4rem;
  font-weight: 600;
  color: #0066ff;
  background: #e8f0fe;
  border: 1.5px solid #0066ff;
}

.work .desc .btns .btn:hover {
  background: #0066ff;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

/* ===================== BACK TO HOME BUTTON ===================== */
.backbtn {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
  margin-top: 4rem;
}

.backbtn .btn {
  position: relative;
  line-height: 0;
  padding: 1.6rem 3rem;
  border-radius: 0.5em;
  transition: 0.3s;
  color: #fff;
  background: #0066ff;
  border: 2px solid #0066ff;
  box-shadow: 0px 5px 18px rgba(0, 102, 255, 0.4);
  text-align: center;
  font-weight: 700;
}

.backbtn .btn span {
  font-weight: 600;
  font-size: 1.7rem;
  font-family: 'Nunito', sans-serif;
}

.backbtn .btn i {
  margin-right: 0.5rem;
  font-size: 1.5rem;
  transition: 0.3s;
}

.backbtn .btn:hover {
  background: #fff;
  color: #0066ff;
  box-shadow: 0px 5px 18px rgba(0, 102, 255, 0.25);
}

.backbtn .btn:hover i {
  transform: translateX(-6px);
}

/* ===================== SCROLL TO TOP ===================== */
#scroll-top {
  position: fixed;
  top: -140%;
  right: 2rem;
  padding: 1rem 1.5rem;
  font-size: 2rem;
  background: #0066ff;
  color: #fff;
  border-radius: 5rem;
  transition: 1s linear;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
}

#scroll-top.active {
  top: calc(100% - 12rem);
}

#scroll-top:hover {
  background: #0052cc;
}

/* ===================== COMMON MEDIA QUERIES ===================== */
@media (max-width: 768px) {
  .work .button-group {
    width: 100%;
  }

  .work .box-container {
    margin: 1rem 0;
    gap: 1.5rem;
  }

  .work .box-container .grid-item {
    width: 45%;
    margin: 1rem auto;
  }
}

@media (max-width: 450px) {
  html {
    font-size: 55%;
  }

  body {
    padding-right: 0;
  }

  section {
    padding: 2rem;
  }

  .work .button-group {
    width: 100%;
  }

  .work .box-container {
    margin: 0;
  }

  .work .box-container .grid-item {
    width: 100%;
    margin: 1rem 0;
  }

  .work .box-container .grid-item .box {
    width: 95% !important;
    margin: 0 auto;
  }
}