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

body {
  font-family: "Roboto", Arial, sans-serif;
  background: #fff;
  color: #1d3351;
  line-height: 1.6;
  min-height: 100vh; /* Keep for sticky footer */
  display: flex;
  flex-direction: column;
}

/* Header Section */
header {
  border-bottom: 2px solid #b7b7b7;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 16px;
  gap: 20px;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  height: 120px;
  width: auto;
  background: white;
  padding: 5px;
  border-radius: 10px;
  border: 1px solid #eaeaea;
  flex-shrink: 0; /* Prevents logo from shrinking */
}

.header-text {
  display: flex;
  flex-direction: column;
}

.researcher-name {
  font-size: 1.1rem;
  color: #2c3e50;
  font-weight: 600;
}

.university-name {
  font-size: 1.17rem;
  color: #2b4674;
  padding-top: 3px;
  font-weight: 500;
}

.group-name {
  font-size: 1.4rem;
  color: #822a1f;
  font-weight: 700;
  padding-top: 7px;
}

.profile-photo {
  height: 120px;
  width: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d5d5d5;
  flex-shrink: 0; /* Prevents photo from shrinking */
}

/* Navigation */
nav {
  background: #eef2f7;
  border-top: 1px solid #c7c7c7;
  border-bottom: 2px solid #b7b7b7;
}

.nav-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap; /* Allow nav items to wrap on smaller screens */
  gap: 15px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: #1d3557;
  font-weight: 500;
  font-size: 1rem; /* Corrected typo: "1 rem" -> "1rem" */
  padding: 11px 14px 7px 14px;
  display: inline-block;
  border-radius: 4px 4px 0 0;
  transition: background 0.14s;
}

.nav-link.active,
.nav-link:hover {
  background: #dff1ff;
  border-bottom: 3px solid #2b4674;
  color: #234978;
  padding-bottom: 4px;
}

/* Main Content */
main {
  flex-grow: 1; /* For sticky footer */
  width: 100%;
}

.section {
  display: none;
  max-width: 1120px;
  margin: 38px auto 24px auto;
  padding: 18px 24px;
  background: #fff;
}

.section.active {
  display: block;
  animation: fadeIn 0.35s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(35px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  font-family: "Playfair Display", serif;
  color: #2b4674;
  font-size: 1.5rem;
  border-left: 8px solid #234978;
  padding-left: 18px;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

/* Typography */
.text-primary {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.text-secondary {
  font-size: 1.025rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.text-small {
  font-size: 1rem;
}

.section-subtitle {
  color: #822a1f;
  font-size: 1.09rem;
  font-weight: 600;
  margin-bottom: 4px;
}

/* Layout Components */
.flex-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: center;
}

.flex-container-start {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: flex-start;
}

.flex-item {
  flex: 1;
  min-width: 300px;
}

.section-image {
  width: 380px;
  max-width: 100%;
  border: 1.5px solid #c1c8d9;
  border-radius: 8px;
}

.profile-image {
  width: 200px;
  height: 240px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #2b4674;
}

/* Member Cards */
.member-card {
  width: 220px;
  text-align: center;
  margin: 0 auto; /* Center card when container stacks */
}

.member-name {
  font-weight: 600;
  color: #234978;
  margin-top: 7px;
}

.member-details {
  font-size: 0.97em;
  margin-top: 5px;
}

.highlight-box {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin: 10px 0px;
  border-left: 4px solid #2b4674;
}

.opportunity-box {
  background: #fff3cd;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #ffc107;
  margin-top: 20px;
}

/* Contact Layout */
.contact-container {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.contact-section {
  flex: 1;
  min-width: 300px;
}

.contact-title {
  color: #2b4674;
  margin-bottom: 10px;
}

.contact-details {
  font-size: 1.025rem;
  line-height: 1.8;
}

footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  background-color: #dff1ff;
  border-top: 1px solid #ddd;
  font-size: 14px;
  color: #2b4674;
}

.content-list,
.project-list {
  padding-left: 22px;
  margin-bottom: 18px;
}

.content-list li,
.project-list li {
  margin-bottom: 8px;
  padding-left: 4px;
}

/* ========================================= */
/* =========== Responsive Design =========== */
/* ========================================= */

/* Tablet Styles (Screens up to 992px wide) */
@media (max-width: 992px) {
  .header-content {
    gap: 16px;
  }

  .logo {
    height: 90px;
  }

  .profile-photo {
    height: 90px;
    width: 90px;
  }

  .group-name {
    font-size: 1.2rem;
  }

  .university-name,
  .researcher-name {
    font-size: 1rem;
  }

  .nav-list {
    gap: 10px;
  }
}

/* Mobile Styles (Screens up to 767px wide) */
@media (max-width: 767px) {
  .header-container {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .header-content {
    flex-direction: column;
    order: 2; /* Puts text below the logo */
  }

  .profile-photo {
    order: 1; /* Puts profile photo at the top */
    height: 100px;
    width: 100px;
  }

  .logo {
    display: none; /* Hide the DYPIU logo to save space, assuming profile photo is enough */
  }

  .nav-list {
    gap: 6px 10px; /* row-gap, column-gap */
    padding: 5px 0;
  }

  .nav-link {
    padding: 8px 10px 5px 10px;
    font-size: 0.9rem;
  }

  .section {
    margin: 20px auto;
    padding: 15px;
  }

  .section-title {
    font-size: 1.3rem;
    padding-left: 12px;
    border-left-width: 6px;
    margin-bottom: 1.2rem;
  }

  .flex-container,
  .flex-container-start,
  .contact-container {
    flex-direction: column;
    gap: 25px;
  }

  .section-image,
  .profile-image {
    width: 100%;
    height: auto;
    max-width: 300px;
    margin: 0 auto;
  }

  footer {
    margin-top: 25px;
  }

  .news-box,
  .highlight-box,
  .opportunity-box {
    padding: 15px;
  }
}

//certificates
.certificate-gallery {
  max-width: 1120px;
  margin: 38px auto 24px auto;
  padding: 18px 24px;
  background: #fff;
}

.section-title {
  font-family: "Playfair Display", serif;
  color: #2b4674;
  font-size: 1.5rem;
  border-left: 8px solid #234978;
  padding-left: 18px;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.gallery-stats {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  border-left: 4px solid #2b4674;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #2b4674;
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
  margin-top: 5px;
}

.search-filter-bar {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

.search-input:focus {
  border-color: #2b4674;
}

.view-toggle {
  display: flex;
  border: 2px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.view-btn {
  padding: 10px 16px;
  background: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.view-btn.active {
  background: #2b4674;
  color: white;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.category-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #2b4674, #822a1f);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(43, 70, 116, 0.15);
  border-color: #2b4674;
}

.category-card:hover::before {
  transform: scaleX(1);
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.category-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2b4674;
  margin: 0;
}

.certificate-count {
  background: #2b4674;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.category-description {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 15px;
}

.category-preview {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.preview-item {
  width: 40px;
  height: 30px;
  background: #dee2e6;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #666;
}

.certificates-container {
  display: none;
  animation: fadeIn 0.3s ease;
}

.certificates-container.active {
  display: block;
}

.category-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.breadcrumb-btn {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #2b4674;
  transition: all 0.3s;
}

.breadcrumb-btn:hover {
  background: #2b4674;
  color: white;
}

.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.certificates-list {
  display: none;
  gap: 15px;
  flex-direction: column;
}

.certificate-card {
  background: white;
  border: 2px solid #f1f3f4;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.certificate-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #2b4674;
}

.certificate-image {
  width: 100%;
  height: 150px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.certificate-image::before {
  content: "📜";
  font-size: 3rem;
  opacity: 0.3;
}

.certificate-info {
  padding: 15px;
}

.certificate-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2b4674;
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.certificate-filename {
  font-size: 0.8rem;
  color: #666;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.certificate-list-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.certificate-list-item:hover {
  border-color: #2b4674;
  background: #f8f9fa;
}

.list-item-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #2b4674, #822a1f);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  margin-right: 15px;
  flex-shrink: 0;
}

.list-item-content {
  flex: 1;
}

.list-item-title {
  font-weight: 600;
  color: #2b4674;
  margin-bottom: 5px;
}

.list-item-filename {
  font-size: 0.85rem;
  color: #666;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  margin: 5% auto;
  padding: 20px;
  width: 90%;
  max-width: 800px;
  background: white;
  border-radius: 12px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #2b4674;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 5px;
  border-radius: 4px;
  transition: all 0.3s;
}

.close-btn:hover {
  background: #f8f9fa;
  color: #2b4674;
}

.modal-body {
  text-align: center;
}

.modal-certificate {
  max-width: 100%;
  max-height: 500px;
  border: 2px solid #eee;
  border-radius: 8px;
  margin-bottom: 15px;
}

.modal-info {
  text-align: left;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.no-results {
  text-align: center;
  padding: 50px 20px;
  color: #666;
}

.no-results-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 768px) {
  .certificate-gallery {
    margin: 20px auto;
    padding: 15px;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .gallery-stats {
    flex-direction: column;
    text-align: center;
  }

  .search-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .certificates-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }

  .modal-content {
    margin: 10% auto;
    width: 95%;
    padding: 15px;
  }

  .certificate-image {
    height: 120px;
  }
}

@media (max-width: 480px) {
  .certificates-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .certificate-info {
    padding: 10px;
  }

  .certificate-title {
    font-size: 0.85rem;
  }
}
