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

/* THEME VARIABLES */
body.light-theme {
  --bg-color: #ffffff;
  --text-color: #333333;
  --author-text-color:rgb(200, 0, 0);
  --header-bg: #f8f8f8;
  --link-text-color: #ffffff;
  --link-color: #0077b5;
  --card-bg: #fefefe;
  --card-border: #ddd;
}

body.dark-theme {
  --bg-color: #1e1e1e;
  --text-color: #ffffff;
  --author-text-color:rgb(255, 172, 19);
  --header-bg: #333333;
  --link-color: #5ec4ff;
  --link-text-color: rgb(0, 41, 122);
  --card-bg: #2a2a2a;
  --card-border: #444444;
}

/* Body defaults to the chosen theme's colors */
body {
  font-family: Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* NAVIGATION BAR */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--header-bg);
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left .nav-brand {
  font-size: 1.5rem;
  color: var(--text-color);
  text-decoration: none;
}

.nav-right a {
  margin-right: 15px;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
}

.nav-right a:hover {
  text-decoration: underline;
}

.nav-right a.active {
  border-bottom: 2px solid var(--link-color);
}

.theme-toggle-button {
  background-color: transparent;
  border: 1px solid var(--text-color);
  color: var(--text-color);
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
}

.theme-toggle-button:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

/* HEADER: PHOTO, CONTACT INFO, AND BIO */
.intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 20px;
}

.photo-container {
  flex: 0 0 200px;
  text-align: center;
}

.photo-container img {
  width: 100%;
  max-width: 200px;
  border-radius: 10px;
}

/* CONTACT INFO UNDER THE PHOTO */
.contact-info {
  margin-top: 15px;
}
.contact-info h2 {
  font-size: 1.4rem;
  margin-bottom: 5px;
}
.contact-info p {
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.contact-info a {
  color: var(--link-color);
  text-decoration: none;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.social-icons img {
  width: 45px;
  height: auto;
  vertical-align: middle;
}

/* BIO CONTAINER */
.bio-container {
  flex: 1;
  max-width: 600px;
}
.bio-container h1 {
  margin-bottom: 20px;
  font-size: 2rem;
}
.bio-container p {
  line-height: 1.6;
  margin-bottom: 15px;
}

/* MAIN CONTENT SECTIONS */
.section-wrapper {
  padding: 40px 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.section-wrapper h2 {
  margin-bottom: 20px;
  border-bottom: 2px solid var(--text-color);
  padding-bottom: 10px;
}

/* AWARDS SECTION */
.awards-section {
  text-align: center;
}
.awards-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 40px;
}
.award-item {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 240px;
  text-align: left;
}
.award-logo {
  width: 85px;
  height: auto;
  object-fit: contain;
}
.award-text h3 {
  margin-bottom: 5px;
  font-size: 1rem;
  color: var(--text-color);
}
.award-text p {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-color);
}

/* EXPERIENCE TIMELINE */
.timeline {
  position: relative;
  margin: 20px 0;
}
.timeline-block {
  display: flex;
  margin-bottom: 30px;
}
.timeline-left {
  width: 25%;
  padding-right: 20px;
  text-align: right;
}
.timeline-left h3 {
  margin-bottom: 5px;
  font-size: 1.1rem;
  font-weight: bold;
}
.timeline-left span {
  font-size: 0.9rem;
  color: #aaa; /* Slightly lighter than #777 for dark mode contrast */
}
.timeline-mid {
  width: 40px;
  position: relative;
  display: flex;
  justify-content: center;
}
.timeline-mid::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--text-color);
}
.timeline-dot {
  width: 15px;
  height: 15px;
  background-color: var(--link-color);
  border-radius: 50%;
  border: 3px solid var(--bg-color);
  position: relative;
  z-index: 1;
}
.timeline-right {
  width: 70%;
  padding-left: 20px;
}
.timeline-right .company {
  font-weight: bold;
  color: var(--link-color);
  margin-bottom: 5px;
}

/* PUBLICATIONS SECTION */
.publications-section {
  margin-top: 40px;
}
.publication-card {
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 6px;
  color: var(--text-color);
}
.publication-title {
  margin-bottom: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  line-height: 1.3;
}
.publication-authors {
  margin-bottom: 10px;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--author-text-color);
}
.publication-description {
  margin-bottom: 10px;
  font-size: 0.95rem;
  line-height: 1.6;
}
.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.publication-links .btn {
  display: inline-block;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--link-text-color);
  font-weight: bold;
  background-color: var(--link-color);
  padding: 6px 12px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  
}
.publication-links .btn:hover {
  background-color: #005c89;
}

/* PROJECTS GRID */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 30px;
}
.project-card {
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  border-radius: 6px;
  padding: 20px;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.project-card img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
  margin-bottom: 15px;
}
.project-card h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  font-weight: bold;
}
.project-card p {
  flex: 1; /* make the text area flexible */
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 15px;
}
.project-card .btn {
  display: inline-block;
  text-decoration: none;
  color: #fff;
  background-color: var(--link-color);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: center;
  transition: background-color 0.2s ease;
}
.project-card .btn:hover {
  background-color: #005c89;
}

/* FOOTER */
footer {
  background-color: var(--header-bg);
  text-align: center;
  padding: 20px;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
  .intro {
    flex-direction: column;
  }
  .timeline-block {
    flex-direction: column;
    align-items: flex-start;
  }
  .timeline-left,
  .timeline-mid,
  .timeline-right {
    width: 100%;
    text-align: left;
    padding: 0;
    margin-bottom: 10px;
  }
  .timeline-mid {
    align-items: flex-start;
  }
  .timeline-mid::after {
    left: 10px;
  }
}


/* Theme toggle container should appear as an inline element for nav alignment */
.theme-toggle-container {
  display: inline-block;
  width: 60px;       /* Overall width of the toggle */
  height: 30px;      /* Overall height of the toggle */
  margin-left: 15px; /* Space it from adjacent nav links */
  vertical-align: middle; /* Align with other inline elements */
}

/* Hide the default checkbox */
.theme-toggle-container input {
  display: none;
}

/* The toggle switch label that shows the track and contains the handle and icons */
.theme-toggle-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #333;      /* Dark track background for dark mode */
  border-radius: 30px;
  transition: background-color 0.3s;
  padding: 0 8px;              /* Inner spacing for icons */
}

/* The sliding circular handle */
.switch-handle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

/* When the checkbox is checked, slide the handle to the right */
.theme-toggle-container input:checked + .theme-toggle-switch .switch-handle {
  transform: translateX(30px);
}

/* Optional: change track color on checked state (for light mode) */
.theme-toggle-container input:checked + .theme-toggle-switch {
  background-color: #ccc;
}

/* Style for the mode icons */
.mode-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure the images inside mode-icon are scaled down */
.mode-icon img {
  width: 16px;  /* You can adjust this value as needed */
  height: 16px;
  display: block;
}
