/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans&family=Poppins:wght@700&display=swap');

/* 
  Base Reset and Typography 
*/
*,
*::before,
*::after {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0; 
  font-family: 'Open Sans', sans-serif;
  background-color: #0f2027; /* fallback */
  color: #eee;
  line-height: 1.6;
  min-height: 100vh;
}

/* Scrollbar Styling (optional modern) */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #1f2a38;
}
::-webkit-scrollbar-thumb {
  background-color: #6a11cb;
  border-radius: 20px;
  border: 2px solid #1f2a38;
}

/* Utility Classes */
.container {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================
   1. NAVBAR
=========================== */

nav {
  position: sticky;
  top: 0;
  background: rgba(15,32,39,0.95);
  backdrop-filter: saturate(180%) blur(10px);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(15,32,39,0.8);
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0.5rem 1rem;
}

nav ul li {
  margin: 0 1.2rem;
}

nav ul li a {
  color: #eee;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
  color: #ff0080; /* vibrant pink accent */
}

/* Underline animation */
nav ul li a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 3px;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, #6a11cb, #ff0080);
  transition: width 0.3s ease;
  border-radius: 10px;
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}

/* ==========================
   2. HOME SECTION (Hero Banner)
=========================== */

.home-hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 1rem;
  /* Gradient Background Animation */
  background: linear-gradient(-45deg, #0f2027, #203a43, #6a11cb, #ff0080);
  background-size: 800% 800%;
  animation: gradientShift 25s ease infinite;
  color: #56fc24;
}

.home-hero h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 3.5rem;
  margin-bottom: 0.3rem;
  opacity: 0;
  animation: fadeUp 1.2s ease forwards 0.3s;
}

.home-hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  font-weight: 600;
  opacity: 0;
  animation: fadeUp 1.2s ease forwards 0.7s;
  color: #ffbbe3;
}

.home-hero .btn-group {
  opacity: 0;
  animation: fadeUp 1.2s ease forwards 1.1s;
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.home-hero .btn {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  background: #ff0080;
  color: white;
  box-shadow: 0 5px 15px rgba(255,0,128,0.5);
  transition: background 0.3s ease, transform 0.3s ease;
  text-decoration: none;
}

.home-hero .btn:hover,
.home-hero .btn:focus {
  background: #6a11cb;
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(106,17,203,0.75);
  outline: none;
}

/* Gradient Background Shift Animation Keyframes */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Fade Up Animation for entrance */
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(25px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================
   3. ABOUT SECTION
=========================== */

.about-section {
  background: #121a2a;
  padding: 4rem 1rem;
  text-align: center;
}

.about-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.about-photo {
  flex: 1 1 250px;
  max-width: 250px;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid #6a11cb;
  box-shadow: 0 0 20px rgba(106,17,203, 0.5);
  cursor: pointer;
  transition: transform 0.5s ease;
}

.about-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.about-photo:hover,
.about-photo:focus {
  transform: scale(1.1);
  outline: none;
}

/* Bio + education */
.about-text {
  flex: 2 1 500px;
  color: #ccc;
  text-align: left;
  font-size: 1.1rem;
}

.about-text h2 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #ff0080;
}

.about-text p {
  margin-bottom: 0.8rem;
}

.education-list {
  margin-top: 1rem;
  color: #bbb;
  list-style-type: square;
  padding-left: 1.3rem;
}

/* Social media icon container */
.social-icons {
  margin-top: 2rem;
  display: flex;
  gap: 1.5rem;
  justify-content: flex-start;
}

.social-icons a {
  color: #ddd; /* base */
  font-size: 1.8rem;
  transition: transform 0.3s ease, color 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-icons a:hover,
.social-icons a:focus {
  color: #ff0080;
  transform: scale(1.15);
  outline: none;
}

/* ==========================
   4. PROJECTS SECTION
=========================== */

.projects-section {
  background: #0f2027;
  padding: 4rem 1rem;
  color: #eee;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Glassmorphism Card */
.project-card {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  color: #eee;
  padding: 1.8rem 1.6rem 3.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  cursor: default;
  overflow: hidden;
  perspective: 700px;
}

.project-card:hover,
.project-card:focus-within {
  transform: rotateY(7deg) rotateX(3deg);
  box-shadow: 0 15px 40px rgba(255,0,128,0.5);
  outline: none;
}

.project-card img {
  width: 100%;
  border-radius: 15px;
  margin-bottom: 1rem;
  object-fit: cover;
  height: 180px;
  user-select: none;
}

/* Title and Description */
.project-card h3 {
  font-family: 'Poppins', sans-serif;
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
  color: #ff0080;
}

.project-card p {
  flex-grow: 1;
  font-size: 1rem;
  color: #ddd;
  line-height: 1.3;
}

/* Buttons hidden initially */
.project-buttons {
  display: flex;
  gap: 1rem;
  position: absolute;
  bottom: 1.8rem;
  width: calc(100% - 3.2rem);
  transform: translateY(40px);
  opacity: 0;
  transition: all 0.4s ease;
  justify-content: center;
}

/* Slide-in animation triggered on hover */
.project-card:hover .project-buttons,
.project-card:focus-within .project-buttons {
  transform: translateY(0);
  opacity: 1;
}

/* Project buttons */
.project-buttons a {
  background: linear-gradient(90deg, #6a11cb, #ff0080);
  padding: 0.5rem 1.4rem;
  border-radius: 50px;
  color: white;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(106,17,203,0.6);
  transition: background 0.3s ease, transform 0.3s ease;
  font-size: 1rem;
  user-select: none;
}

.project-buttons a:hover,
.project-buttons a:focus {
  background: linear-gradient(90deg, #ff0080, #6a11cb);
  transform: scale(1.1);
  outline: none;
}

/* ==========================
   5. SKILLS SECTION
=========================== */

.skills-section {
  background: #121a2a;
  padding: 4rem 1rem;
  color: #ddd;
  text-align: center;
}

.skills-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2.2rem;
  justify-content: center;
}

.skill {
  flex: 1 1 250px;
  background: rgba(255,255,255,0.1);
  border-radius: 15px;
  padding: 1rem 1.5rem;
  user-select: none;
  box-shadow: 0 0 15px rgba(106,17,203,0.4);
}

/* Skill Icons */
.skill-icon {
      display: flex;
      gap: 8px;
      align-items: center;
      justify-content: center;
      margin-bottom: 10px;
    }

    .skill-icon img {
      width: 40px;
      height: 40px;
      object-fit: contain;
    }

    /* Card hover pop effect */
    .skill {
      background: rgba(255, 255, 255, 0); /* keep original style */
      border-radius: 12px;
      transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .skill:hover {
      transform: scale(1.08); /* pop up effect */
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* add shadow */
    }

/* Skill name heading */
.skill h4 {
  margin-bottom: 0.8rem;
  font-family: 'Poppins', sans-serif;
}

/* Skill bar (background and fill) */
.skill-bar-bg {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  width: 0; /* animated via JS */
  background: linear-gradient(90deg, #6a11cb, #ff0080);
  border-radius: 10px;
  transition: width 2s ease;
}

/* Animated skill bar fill triggered by JS adds class 'fill' */
.skill-bar-fill.fill {
  width: var(--skill-level);
}

/* Icons fade rotate in triggered by JS adds class 'active' */
.skill-icon.active {
  opacity: 1;
  transform: rotate(0deg);
}

/* ==========================
   6. CONTACT SECTION
=========================== */

.contact-section {
  background: #0f2027;
  padding: 4rem 1rem;
  color: #eee;
  text-align: center;
}

.contact-form-wrapper {
  max-width: 600px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 0 25px rgba(255,0,128,0.4);
}

/* FORM */
form {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

/* Floating labels container */
.form-group {
  position: relative;
  width: 100%;
}

/* Inputs & Textarea */
input[type=text], input[type=email], textarea {
  width: 100%;
  padding: 1.1rem 1rem 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #eee;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.25);
  outline-offset: 0;
  transition: box-shadow 0.3s ease, background 0.3s ease;
  resize: vertical;
  height: 42px;
}

textarea {
  min-height: 100px;
  padding-top: 1.1rem;
}

/* Focus */
input[type=text]:focus, input[type=email]:focus, textarea:focus {
  background: rgba(255,255,255,0.18);
  box-shadow: 0 0 12px #ff0080;
  outline: none;
}

/* Floating Labels */
label {
  position: absolute;
  pointer-events: none;
  top: 1rem;
  left: 1rem;
  color: #bbb;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-weight: 600;
  user-select: none;
}

/* Move label up if input is focused or filled */
input[type=text]:focus + label,
input[type=email]:focus + label,
textarea:focus + label,
input[type=text]:not(:placeholder-shown) + label,
input[type=email]:not(:placeholder-shown) + label,
textarea:not(:placeholder-shown) + label {
  top: -0.5rem;
  left: 1rem;
  font-size: 0.8rem;
  color: #ff0080;
  background-color: #0f2027;
  padding: 0 0.35rem;
  border-radius: 5px;
}

/* Error messages */
.error-message {
  font-size: 0.85rem;
  color: #ff4d4d;
  margin-top: 0.3rem;
  text-align: left;
}

/* Submit button */
button[type="submit"] {
  padding: 0.8rem 2.5rem;
  border-radius: 30px;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  background: linear-gradient(90deg, #6a11cb, #ff0080);
  color: white;
  box-shadow: 0 0 15px #ff0080;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  user-select: none;
}

button[type="submit"]:hover,
button[type="submit"]:focus {
  box-shadow: 0 0 30px #ff0080;
  transform: scale(1.05);
  outline: none;
}

/* ==========================
   7. RESPONSIVENESS
=========================== */

@media (max-width: 768px) {
  /* Navbar stacked */
  nav ul {
    flex-wrap: wrap;
  }

  .about-content {
    flex-direction: column;
    justify-content: center;
  }

  .about-text {
    text-align: center;
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .skills-container {
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .home-hero h1 {
    font-size: 2.6rem;
  }

  .home-hero p {
    font-size: 1rem;
  }

  .skill {
    flex: 1 1 100%;
  }
}