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

body {
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
}

.container {
  width: 90%;
  max-width: 900px;
  margin: auto;
  padding: 2rem 0;
}

header {
  background: #660000;
  color: #fff;
  padding: 2rem 0;
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 1rem; /* Add some space below header content before nav */
}

.left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-pic {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.uottawa-logo {
  width: 150px;
  height: auto;
  margin-top: 10px;
}

header h1 {
  font-size: 2.5rem;
}

/* Navigation Styles */
.main-nav {
  padding: 0.5rem 0;
  /* Ensure nav bar is full width and centered */
  width: 100%;
  text-align: center;
}

.main-nav .container {
  padding: 0; /* Reset container padding for the nav links */
  display: flex;
  justify-content: center; /* Center the links */
  align-items: center; /* Vertically align items */
  width: 100%; /* Ensure container takes full width of nav */
}

.nav-list {
  list-style: none;
  display: flex; /* Horizontal alignment for desktop */
  justify-content: center;
  width: 100%;
  margin: 0; /* Remove default margin */
  padding: 0; /* Remove default padding */
}

.nav-list li a {
  display: block; /* Make links fill the list item */
  color: #fff;
  text-decoration: none;
  padding: 1rem 1.5rem;
  transition: background-color 0.3s ease;
}

.nav-list li a:hover {
  background-color: #a00000; /* Lighter red on hover */
  text-decoration: none; /* Remove underline on hover for nav links */
}

.menu-toggle {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 0 1rem;
  /* Position the toggle button for mobile */
  position: absolute; /* Position relative to the main-nav */
  right: 1rem; /* Align to the right */
  top: 0.5rem; /* Adjust vertical position */
  z-index: 1000; /* Ensure it's above other content */
}


section h2 {
  margin-bottom: 1rem;
  font-size: 1.75rem;
  color: #800000;
}

.project-card {
  background: #fff;
  padding: 1rem;
  margin: 1rem 0;
  border-left: 5px solid #800000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

a {
  color: #800000;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

footer {
  background: #660000;
  color: white;
  text-align: center;
  padding: 1rem 0;
  margin-top: 2rem;
}

/* Collapsible Section Styles */
.collapsible-header {
  cursor: pointer; /* Indicate it's clickable */
  display: flex; /* Use flexbox to align text and icon */
  justify-content: space-between; /* Space out text and icon */
  align-items: center; /* Vertically align items */
  padding: 1rem 0; /* Add padding for visual separation */
  border-bottom: 1px solid #eee; /* Optional: adds a subtle line below the header */
  color: #800000; /* Match existing heading color */
  font-size: 1.75rem; /* Match existing heading size */
  margin-bottom: 0; /* Remove default h2 margin-bottom */
  transition: color 0.3s ease; /* Smooth color transition on hover */
}

.collapsible-header:hover {
  color: #a00000; /* Slightly lighter red on hover */
}

.collapse-icon {
  transition: transform 0.3s ease; /* Smooth rotation for the icon */
  font-size: 1.2rem; /* Adjust icon size */
  margin-left: 0.5rem; /* Space between text and icon */
}

/* Rotate icon when header is active (content is expanded) */
.collapsible-header.active .collapse-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0; /* Initially hidden by setting max-height to 0 */
  overflow: hidden; /* Hides any content that exceeds max-height */
  transition: max-height 0.5s ease-out, padding 0.5s ease-out; /* Smooth transition for max-height and padding */
  padding-top: 0; /* No padding when collapsed */
  padding-bottom: 0; /* No padding when collapsed */
}

/* When the 'active' class is added by JavaScript, expand the content */
.collapsible-content.active {
  /* Set max-height to a value large enough to contain all content.
     JavaScript will dynamically set this to scrollHeight for accuracy. */
  max-height: 1000px; /* Fallback/initial large value */
  padding-top: 1rem; /* Add padding back when open */
  padding-bottom: 1rem; /* Add padding back when open */
}


/* Responsive adjustments */
@media (max-width: 768px) { /* Adjust breakpoint as needed */
  .header-flex {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .left {
    flex-direction: column;
  }

  .uottawa-logo {
    margin-top: 1rem;
  }

  /* Mobile Navigation Styles */
  .main-nav {
    position: relative; /* Needed for absolute positioning of toggle button */
    padding: 0.5rem 0; /* Adjust padding for mobile nav */
    display: flex; /* Use flexbox for mobile nav */
    justify-content: flex-end; /* Push toggle to the right */
    align-items: center; /* Vertically center toggle */
  }

  .menu-toggle {
    display: block; /* Show hamburger on smaller screens */
    position: static; /* Reset position for flexbox alignment */
    margin-left: auto; /* Push to the right */
    order: 2; /* Place after nav-list in flex order */
  }

  .nav-list {
    flex-direction: column; /* Stack links vertically */
    display: none; /* Hidden by default on mobile, shown by JS */
    width: 100%;
    text-align: center;
    position: absolute; /* Position below the toggle button */
    top: 100%; /* Place right below the nav bar */
    left: 0;
    background: #800000; /* Match nav background */
    box-shadow: 0 5px 10px rgba(0,0,0,0.2); /* Add shadow for depth */
    z-index: 999; /* Ensure it's above other content but below toggle */
  }

  .nav-list.active {
    display: flex; /* Show when active */
  }

  .nav-list li {
    width: 100%;
  }

  .nav-list li a {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1); /* Separator for mobile links */
  }

  .nav-list li:last-child a {
    border-bottom: none; /* No border for the last link */
  }
}

@media (max-width: 600px) { /* Existing mobile styles */
  header h1 {
    font-size: 1.8rem;
  }

  section h2 {
    font-size: 1.4rem;
  }

  /* Adjust collapsible header font size for smaller screens */
  .collapsible-header {
    font-size: 1.4rem;
  }
}
