/* Force terminal container to always use flex layout */
.terminal {
    display: flex !important;
    flex-direction: column !important;
}

/* Ensure consistent width and alignment */
body, .terminal {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    /* max-width removed so background color extends full width */
}

/* Lock header and nav in place */
header, nav {
    width: 100% !important;
    /* max-width removed so background color extends full width */
}

/* Ensure nav container doesn't overflow */
.terminal-nav {
    margin: 0 auto;
    /* max-width removed so background color extends full width */
}

/* Prevent navbar shift when toggling theme */
/* Ensure the theme toggle area keeps a fixed width so showing/hiding .day-btn/.night-btn doesn't reflow the header */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    max-width: 2.6rem;
    position: relative;
    margin-left: 2.5rem !important; /* More horizontal gap from nav links */
    align-self: center;
}
.theme-toggle-inner {
    position: relative;
    width: 2.6rem;
    height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle-inner .night-btn,
.theme-toggle-inner .day-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.6rem;
    height: 2.6rem;
    margin: -1.3rem 0 0 -1.3rem; /* Center icon exactly */
    padding: 0;
    display: inline-block !important;
    line-height: 2.6rem;
    text-align: center;
    vertical-align: middle;
}
html:not([theme="dark"]) .day-btn {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
html[theme="dark"] .night-btn {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Fix nav bar shifting between day/night mode */
.terminal-menu ul {
    display: flex;
    align-items: center;
    /* Prevent space-between from causing nav to shift */
    justify-content: flex-start;
    gap: 1rem;
}

.terminal-menu > div {
    display: flex !important;
    align-items: center !important;
    width: 100%;
}

@media (max-width: 600px) {
  .terminal-menu > div {
    flex-direction: column !important;
    align-items: stretch !important;
    display: block !important;
    width: 100%;
  }
  .terminal-menu ul {
    display: block !important;
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
    padding: 0;
  }
  .terminal-menu ul > li {
    display: inline-block;
    margin: 0 0.5rem 0.5rem 0.5rem;
  }
  .theme-toggle {
    display: block !important;
    width: 100%;
    min-width: unset;
    max-width: unset;
    justify-content: center;
    margin: 0 !important;
    align-self: center;
    text-align: center;
  }
  .theme-toggle-inner {
    width: 2.6rem;
    height: 2.6rem;
    margin: 0 auto;
  }
}

u, .underline {
    text-decoration: underline !important;
}

/* Hamburger menu styles */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    z-index: 1000;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    margin: 3px 0;
    transition: 0.3s;
}

/* Show hamburger on mobile */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    nav.terminal-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--background-color, #000);
        padding: 20px;
        z-index: 999;
    }
    
    nav.terminal-menu.active {
        display: flex;
    }
    
    nav.terminal-menu ul {
        flex-direction: column;
    }
    
    nav.terminal-menu li {
        margin: 10px 0;
    }
}

/* Team member layout */
.team-member {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  align-items: flex-start;
}

.team-member img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.team-member-info {
  flex: 1;
}

.team-member-info h3 {
  margin-top: 0;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
  .team-member {
    flex-direction: column;
    align-items: flex-start;  /* Changed from center */
  }
  
  .team-member img {
    width: 120px;
    height: 120px;
    align-self: center;  /* Keep image centered */
    margin-bottom: 15px;
  }
  
  .team-member-info {
    text-align: left;  /* Force left alignment */
  }
}

.progress-pride-flag {
  height: 3em;  /* 1em Matches text height */
  width: auto;
  display: inline-block;
  vertical-align: middle;
  margin-left: 5px;
}

.disability-flag {
  height: 3em !important;
  width: auto !important;
  max-height: 3em !important;
  display: inline-block;
  vertical-align: middle;
  margin-left: 5px;
}

/* Back to top button */
.back-to-top {
  position: fixed !important;
  bottom: 30px !important;
  right: 30px !important;
  left: auto !important;
  background-color: var(--primary-color, #1a95e0) !important;
  color: var(--background-color, #fff) !important;
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 1000 !important;
  border: 2px solid currentColor !important;
  text-decoration: none !important;
  font-size: 24px !important;
  line-height: 1 !important;
  transition: opacity 0.3s !important;
  padding: 0 !important;
  margin: 0 !important;
}

.back-to-top:hover {
  opacity: 0.8 !important;
}

.back-to-top.show {
  display: flex !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px !important;
    right: 20px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 20px !important;
  }
}

/* Fade in animation for page content */
.container {
  animation: fadeIn 0.1s ease-in;
}

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

/* Ensure background colors extend full width */
html, body {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body {
  background-color: var(--background-color) !important;
  min-height: 100vh !important;
}

/* Keep content width constrained but background full */
.container {
  max-width: 60em !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Active page highlighting */
nav.terminal-menu a {
  position: relative;
  transition: color 0.2s;
}

/* Highlight current page */
nav.terminal-menu a[href="/"],
nav.terminal-menu a[href="/team"],
nav.terminal-menu a[href="/research"],
nav.terminal-menu a[href="/publications"],
nav.terminal-menu a[href="/join"] {
  /* Default state */
}

/* When on the page, add underline and/or color */
body[data-page="home"] nav.terminal-menu a[href="/"],
body[data-page="team"] nav.terminal-menu a[href="/team"],
body[data-page="research"] nav.terminal-menu a[href="/research"],
body[data-page="publications"] nav.terminal-menu a[href="/publications"],
body[data-page="join"] nav.terminal-menu a[href="/join"] {
  text-decoration: underline !important;
  font-weight: bold !important;
  color: var(--primary-color, #1a95e0) !important;
}

/* Mobile active state */
@media (max-width: 768px) {
  body[data-page="home"] nav.terminal-menu a[href="/"],
  body[data-page="team"] nav.terminal-menu a[href="/team"],
  body[data-page="research"] nav.terminal-menu a[href="/research"],
  body[data-page="publications"] nav.terminal-menu a[href="/publications"],
  body[data-page="join"] nav.terminal-menu a[href="/join"] {
    background-color: var(--primary-color, #1a95e0);
    color: var(--background-color) !important;
    padding: 5px 10px;
    border-radius: 3px;
  }
}

:root {
  --primary-color: #9b59b6;  /* Light mode */
}

html[theme="dark"] {
  --primary-color: #b77dd6;  /* Dark mode - lighter shade */
}


/* Research section with alternating image/text layout */
.research-item {
  display: flex;
  gap: 30px;
  margin: 40px 0;
  align-items: center;
}

.research-item img {
  width: 10%;
  max-width: 100%;  /* Just means "don't exceed container" */
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

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

/* Reverse layout for alternating rows */
.research-item.reverse {
  flex-direction: row-reverse;
}

/* Mobile: stack image on top, then text */
@media (max-width: 768px) {
  .research-item,
  .research-item.reverse {
    flex-direction: column;
    align-items: flex-start;
    /* Remove text-align: center; so text stays left-aligned */
  }
  
  .research-item img {
    width: 25%;
    max-width: 100%;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
  
  .research-item-content {
    width: 100%;
    text-align: left;
  }
}

/* Purple hamburger menu */
.hamburger span {
  background-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
}

/* Purple hamburger when active (X shape) */
.hamburger.active span {
  background-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
}