/*
 * Robotics Lab Website Stylesheet
 */

:root {
  --primary: #FFCC00; /* App State gold */
  --black: #010101; /* near-black for backgrounds */
  --white: #FFFFFF;
  --light-gray: #f5f5f5;
  --mid-gray: #e0e0e0;
  --dark-gray: #333333;
  --transition-speed: 0.3s;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  color: var(--black);
  background-color: var(--white);
}

h1, h2, h3 {
  font-family: 'Times New Roman', Times, serif;
  color: var(--black);
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Container for consistent horizontal padding */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Navigation bar */
.navbar {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-end;
  background-color: var(--black);
  color: var(--white);
  padding: 0.5rem 1rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

/* Brand container: stack logo and text on separate lines */
.navbar .brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

/* Stack brand text on separate lines next to the logo */
.navbar .brand .brand-lines {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-size: 1rem;
}
.navbar .brand .brand-lines span {
  color: var(--white);
  font-family: 'Times New Roman', Times, serif;
  font-weight: bold;
}

/* Style for logo in the brand area */
/* AppState wordmark: first line of the brand */
.navbar .brand .brand-logo {
  height: 40px;
  width: auto;
}

/* Second line: Computer Science Department */
/* Second line: Computer Science Department */
.navbar .brand .brand-csd {
  font-size: 30px;
  font-family: 'Times New Roman', Times, serif;
  color: var(--white);
  font-weight: bold;
  line-height: 1;
}

/* Third line: Robotics Lab */
.navbar .brand .brand-lab {
  font-size: 60px;
  font-family: 'Times New Roman', Times, serif;
  color: var(--primary);
  font-weight: bold;
  line-height: 1;
}

/* Indent both department and lab names under the logo */

/* Grouped text container inside the brand; stack the lines and indent */
.navbar .brand .brand-text {
  display: flex;
  flex-direction: column;
  padding-left: 5cm;
}

/* Reset positioning on department and lab names */
.navbar .brand .brand-csd,
.navbar .brand .brand-lab {
  position: static;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin-left: auto;
}
.nav-menu li a {
  color: var(--white);
  font-weight: bold;
  /* Increase the menu font size to 1.25 rem (approximately 20 px) */
  font-size: 1.25rem;
  padding: 0.5rem;
  transition: color var(--transition-speed);
}
.nav-menu li a:hover {
  color: var(--primary);
}

/* Mobile navigation toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero section */
.hero {
  height: 100vh;
  /* The hero now contains a full‑width image slider instead of a static background */
  position: relative;
  color: var(--white);
}

/* Ensure hero text appears light regardless of global heading styles */
.hero h1,
.hero p,
.hero .btn {
  color: var(--white);
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  cursor: pointer;
  text-align: center;
}
.primary-btn {
  background-color: var(--primary);
  color: var(--black);
  font-weight: bold;
}
.primary-btn:hover {
  background-color: var(--black);
  color: var(--primary);
  border: 2px solid var(--primary);
}
.secondary-btn {
  background-color: var(--black);
  color: var(--white);
  border: 2px solid var(--primary);
}
.secondary-btn:hover {
  background-color: var(--primary);
  color: var(--black);
}

/* Section styles */
.section {
  padding: 4rem 0;
  /*
   * Offset anchor scrolling so that section headers are not obscured by the
   * fixed navigation bar.  Because the header includes a large wordmark and
   * stacked lines for the department and lab names, it is taller than a
   * typical nav bar.  This generous scroll margin ensures that when a
   * navigation link is clicked, the top of the corresponding section is
   * visible beneath the header.
   */
  scroll-margin-top: 15rem;
}

/*
 * Hide sections that are no longer part of the site structure.  The
 * Projects & Highlights, Milestones, Publications and Outreach sections
 * have been removed from the navigation, so we simply hide them in the
 * layout to avoid blank areas on the page.
 */
#projects,
#timeline,
#publications,
#outreach {
  display: none;
}

.about-section {
  background-color: var(--light-gray);
}

/* Make the paragraphs in the About section justified for balanced text edges */
.about-section p {
  text-align: justify;
}
.research-section {
  background-color: var(--white);
}
.projects-section {
  background-color: var(--light-gray);
}
.timeline-section {
  background-color: var(--white);
}
.team-section {
  background-color: var(--light-gray);
}
.publications-section {
  background-color: var(--white);
}
.outreach-section {
  background-color: var(--light-gray);
}
.contact-section {
  background-color: var(--white);
}

/* Research cards */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.research-card {
  background-color: var(--white);
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.research-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}
.research-card h3 {
  margin-bottom: 0.5rem;
}
.research-card p {
  font-size: 0.9rem;
  color: var(--dark-gray);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.7);
}
.modal-content {
  background-color: var(--white);
  margin: 10% auto;
  padding: 2rem;
  border: 1px solid var(--primary);
  width: 90%;
  max-width: 500px;
  border-radius: 6px;
  position: relative;
}
.modal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  color: var(--dark-gray);
  cursor: pointer;
}

/* Carousel */
.carousel {
  position: relative;
  overflow: hidden;
  margin-top: 2rem;
  /* Adjusted height to better accommodate portrait‑oriented photos and captions */
  height: 500px;
}

/* Make the carousel inside the hero section fill the full height of the hero */
.hero .carousel {
  height: 100%;
  width: 100%;
}

/* Overlay for hero text on top of the slider */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Position the overlay content toward the bottom of the hero to "bring it down" */
  justify-content: flex-end;
  text-align: center;
  /* Increase the bottom padding further to position the overlay text lower on the slider */
  padding: 2rem 2rem 6rem;
  background: rgba(1, 1, 1, 0.5);
  z-index: 2;
}
.hero-overlay h1,
.hero-overlay p {
  color: var(--white);
  margin-bottom: 1rem;
}
.carousel-inner {
  display: flex;
  flex-wrap: nowrap;
  transition: transform var(--transition-speed) ease-in-out;
}
.carousel-item {
  flex: 0 0 100%;
  position: relative;
}
.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.carousel-caption {
  /* Hide captions in the gallery slider to allow more room for the photos */
  display: none;
}
.carousel-caption h3 {
  margin-bottom: 0.5rem;
}
.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(1,1,1,0.5);
  border: none;
  color: var(--white);
  font-size: 2rem;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  border-radius: 50%;
  z-index: 2;
}
.carousel-control.prev {
  left: 10px;
}
.carousel-control.next {
  right: 10px;
}
.carousel-control:hover {
  background: rgba(255,204,0,0.8);
  color: var(--black);
}

/* Timeline */
.timeline {
  position: relative;
  margin-top: 2rem;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25px;
  width: 4px;
  height: 100%;
  background: var(--primary);
}
.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
}
.timeline-content {
  background: var(--light-gray);
  padding: 1rem 1.5rem;
  border-radius: 6px;
  border-left: 4px solid var(--primary);
  margin-left: 3rem;
}

/* Team cards */
.team-grid {
  display: grid;
  /*
   * Increase the minimum width of team cards to 280px to allow larger
   * portraits and create a more balanced layout.  This change means fewer
   * cards will appear per row on wide screens, avoiding a lone card on the
   * final row when there are an odd number of team members.
   */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.team-card {
  perspective: 1000px;
}
.team-card-inner {
  position: relative;
  width: 100%;
  /* Decrease the card height slightly to reduce vertical whitespace around student cards */
  height: 420px;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  cursor: pointer;
}
.team-card.flipped .team-card-inner {
  transform: rotateY(180deg);
}
.team-card-front, .team-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border: 2px solid var(--primary);
  /* Increase the corner rounding for a softer, more modern appearance */
  border-radius: 20px;
  /* Add a subtle shadow to lift the cards off the page */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.team-card-front {
  background-color: var(--white);
}
.team-card-back {
  background-color: var(--light-gray);
  transform: rotateY(180deg);
  padding: 1rem;
  overflow-y: auto;
}
.team-card-front img {
  /* Use the same circular portrait size as the director (Dr. Madadi) */
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}
.external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: var(--primary);
  margin-top: 0.5rem;
}
.external-link i {
  font-size: 0.8rem;
}

/* Publications */
.filter-wrapper {
  margin-bottom: 1rem;
}

/*
 * Team section redesign:
 *  - The director row displays Dr. Madadi’s portrait on the left and her information on the right.
 *  - The students row shows the student cards in a grid beneath the director row.
 */
.team-director {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  background-color: var(--white);
  border: 2px solid var(--primary);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  gap: 2rem;
  margin-bottom: 2rem;

  /* Restrict the width of the director card so that the information column doesn't leave a wide empty area on very large screens */
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.team-director img {
  /* Display the director’s photo at its natural aspect ratio instead of a circle */
  width: 220px;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}
.team-director .director-info {
  flex: 1;
}
.team-director .director-info h3 {
  margin-bottom: 0.5rem;
}
.team-director .director-info .role {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}
.students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}
.filter-wrapper label {
  margin-right: 0.5rem;
  font-weight: bold;
}
.pub-list {
  list-style: none;
}
.pub-list li {
  margin-bottom: 1rem;
  line-height: 1.4;
}
.pub-list em {
  font-style: italic;
}

/* Contact section */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.contact-info p {
  margin-bottom: 0.5rem;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.contact-form label {
  font-weight: bold;
}
.contact-form input,
.contact-form textarea {
  padding: 0.5rem;
  border: 1px solid var(--mid-gray);
  border-radius: 4px;
  font-family: inherit;
}
.contact-form button {
  align-self: flex-start;
  margin-top: 0.5rem;
}
.form-status {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
.copy-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 1rem;
  margin-left: 0.3rem;
}

/* Footer */
.footer {
  background-color: var(--black);
  color: var(--white);
  text-align: center;
  padding: 1rem 0;
}

/* Footnotes */
.footnotes {
  font-size: 0.8rem;
  color: var(--dark-gray);
  margin-top: 2rem;
  padding-bottom: 2rem;
}
.footnotes hr {
  border: none;
  border-top: 1px solid var(--mid-gray);
  margin-bottom: 1rem;
}
.footnotes ol {
  padding-left: 1.5rem;
}
.footnotes li {
  margin-bottom: 0.5rem;
}
.footnotes .backref {
  margin-left: 0.25rem;
  text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .navbar {
    justify-content: space-between;
    align-items: center;
  }
  .navbar .brand .brand-logo {
    height: 32px;
  }
  .navbar .brand .brand-csd {
    font-size: 24px;
  }
  .navbar .brand .brand-lab {
    font-size: 48px;
  }
  .navbar .brand .brand-text {
    padding-left: 3cm;
  }
  .nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--black);
    flex-direction: column;
    width: 200px;
    transform: translateX(100%);
    transition: transform var(--transition-speed);
  }
  .nav-menu.active {
    transform: translateX(0);
  }
  .nav-menu li {
    border-bottom: 1px solid var(--dark-gray);
  }
  .nav-toggle {
    display: block;
  }
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .navbar .brand .brand-logo {
    height: 24px;
  }
  .navbar .brand .brand-csd {
    font-size: 18px;
  }
  .navbar .brand .brand-lab {
    font-size: 36px;
  }
  .navbar .brand .brand-text {
    padding-left: 0;
  }
  .hero h1 {
    font-size: 1.8rem;
  }
  .hero p {
    font-size: 0.9rem;
  }
  .team-card-inner {
    height: 300px;
  }
}
