@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&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');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  outline: none;
  border: none;
  text-transform: capitalize;
  transition: all .2s linear;
}

html {
  font-size: 62.5%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

html::-webkit-scrollbar {
  width: .8rem;
}

html::-webkit-scrollbar-track {
  background: #a201ec;
}

html::-webkit-scrollbar-thumb {
  background: #7ebd12;
}

body {
  background: #000000;
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
}

*::selection {
  background: rgb(25, 254, 0);
  color: #fff;
}

/* ========== 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: rgba(83, 83, 85, 0.764);
  box-shadow: 0 1px 4px rgb(0, 255, 255);
}

section {
  min-height: 100vh;
  padding: 2rem 9%;
}

.heading {
  font-size: 3.5rem;
  color: rgb(8, 188, 243);
  font-weight: 800;
  text-align: center;
}

.heading span {
  color: rgb(213, 64, 10);
}

header .logo {
  font-size: 1.9rem;
  font-weight: 800;
  text-decoration: none;
  color: #ff0000;
}

header .logo i {
  font-size: 2.2rem;
}

header .logo:hover {
  color: hsl(175, 92%, 49%);
}

header .navbar ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

header .navbar li {
  margin-left: 2rem;
}

header .navbar ul li a {
  font-size: 1.57rem;
  color: #ffffff;
  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: #00eaff;
  border-bottom: 0.2rem solid #ffff01;
  padding: 0.5rem 0;
}

/* hamburger icon */
#menu {
  font-size: 3rem;
  cursor: pointer;
  color: rgb(0, 255, 242);
  display: none;
}

@media (max-width: 768px) {
  #menu {
    display: block;
  }
  header .navbar {
    position: fixed;
    top: 6.5rem;
    right: -100%;
    width: 75%;
    max-width: 30rem;
    height: 100%;
    text-align: center;
    align-items: flex-start;
    background-color: #0e0f31;
    overflow-y: auto;
    z-index: 999;
    transition: right 0.3s ease;
  }
  header .navbar ul {
    flex-flow: column;
    padding: 1rem;
    width: 100%;
  }
  header .navbar ul li {
    text-align: center;
    width: 100%;
    margin: 1rem 0;
    border-radius: 0.5rem;
    max-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 #011aff;
  }
  .fa-times {
    transform: rotate(180deg);
  }
  header .navbar.nav-toggle {
    right: 0;
  }
}

/* ========== WORK SECTION WITH PARTICLES ========== */
.work {
  min-height: 100vh;
  background: #000000;
  position: relative;
  overflow: hidden;
  padding: 8rem 2rem 5rem;
}

/* Animated Background Particles */
.work::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(0, 255, 255, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(138, 43, 226, 0.03) 0%, transparent 50%);
  pointer-events: none;
  animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Moving Particles Effect */
.work::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle, rgba(0, 217, 255, 0.8) 1px, transparent 1px),
    radial-gradient(circle, rgba(138, 43, 226, 0.8) 1px, transparent 1px);
  background-size: 50px 50px, 80px 80px;
  background-position: 0 0, 40px 40px;
  animation: particleMove 20s linear infinite;
  pointer-events: none;
  opacity: 0.15;
  z-index: 0;
}

@keyframes particleMove {
  0% {
    background-position: 0 0, 40px 40px;
  }
  100% {
    background-position: 50px 50px, 90px 90px;
  }
}

.work .heading {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
  margin-top: 2rem;
}

.work h2 {
  color: #00d9ff;
  text-shadow: 0 0 20px rgba(0, 217, 255, 0.5), 0 0 40px rgba(0, 217, 255, 0.3);
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.1) 0%, rgba(138, 43, 226, 0.1) 100%);
  padding: 2rem 3rem;
  border-radius: 1.5rem;
  display: inline-block;
  border: 2px solid rgba(0, 217, 255, 0.2);
  backdrop-filter: blur(10px);
  animation: headingGlow 3s ease-in-out infinite alternate;
}

@keyframes headingGlow {
  0% {
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3), 0 0 40px rgba(0, 217, 255, 0.2);
    border-color: rgba(0, 217, 255, 0.2);
  }
  100% {
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.5), 0 0 60px rgba(138, 43, 226, 0.3);
    border-color: rgba(138, 43, 226, 0.3);
  }
}

.work .heading span {
  color: #8a2be2;
  text-shadow: 0 0 20px rgba(138, 43, 226, 0.5), 0 0 40px rgba(138, 43, 226, 0.3);
  background: linear-gradient(90deg, #8a2be2, #00d9ff, #8a2be2);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

/* Filter Buttons */
#filters.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 3rem auto;
  max-width: 800px;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.button-group .btn {
  padding: 1.5rem 3rem;
  background: rgba(15, 15, 15, 0.95);
  color: #00d9ff;
  border: 2px solid rgba(0, 217, 255, 0.3);
  border-radius: 1.5rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.6rem;
  font-family: 'Poppins', sans-serif;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(10px);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.button-group .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d9ff, #8a2be2);
  transition: width 0.6s ease, height 0.6s ease;
  transform: translate(-50%, -50%);
  z-index: -1;
}

.button-group .btn:hover::before {
  width: 300px;
  height: 300px;
}

.button-group .btn:hover {
  color: #fff;
  border-color: #00d9ff;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 217, 255, 0.4);
}

.button-group .btn.is-checked {
  background: linear-gradient(135deg, #00d9ff, #8a2be2);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(0, 217, 255, 0.5);
  transform: scale(1.05);
}

/* Projects Container */
.work .box-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(35rem, 1fr));
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.work .box-container .grid-item {
  animation: fadeInScale 0.6s ease-out backwards;
}

.work .box-container .grid-item:nth-child(1) { animation-delay: 0.1s; }
.work .box-container .grid-item:nth-child(2) { animation-delay: 0.2s; }
.work .box-container .grid-item:nth-child(3) { animation-delay: 0.3s; }
.work .box-container .grid-item:nth-child(4) { animation-delay: 0.4s; }
.work .box-container .grid-item:nth-child(5) { animation-delay: 0.5s; }
.work .box-container .grid-item:nth-child(6) { animation-delay: 0.6s; }
.work .box-container .grid-item:nth-child(7) { animation-delay: 0.7s; }
.work .box-container .grid-item:nth-child(8) { animation-delay: 0.8s; }
.work .box-container .grid-item:nth-child(9) { animation-delay: 0.9s; }

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Project Box */
.work .box-container .box {
  position: relative;
  height: 40rem;
  border-radius: 2rem;
  overflow: hidden;
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(0, 217, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work .box-container .box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(0, 217, 255, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  z-index: 1;
}

.work .box-container .box:hover::before {
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.work .box-container .box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.05) 0%, rgba(138, 43, 226, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}

.work .box-container .box:hover::after {
  opacity: 1;
}

.work .box-container .box:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 217, 255, 0.3),
              0 0 0 1px rgba(0, 217, 255, 0.3),
              inset 0 0 30px rgba(0, 217, 255, 0.05);
  border-color: rgba(0, 217, 255, 0.4);
}

.work .box-container .box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: all 0.6s ease;
  position: relative;
  z-index: 1;
  padding: 2rem;
  background: transparent;
  max-height: 35rem;
}

.work .box-container .box:hover img {
  transform: scale(1.05);
  filter: brightness(0.7);
}

/* Content Overlay */
.work .box-container .box .content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.9) 50%, transparent 100%);
  padding: 2rem;
  transform: translateY(calc(100% - 8rem));
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 2;
}

.work .box-container .box:hover .content {
  transform: translateY(0);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.95) 70%, rgba(0, 0, 0, 0.85) 100%);
}

.work .box-container .box .content .tag {
  margin-bottom: 1.5rem;
  padding: 1.2rem;
  border-bottom: 2px solid rgba(0, 217, 255, 0.3);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
  backdrop-filter: blur(10px);
  border-radius: 1rem 1rem 0 0;
}

.work .box-container .box .content .tag h3 {
  font-size: 2.2rem;
  color: #00d9ff;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
  margin: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.work .box-container .box .content .tag h3::before {
  content: '';
  width: 4px;
  height: 2.2rem;
  background: linear-gradient(to bottom, #00d9ff, #8a2be2);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.work .box-container .box:hover .content .tag h3 {
  color: #00eaff;
  text-shadow: 0 0 20px rgba(0, 217, 255, 0.8);
  transform: translateX(5px);
}

.work .desc {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease 0.1s;
}

.work .box-container .box:hover .desc {
  opacity: 1;
  transform: translateY(0);
}

.work .desc p {
  font-size: 1.5rem;
  color: #e0e0e0;
  line-height: 1.8;
  margin-bottom: 2rem;
  font-family: 'Nunito', sans-serif;
  text-transform: none;
}

.work .desc .btns {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.work .desc .btns .btn {
  flex: 1;
  min-width: 12rem;
  padding: 1.2rem 2rem;
  border-radius: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.2) 0%, rgba(138, 43, 226, 0.2) 100%);
  border: 2px solid rgba(0, 217, 255, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-family: 'Nunito', sans-serif;
  backdrop-filter: blur(10px);
  text-transform: capitalize;
}

.work .desc .btns .btn i {
  transition: all 0.3s ease;
}

.work .desc .btns .btn:hover {
  background: linear-gradient(135deg, #00d9ff 0%, #8a2be2 100%);
  border-color: #00d9ff;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 217, 255, 0.4);
}

.work .desc .btns .btn:hover i {
  transform: scale(1.2);
}

/* Floating Animation */
@keyframes projectFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.work .box-container .box:nth-child(odd) {
  animation: projectFloat 4s ease-in-out infinite;
}

.work .box-container .box:nth-child(even) {
  animation: projectFloat 4s ease-in-out infinite 0.5s;
}

/* Back Button */
.backbtn {
  display: flex;
  justify-content: center;
  margin: 5rem auto 3rem;
  position: relative;
  z-index: 2;
}

.backbtn .btn {
  padding: 1.8rem 4rem;
  border-radius: 1.5rem;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.2) 0%, rgba(138, 43, 226, 0.2) 100%);
  border: 2px solid rgba(0, 217, 255, 0.4);
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 217, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.backbtn .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d9ff 0%, #8a2be2 100%);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: -1;
}

.backbtn .btn:hover::before {
  width: 300%;
  height: 300%;
}

.backbtn .btn span {
  font-family: "Nunito", sans-serif;
  position: relative;
  z-index: 1;
  text-transform: capitalize;
}

.backbtn .btn i {
  font-size: 1.8rem;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.backbtn .btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 50px rgba(0, 217, 255, 0.5);
  border-color: #00d9ff;
}

.backbtn .btn:hover i {
  transform: translateX(-10px);
  animation: arrowBounce 0.6s ease infinite;
}

@keyframes arrowBounce {
  0%, 100% {
    transform: translateX(-10px);
  }
  50% {
    transform: translateX(-15px);
  }
}

/* Scroll Top Button */
#scroll-top {
  position: fixed;
  top: -140%;
  left: 2rem;
  padding: 1rem 1.5rem;
  font-size: 2rem;
  background: linear-gradient(to bottom, #ff00ea, #2706ff);
  color: rgb(255, 255, 255);
  border-radius: 50%;
  transition: 1s linear;
  z-index: 999;
  box-shadow: 0 5px 15px rgba(0, 217, 255, 0.5);
}

#scroll-top.active {
  top: calc(100% - 12rem);
}

#scroll-top:hover {
  background: linear-gradient(to bottom, #00d9ff, #8a2be2);
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 217, 255, 0.7);
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
  .work .box-container {
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 2.5rem;
  }
}

@media screen and (max-width: 768px) {
  .work {
    padding: 6rem 1rem 3rem;
  }
  
  .work .box-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1rem;
  }
  
  .work .box-container .box {
    height: 40rem;
  }
  
  .work h2 {
    font-size: 2.8rem;
    padding: 1.5rem 2rem;
  }
  
  .button-group .btn {
    padding: 1.2rem 2rem;
    font-size: 1.4rem;
  }
  
  .work .desc .btns {
    flex-direction: column;
  }
  
  .work .desc .btns .btn {
    width: 100%;
  }
}

@media screen and (max-width: 600px) {
  .work .box-container .box {
    height: 38rem;
  }
  
  .work .box-container .box .content {
    padding: 1.5rem;
    transform: translateY(calc(100% - 7rem));
  }
  
  .work .box-container .box .content .tag h3 {
    font-size: 1.8rem;
  }
  
  .work .desc p {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
  }
  
  .work .desc .btns .btn {
    padding: 1rem 1.5rem;
    font-size: 1.3rem;
  }
  
  .backbtn .btn {
    padding: 1.5rem 3rem;
    font-size: 1.6rem;
  }
  
  .work h2 {
    font-size: 2.4rem;
    padding: 1.2rem 1.5rem;
  }
}

@media screen and (max-width: 450px) {
  html {
    font-size: 55%;
  }
  
  .work {
    padding: 5rem 0.5rem 2rem;
  }
  
  .work .box-container {
    padding: 0.5rem;
    gap: 1.5rem;
  }
  
  .work .box-container .box {
    height: 35rem;
    border-radius: 1.5rem;
  }
  
  .work .box-container .box .content .tag h3 {
    font-size: 1.6rem;
  }
  
  .work .desc p {
    font-size: 1.2rem;
  }
  
  .work h2 {
    font-size: 2rem;
    padding: 1rem 1.2rem;
  }
  
  .work .heading {
    margin-bottom: 2rem;
    margin-top: 1rem;
  }
  
  .backbtn {
    margin: 3rem auto 2rem;
  }
  
  .button-group .btn {
    padding: 1rem 1.5rem;
    font-size: 1.3rem;
  }
}

@media (max-width: 450px) {
  section {
    padding: 2rem;
  }
}