/* Reset styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}

a {
  text-decoration: none;
  color: #0056b3;
}

a:hover {
  text-decoration: none; /* Remove default underline on hover */
}

ul {
  list-style: none;
}

/* Fade-in on scroll class */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Header styles */
header {
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  position: relative; /* Ensure positioning context for children */
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 45px;
  margin-right: 10px;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.1);
}

.logo h1 {
  font-size: 1.2rem;
  font-weight: normal;
  color: #333;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.nav-container {
  display: flex;
  align-items: center;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  margin-right: 15px;
  transition: transform 0.3s ease;
  position: absolute; /* Fix its position */
  right: 20px; /* Align with padding of header-container */
  top: 50%; /* Center vertically */
  transform: translateY(-50%); /* Adjust for vertical centering */
}

/* Toggle between hamburger and close icons */
.mobile-menu-toggle.active .hamburger-icon {
  display: none;
}

.mobile-menu-toggle.active .close-icon {
  display: inline-block;
}

/* Hide logo when menu is active */
.nav-menu.active ~ .logo {
  display: none;
}

/* Navigation menu base styles */
.nav-menu {
  flex-basis: 100%;
  order: 4;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-menu ul {
  display: flex;
  list-style: none;
}

.nav-menu li {
  margin-left: 30px;
  position: relative;
}

.nav-menu a {
  color: #333;
  font-size: 1rem;
  position: relative;
  transition: color 0.3s ease;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background-color: #0056b3;
  bottom: -4px;
  left: 0;
  transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-menu a.active {
  color: #0056b3;
}

.nav-menu a:hover {
  color: #0056b3;
}

/* Dropdown styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  right: 0;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown:hover .dropdown-content {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-content a {
  color: #333;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

.dropdown .fa-chevron-down {
  font-size: 0.8rem;
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.dropdown:hover .fa-chevron-down {
  transform: rotate(180deg);
}

/* Search styles */
.search-container {
  display: flex;
  align-items: center;
  margin-left: 20px;
  position: relative;
}

.search-icon {
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.search-icon:hover {
  transform: scale(1.2);
}

.search-input {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  width: 250px;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 10px;
  z-index: 100;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.search-input.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.search-input input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  outline: none;
}

.search-close {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 10px;
  color: #666;
  transition: color 0.3s ease;
}

.search-close:hover {
  color: #333;
}

/* Hero section styles */
.hero {
  position: relative;
  height: 400px;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hero:hover img {
  transform: scale(1.05);
}

.hero-text {
  position: absolute;
  font-family: "Bookman Old Style", Georgia, serif;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  background-color: rgba(0, 0, 0, 0.4);
}

.hero-text h2 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: #fff;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease forwards;
}

.hero-text p {
  font-size: 1.2rem;
  margin-bottom: 0px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease 0.3s forwards;
}

/* Keyframes for animations */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Main content styles */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
}

section {
  margin-bottom: 50px;
}

h2 {
  color: #0056b3;
  font-size: 1.8rem;
  margin-bottom: 20px;
  font-family: "Trebuchet MS", Tahoma, sans-serif;
}

/* Page title animation */
.page-title h2 {
  color: white;
  margin: 0;
  font-size: 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

/* Member category animation */
.member-category h3 {
  margin: 0;
  color: #333;
  opacity: 0;
  transform: translateX(-20px);
  animation: fadeInLeft 0.8s ease forwards;
}

h3 {
  font-size: 1.4rem;
  margin-bottom: 15px;
}

p {
  margin-bottom: 10px;
}

.bold {
  font-weight: bold;
}

/* News section styles */
.news-item {
  margin-bottom: 0px;
  padding: 5px 0;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: calc(0.1s * var(--news-index, 0));
}

.news-item a {
  margin-left: 5px;
}

/* Address section styles */
.address-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.address-info p {
  margin-bottom: 5px;
}

.map {
  width: 100%;
  height: 300px;
  border-radius: 5px;
  overflow: hidden;
}

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Footer styles */
footer {
  background-color: #f8f9fa;
  text-align: center;
  padding: 30px 20px;
  margin-top: 50px;
}

.social-icons {
  margin-bottom: 20px;
}

.social-icons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-color: #666;
  color: white;
  border-radius: 4px;
  margin: 0 5px;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  animation-delay: calc(0.1s * var(--social-index, 0));
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.social-icons a:hover {
  background-color: #444;
  transform: scale(1.1) rotate(5deg);
}

/* Simple footer for other pages */
.simple-footer {
  background-color: white;
  text-align: center;
  padding: 20px;
  margin-top: 50px;
  border-top: 1px solid #eee;
}

.simple-footer p {
  color: #666;
  font-size: 0.9rem;
}

/* Page title styles */
.page-title {
  background-color: #0a6e8a;
  color: white;
  padding: 20px 0;
  text-align: center;
  margin-bottom: 40px;
}

/* Content container */
.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* Open Positions page styles */
.positions-content {
  max-width: 900px;
  margin: 0 auto;
}

.positions-content p {
  margin-bottom: 30px;
  font-size: 1.1rem;
  line-height: 1.8;
}

.research-areas {
  list-style-type: square;
  margin-left: 30px;
  font-size: 1.1rem;
  line-height: 2;
}

.research-areas li {
  margin-bottom: 15px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: calc(0.1s * var(--area-index, 0));
}

/* Other Members page styles */
.members-section {
  margin-bottom: 40px;
}

.section-subtitle {
  color: #0a6e8a;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.member-list {
  list-style-type: square;
  margin-left: 30px;
  font-size: 1.1rem;
  line-height: 1.8;
}

.member-list li {
  margin-bottom: 15px;
}

/* Collaborators page styles */
.collaborators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 40px;
}

.collaborator {
  margin-bottom: 40px;
  text-align: center;
}

.collaborator h3 {
  margin-bottom: 15px;
  color: #333;
  text-align: center;
}

.collaborator img {
  width: 100%;
  max-width: 300px;
  height: 250px;
  margin-bottom: 15px;
  border-radius: 5px;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.collaborator img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.collaborator-info p {
  margin-bottom: 5px;
  font-size: 1rem;
}

/* Gallery page styles */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 20px;
}

.gallery-item img {
  width: 100%;
  height: 300px;
  border-radius: 5px;
  object-fit: cover;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Core Members page styles */
.faculty-member {
  display: flex;
  margin-bottom: 40px;
}

.faculty-photo {
  flex: 0 0 200px;
  margin-right: 30px;
}

.faculty-photo img {
  max-width: 250px;
  height: 250px;
  border-radius: 5px;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faculty-photo img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.faculty-info h3 {
  margin-bottom: 10px;
  color: #333;
}

.faculty-info p {
  margin-bottom: 5px;
}

.social-links {
  display: flex;
  margin-top: 15px;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.social-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background-color: #f0f0f0;
  border-radius: 4px;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  animation-delay: calc(0.1s * var(--social-index, 0));
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.social-icon-link:hover {
  transform: scale(1.2) rotate(5deg);
  background-color: #e0e0e0;
}

.social-icon-link img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  border-radius: 0;
  text-align: center;
}

.member-category {
  background-color: #f0f0f0;
  padding: 10px 20px;
  margin-bottom: 20px;
}

.student-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.student-member {
  text-align: center;
}

.student-member h4 {
  margin-bottom: 15px;
  color: #333;
}

.student-member .profile-img {
  width: 100%;
  max-width: 200px;
  height: 200px;
  border-radius: 5px;
  margin-bottom: 5px;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.student-member .profile-img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.student-member .social-links {
  justify-content: center;
  margin-top: 0px;
}

.former-member {
  display: flex;
  margin-bottom: 40px;
}

.former-member-photo {
  flex: 0 0 200px;
  margin-right: 30px;
}

.former-member-photo img {
  width: 100%;
  max-width: 250px;
  height: 250px;
  border-radius: 5px;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.former-member-photo img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.former-member-info h3 {
  margin-bottom: 10px;
  color: #333;
}

.former-member-info ul {
  list-style-type: none;
  margin-bottom: 15px;
}

.former-member-info ul li {
  margin-bottom: 5px;
}

.current-position {
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 5px;
}

/* Social media icons */
.social-icons-container {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.social-icon {
  width: 30px;
  height: 30px;
}

/* Ensure nav-menu is visible by default in desktop view */
@media (min-width: 769px) {
  .nav-menu {
    display: block; /* Always visible in desktop */
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
    position: relative; /* Ensure positioning context */
  }

  .mobile-menu-toggle {
    display: block;
    order: 3;
  }

  .nav-menu {
    display: none; /* Hidden by default in mobile */
    opacity: 0;
    transform: translateY(-10px);
    flex-basis: 100%;
    order: 4;
  }

  .nav-menu.active {
    padding: 50px;
    display: block;
    opacity: 1;
    transform: translateY(0);
    position: absolute; /* Position absolutely to avoid layout shifts */
    top: 100%; /* Place below header */
    left: 0;
    width: 100%;
    background-color: white; /* Match header background */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Match header shadow */
    z-index: 99; /* Ensure it appears below header but above content */
  }

  .nav-menu ul {
    flex-direction: column;
  }

  .nav-menu li {
    margin: 10px 0;
    margin-left: 0;
  }

  .dropdown-content {
    position: static;
    box-shadow: none;
    padding-left: 20px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .dropdown.active .dropdown-content {
    display: block;
    opacity: 1;
  }

  .hero-text h2 {
    font-size: 2rem;
    color: #fff;
  }

  .hero-text p {
    font-size: 1rem;
    color: #fff;
  }

  .address-container {
    grid-template-columns: 1fr;
  }

  .faculty-member,
  .former-member {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .faculty-photo,
  .former-member-photo {
    margin-right: 0;
    margin-bottom: 20px;
  }

  .former-member .social-links,
  .faculty-member .social-links {
    justify-content: center;
    margin-top: 0px;
  }

  .collaborators-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .search-input {
    width: 200px;
  }
}
