/*
 * Main Layout and Components
 * Academic website layout, navigation, and UI components
 */

/* Page layout */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 8.5in;  /* Letter paper width */
  margin: 0 auto;
  padding: 0 1in;    /* LaTeX margins */
  flex: 1;
}

/* Navigation bar */
.navbar {
  background: var(--accent-blue);
  color: white;
  padding: 1em 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar-container {
  max-width: 8.5in;
  margin: 0 auto;
  padding: 0 1in;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-family: var(--font-sans);
  font-size: 1.2em;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2em;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1em;
  padding: 0.5em 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  border-bottom-color: var(--accent-gold);
  text-decoration: none;
}

/* Title block (LaTeX \maketitle style) */
.title-block {
  text-align: center;
  margin: 3em 0 2em 0;
  padding-bottom: 2em;
  border-bottom: 2px solid var(--border-color);
}

.title {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 0.5em;
  color: var(--accent-blue);
  line-height: 1.2;
}

.authors {
  font-size: 1.1em;
  margin: 1em 0;
  font-weight: 500;
}

.affiliation {
  font-size: 1em;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.5em;
}

/* Abstract section */
.abstract {
  background: #f9f9f9;
  border-left: 4px solid var(--accent-blue);
  padding: 1.5em 2em;
  margin: 2em 0;
  font-size: 0.95em;
}

.abstract-title {
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 0.1em;
  margin-bottom: 1em;
  color: var(--accent-blue);
}

/* Section styling */
.section {
  margin: 3em 0;
}

.section-title {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--accent-blue);
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--border-color);
}

.subsection-title {
  font-size: 1.25em;
  font-weight: bold;
  color: var(--text-primary);
  margin: 1.5em 0 0.8em 0;
}

/* Video container (16:9 responsive) */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  margin: 2em 0;
  background: #000;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Two-column layout for drone comparison */
.drone-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2em;
  margin: 2em 0;
}

.drone-card {
  border: 1px solid var(--border-color);
  padding: 1.5em;
  border-radius: 4px;
  background: #fafafa;
  transition: box-shadow 0.3s ease;
}

.drone-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.drone-card h3 {
  color: var(--accent-blue);
  margin-top: 0;
  margin-bottom: 1em;
  font-size: 1.3em;
}

.drone-card img {
  width: 100%;
  height: auto;
  margin-bottom: 1em;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.drone-card ul {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.drone-card li {
  margin: 0.3em 0;
}

/* Results grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5em;
  margin: 2em 0;
}

.result-item {
  padding: 1.2em;
  border-left: 4px solid var(--accent-gold);
  background: #f9f9f9;
  border-radius: 0 4px 4px 0;
}

.result-item h4 {
  margin-top: 0;
  color: var(--accent-blue);
  font-size: 1.1em;
}

/* Challenges list */
.challenges-list {
  margin: 2em 0;
}

.challenge-item {
  margin: 1.5em 0;
  padding: 1.2em;
  border-left: 4px solid var(--accent-blue);
  background: #f9f9f9;
  border-radius: 0 4px 4px 0;
}

.challenge-item h4 {
  margin-top: 0;
  color: var(--accent-blue);
  font-size: 1.1em;
}

.challenge-problem {
  margin: 0.5em 0;
  color: var(--text-secondary);
}

.challenge-solution {
  margin: 0.5em 0;
  font-weight: 500;
}

/* Technical page: Sidebar TOC layout */
.technical-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 3em;
  max-width: 11in;  /* Wider for technical content */
  margin: 2em auto;
  padding: 0 1in;
}

.toc {
  position: sticky;
  top: 80px;  /* Below navbar */
  height: fit-content;
  padding: 1.5em;
  background: #f9f9f9;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-size: 0.9em;
}

.toc h3 {
  margin-top: 0;
  font-size: 1.1em;
  color: var(--accent-blue);
  margin-bottom: 1em;
}

.toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc > ul > li {
  margin: 0.8em 0;
}

.toc li li {
  margin: 0.4em 0;
  padding-left: 1em;
  font-size: 0.95em;
}

.toc a {
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  padding: 0.3em 0;
  transition: color 0.2s ease;
}

.toc a:hover {
  color: var(--accent-blue);
  text-decoration: none;
}

.toc a.active {
  color: var(--accent-blue);
  font-weight: bold;
}

/* Main content area for technical page */
.main-content {
  min-width: 0;  /* Prevent overflow */
}

/* Algorithm cards */
.algorithm-card {
  margin: 2em 0;
  padding: 1.5em;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: #fafafa;
}

.algorithm-card h3 {
  margin-top: 0;
  color: var(--accent-blue);
}

/* Equation display */
.equation-display {
  margin: 1.5em 0;
  padding: 1em;
  background: #f9f9f9;
  border-radius: 4px;
  overflow-x: auto;
}

/* Image gallery */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5em;
  margin: 2em 0;
}

.gallery-item img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.gallery-caption {
  text-align: center;
  font-size: 0.9em;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 0.5em;
}

/* Footer */
.footer {
  background: var(--accent-blue);
  color: white;
  padding: 2em 0;
  margin-top: 4em;
  text-align: center;
  font-family: var(--font-sans);
}

.footer p {
  margin: 0.5em 0;
  text-align: center;
}

.footer a {
  color: var(--accent-gold);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Team photo */
.team-photo {
  margin: 2em 0;
  text-align: center;
}

.team-photo img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Badges/tags */
.badge {
  display: inline-block;
  padding: 0.3em 0.6em;
  background: var(--accent-gold);
  color: var(--text-primary);
  border-radius: 3px;
  font-size: 0.85em;
  font-weight: bold;
  margin: 0.2em;
}

.badge.success {
  background: #28a745;
  color: white;
}

/* Highlight box */
.highlight-box {
  background: #fff9e6;
  border-left: 4px solid var(--accent-gold);
  padding: 1em 1.5em;
  margin: 1.5em 0;
  border-radius: 0 4px 4px 0;
}

/* Performance metrics table */
.metrics-table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
}

.metrics-table th {
  background: var(--accent-blue);
  color: white;
  padding: 0.8em;
  text-align: left;
}

.metrics-table td {
  padding: 0.8em;
  border: 1px solid var(--border-color);
}

.metrics-table tr:nth-child(even) {
  background: #f9f9f9;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2em;
  right: 2em;
  background: var(--accent-blue);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent-gold);
  text-decoration: none;
}

/* Team profiles grid */
.team-profiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2em;
  margin: 2em 0;
}

.profile-card {
  text-align: center;
  padding: 1.5em;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fafafa;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.profile-card img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1em;
  border: 3px solid var(--accent-blue);
}

.profile-card h3 {
  margin: 0.5em 0;
  font-size: 1.1em;
  color: var(--accent-blue);
}

.profile-card p {
  margin: 0.3em 0;
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* Image gallery */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2em;
  margin: 2em 0;
}

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

.gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.gallery-caption {
  margin-top: 0.8em;
  font-size: 0.9em;
  color: var(--text-secondary);
  font-style: italic;
}

/* Figure styling for diagrams */
figure {
  margin: 2em 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

figcaption {
  margin-top: 1em;
  font-size: 0.9em;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
}
