/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Body */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.7;
  background-color: #f9f9f9;
  color: #333;
}

/* Profile Picture */
.profile-pic {
  width: 150px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid #004080;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  object-fit: cover;
}

/* Header */
header {
  background: linear-gradient(135deg, #004080, #0066cc);
  color: #fff;
  padding: 40px 50px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.header-container {
  display: flex;
  align-items: center;
  gap: 25px;
  flex-wrap: wrap; /* Allow header elements to stack on smaller screens */
}

.header-text h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
}

.header-text p {
  margin: 8px 0 0;
  font-size: 18px;
  max-width: 750px;
}

/* Navigation */
nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #003366;
  padding: 14px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

nav a {
  color: #fff;
  margin: 0 18px;
  text-decoration: none;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

nav a:hover {
  background: #ffd700;
  color: #003366;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.7);
}

/* Active nav highlight */
nav a.active {
  background: #ffd700;
  color: #003366;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
  font-weight: 600;
}

/* Sections */
section {
  padding: 70px 40px;
  max-width: 1100px;
  margin: auto;
}

section h2 {
  font-size: 30px;
  margin-bottom: 20px;
  color: #004080;
  text-align: center;
  position: relative;
  letter-spacing: 0.5px;
}

section h2::after {
  content: "";
  display: block;
  width: 70px;
  height: 3px;
  background: #004080;
  margin: 12px auto 0;
  border-radius: 2px;
}

section p {
  text-align: justify;
  font-size: 16px;
  color: #444;
}

/* Tables (Education + Experience unified style) */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

th, td {
  border: 1px solid #e0e0e0;
  padding: 12px 15px;
  text-align: left;
}

th {
  background-color: #004080;
  color: #fff;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

tr:hover {
  background-color: #f1f7ff;
  transition: background 0.3s ease;
}

/* === Social Media Icons === */
.social-icons {
  margin-top: 18px;
}

.social-icons a {
  display: inline-block;
  width: 45px;
  height: 45px;
  line-height: 45px;
  margin: 0 8px;
  border-radius: 50%;
  background: #0073e6;
  color: #fff;
  text-align: center;
  font-size: 20px;
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background: #005bb5;
  box-shadow: 0 0 18px rgba(0, 115, 230, 0.8);
  transform: translateY(-4px);
}

/* Footer Contact Section */
#contact {
  background: #003366;
  color: #fff;
  text-align: center;
  padding: 50px 20px;
  border-radius: 8px;
}

#contact h2 {
  color: #ffd700;
}

#contact p {
  font-size: 18px;
  color: #ffffff;
}

/* === Scroll Reveal Animations === */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Consistent staggered animations for children */
.reveal > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal.visible > *:nth-child(1) { transition-delay: 0.1s; }
.reveal.visible > *:nth-child(2) { transition-delay: 0.2s; }
.reveal.visible > *:nth-child(3) { transition-delay: 0.3s; }
.reveal.visible > *:nth-child(4) { transition-delay: 0.4s; }
.reveal.visible > *:nth-child(5) { transition-delay: 0.5s; }

/* === Projects Section === */
#projects {
  background: #f9f9f9;
}

.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.project-card {
  background: #fff;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px);
}

.project-card h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: #004080;
}

.project-card p {
  font-size: 1rem;
  color: #444;
  margin-bottom: 15px;
  line-height: 1.5;
  text-align: justify; /* ✅ Project descriptions justified */
}

/* === Swiper Styles for Project Media === */
.project-swiper {
  width: 100%;
  max-width: 600px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.project-swiper img,
.project-swiper video {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

/* Swiper navigation buttons */
.swiper-button-next,
.swiper-button-prev {
  color: #004080;
  font-weight: bold;
}

.swiper-pagination-bullet {
  background: #004080;
  opacity: 0.7;
}

.swiper-pagination-bullet-active {
  background: #ffd700;
  opacity: 1;
}

/* === Publications Section === */
#publications {
  max-width: 1000px;
  margin: auto;
  padding: 20px;
}

#publications h2,
#publications h3 {
  text-align: center;
}

#publications li {
  list-style-type: disc;
  margin-left: 20px;
  padding-left: 10px;
}

#publications li {
  margin-bottom: 12px;
  text-align: justify; /* ✅ Forces justified text */
}

/* === Footer === */
footer {
  text-align: center;
  background-color: #f8f9fa;
  color: #555;
  border-top: 1px solid #ddd;
  width: 100%;
}

/* === Media Queries for Mobile Responsiveness === */
@media screen and (max-width: 768px) {
  .header-container {
    flex-direction: column; /* Stack header elements */
    text-align: center;
  }

  .profile-pic {
    width: 120px; /* Smaller profile picture */
    height: 120px;
  }

  .header-text h1 {
    font-size: 28px; /* Adjust heading size */
  }

  .header-text p {
    font-size: 16px; /* Adjust paragraph font size */
    max-width: 90%; /* Adjust paragraph width */
  }

  nav {
    display: flex;
    flex-direction: column; /* Stack nav items */
    text-align: center;
  }

  nav a {
    margin: 10px 0; /* Space out navigation links */
    padding: 10px 20px;
  }

  section {
    padding: 40px 20px; /* Reduce padding */
  }

  section h2 {
    font-size: 26px; /* Smaller headings for mobile */
  }

  table th, table td {
    padding: 10px 12px; /* Adjust table padding */
    font-size: 14px; /* Adjust table font size */
  }

  .social-icons a {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  #contact {
    padding: 30px 20px; /* Adjust padding in contact section */
  }

  /* Project section mobile tweaks */
  .project-card {
    padding: 15px;
  }

  .project-card h3 {
    font-size: 1.2rem;
  }

  .project-card p {
    font-size: 0.95rem;
  }

  /* Swiper mobile fix */
  .project-swiper {
    max-width: 100%;
  }
}
