/* CSS Variables */
:root {
  --primary-color: #6a0dad;
  --primary-hover: #500b76;
  --secondary-bg: #f9f6ff;
  --body-bg: #fdfdfd;
  --text-color: #333;
  --heading-color: #111;
  --white-color: #fff;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
}

/* Reset + General */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--body-bg);
  color: var(--text-color);
  line-height: 1.7;
}

/* Reusable Components */
section {
  padding: 80px 10%;
}
.section-title {
  text-align: center;
  font-size: 32px;
  margin-bottom: 40px;
  color: var(--heading-color);
  position: relative;
}
.section-title::after {
  content: '';
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}
.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--primary-color);
  color: var(--white-color);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s, transform 0.3s;
  box-shadow: 0 4px 10px rgba(106, 13, 173, 0.3);
}
.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
}

/* Navbar */
header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  color: var(--text-color);
  padding: 15px 10%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
header .logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}
header nav ul {
  display: flex;
  list-style: none;
}
header nav ul li {
  margin-left: 30px;
}
header nav ul li a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  padding-bottom: 5px;
}
header nav ul li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s;
}
header nav ul li a:hover::after {
  width: 100%;
}

/* Hero Section */
.hero {
  position: relative; /* Needed for absolute positioning of children */
  display: flex; /* Kept for hero-content layout */
  justify-content: center;
  align-items: center;
  min-height: 90vh;
  background: var(--secondary-bg); /* Still set for fallback */
  overflow: hidden; /* Important to contain particles */
}

/* Particles container */
#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1; /* Behind content */
  background-color: var(--secondary-bg); /* Background color for particles area */
}

/* Content over particles */
.hero-content {
    position: relative; /* Create new stacking context */
    z-index: 2; /* On top of particles */
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px; /* Adjust as needed */
    width: 100%;
    padding: 0 10%; /* Matches section padding for consistency */
}

.hero-text {
  max-width: 55%;
}
.hero-text h1 {
  font-size: 48px;
  color: var(--heading-color);
  font-weight: 700;
}
.hero-text h2 {
  font-size: 28px;
  margin: 10px 0;
  color: var(--primary-color);
}
.hero-text p {
  font-size: 18px;
  margin-bottom: 30px;
}
.hero-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
}
.social-icons a {
    color: var(--text-color);
    font-size: 24px;
    margin-right: 15px;
    transition: color 0.3s, transform 0.3s;
}
.social-icons a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}
.hero-img img {
  max-width: 350px;
  border-radius: 50%;
  border: 8px solid var(--white-color);
  box-shadow: var(--shadow);
}

/* About Section */
.about p {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 18px;
}

/* Skills Section */
.skills {
  background: var(--white-color);
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.skill-card {
  background: var(--secondary-bg);
  border-radius: var(--border-radius);
  padding: 25px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.skill-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}
.skill-card i {
  font-size: 40px;
  color: var(--primary-color);
  margin-bottom: 15px;
  display: block;
}

/* Projects Section */
.projects {
  background: var(--secondary-bg);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}
.project-card {
  background: var(--white-color);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.3s, box-shadow 0.3s;
}
.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.project-header h3 {
  color: var(--primary-color);
  margin: 0;
}
.project-header a {
  color: var(--text-color);
  font-size: 24px;
  transition: color 0.3s;
}
.project-header a:hover {
  color: var(--primary-color);
}

/* Achievements Section */
.achievements ul {
  list-style: none;
  margin: 40px auto 0;
  max-width: 800px;
  text-align: left;
}
.achievements li {
  margin: 15px 0;
  font-size: 17px;
  padding-left: 35px;
  position: relative;
}
.achievements li::before {
  content: '\f005'; /* Font Awesome star icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 2px;
  color: var(--primary-color);
  font-size: 20px;
}
.achievements a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}
.achievements a:hover {
    text-decoration: underline;
}

/* Contact Section */
.contact {
  text-align: center;
}
.contact p {
  max-width: 600px;
  margin: 0 auto 30px;
  font-size: 18px;
}
.contact .btn i {
    margin-left: 8px;
}

/* Footer */
footer {
  background: #222;
  color: #aaa;
  text-align: center;
  padding: 30px;
}
.footer-social-icons {
    margin-bottom: 15px;
}
.footer-social-icons a {
    color: #aaa;
    font-size: 22px;
    margin: 0 10px;
    transition: color 0.3s;
}
.footer-social-icons a:hover {
    color: var(--white-color);
}

/* --- Responsive Design --- */

/* Tablets */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    padding: 15px 5%;
  }
  header nav ul {
    margin-top: 10px;
  }
  header nav ul li {
    margin: 0 10px;
  }
  section {
    padding: 60px 5%;
  }
  .hero-content { /* Adjust for mobile */
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 40px;
  }
  .hero-text {
    max-width: 100%;
  }
  .hero-text h1 {
    font-size: 36px;
  }
  .hero-text h2 {
    font-size: 22px;
  }
  .hero-img img {
    max-width: 250px;
    margin-bottom: 30px;
  }
  .hero-buttons {
    justify-content: center;
  }
}
/* --- Certifications Section & Modal --- */

.certifications {
    background: var(--body-bg);
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.cert-item {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.cert-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.cert-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Modal styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    padding-top: 50px; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.85);
}

.modal-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 80%;
    max-height: 85vh;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
}

/* Mobile */
@media (max-width: 480px) {
  header nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  header nav ul li {
    margin: 5px 10px;
  }
  .section-title {
    font-size: 28px;
  }
  .hero-text h1 {
    font-size: 32px;
  }
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}
/* --- Secondary Button Style --- */

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 10px 28px; /* Adjusted padding for border */
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--white-color);
}