/* Apply border-box to all elements */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Root Variables */
:root {
  --primary-color: #ff6600;
  --secondary-color: #333333;
  --background-color: #ffffff;
  --text-color: #555555;
  --highlight-color: #ff6600;
  --gray-color: #cccccc;
  --light-gray-color: #f0f0f0;
  --medium-gray-color: #888888;
  --dark-gray-color: #aaaaaa;
  --font-family: 'Roboto', sans-serif;
  --light-orange-color: #fff8f1; /* Light Orange Background */
}

/* Base Styles */
body {
  font-family: var(--font-family);
  font-size: 16px; /* Base font size for easy scaling */
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--secondary-color);
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Global List Styles */
ul {
  list-style: none; /* Remove default bullets */
  padding-left: 0;  /* Remove default padding */
  margin: 0;        /* Remove default margin */
}

ul li {
  position: relative;        /* For positioning the custom bullet */
  padding-left: 20px;        /* Space for the custom bullet */
  margin-bottom: 10px;       /* Space between list items */
}

/* Custom Bullet for All List Items */
ul li::before {
  content: '▹';                         /* Custom bullet symbol */
  color: var(--primary-color);          /* Bullet color */
  position: absolute;                   /* Position the bullet */
  left: 0;                              /* Align bullet to the left */
  top: 0;                               /* Align bullet vertically */
  font-size: 1em;                       /* Adjust bullet size if necessary */
}

/* Sub-Bullets for Nested Lists */
ul ul li::before {
  content: '•';                         /* Different bullet symbol */
  color: var(--primary-color);          /* Bullet color */
  position: absolute;                   /* Position the bullet */
  left: 0;                              /* Align bullet to the left */
  top: 0;                               /* Align bullet vertically */ 
  font-size: 1em;                       /* Adjust bullet size if necessary */
}

/* Exclude Navigation and Publications from Custom Bullets */

/* Remove bullets from Navigation */
.project-names li::before {
  content: none; /* Remove custom bullets */
}

/* Remove bullets from Publications */
.publications-container ul li::before {
  content: none; /* Remove custom bullets */
}

/* Adjust padding for Navigation and Publications */
.project-names li,
.publications-container ul li {
  padding-left: 8px; /* Remove space reserved for bullets */
}

/* Header Styles */
header {
  padding: 60px 20px;
  background-color: var(--light-gray-color);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.profile-image-container {
  text-align: center;
}

.profile-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin: 20px;
  border: 4px solid var(--primary-color);
}

.social-media {
  margin: 20px 0;
  text-align: center;
}

.social-media a {
  display: inline-block;
  margin: 0 15px;
  color: var(--text-color);
  transition: color 0.2s, transform 0.2s;
}

.social-media a:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

.social-media i {
  font-size: 40px;
}

.header-text {
  max-width: 600px;
  margin: 20px;
}

.header-text h1 {
  margin: 0;
  font-size: 3em;
  color: var(--primary-color);
}

.header-text h2 {
  margin-top: 10px;
  font-size: 1.5em;
  color: var(--medium-gray-color);
}

.header-text p {
  font-size: 1em; /* Matches the base font size */
  line-height: 1.6; /* Ensures readability */
}

/* Section Styles */
section {
  padding: 40px 20px;
  max-width: 1300px;
  margin: 0 auto;
}

section h3 {
  font-size: 2.5em;
  margin-bottom: 30px;
  color: var(--secondary-color);
  position: relative;
}

section h3::after {
  content: '';
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
  position: absolute;
  left: 0;
  bottom: -10px;
}

section p,
section ul {
  font-size: 1.1em;
  line-height: 1.8;
  color: var(--text-color);
}

section ul {
  list-style: none;
  padding: 0;
}

section ul li {
  margin-bottom: 10px;
}

/* Project Slide Styles */
.project-slide {
  display: none;
  text-align: left;
  padding: 20px;
  background-color: var(--light-gray-color);
  border-radius: 12px;
  opacity: 0;
  transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

.project-slide.active {
  display: block;
  opacity: 1;
}

.project-slide p,
.project-slide ul,
.project-slide ul li,
.project-slide h4,
.project-names li {
  font-size: 1em; /* Matches the base font size */
  line-height: 1.6; /* Ensures readability */
}

.project-slide h4 {
  font-size: 1.5em;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.project-slide h5 {
  font-size: 1.2em;
  margin-bottom: 5px;
  color: var(--secondary-color);
}

.project-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
}

/* Carousel Styles */
.carousel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  background-color: var(--light-gray-color);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.carousel-container h3 {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: var(--secondary-color);
  position: relative;
}

.carousel-container h3::after {
  content: '';
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -10px;
}

.carousel-content {
  width: 100%;
  overflow: hidden;
  position: relative;
}

/* Project Navigation Styles */
.project-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-wrap: nowrap; /* Prevent wrapping */
  position: relative;
}

.project-nav-btn {
  background-color: transparent;
  color: var(--text-color);
  border: none;
  padding: 10px 10px; /* Equal padding on top/bottom and left/right */
  font-size: 1.5em;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  margin: 0 5px; /* Reduced margin for better spacing */
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-nav-btn i {
  font-size: 1.5em;
}

.project-nav-btn:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

/* Navigation List with No Bullets */
.project-names {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 10px;
  flex-wrap: nowrap; /* Prevent wrapping */
  overflow-x: auto; /* Enable horizontal scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.project-names::-webkit-scrollbar {
  display: none; /* Hide scrollbar */
}

/* Project Titles (Only these elements are enlarged) */
.project-name {
  margin: 0 10px;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 20px;
  transition: background-color 0.3s, color 0.3s;
  font-weight: 500;
  user-select: none;
  white-space: nowrap; /* Prevent text from wrapping */
  flex: 0 0 auto; /* Prevent flex items from shrinking */
  font-size: 1.5rem; /* Enlarged font for project titles */
}

.project-name.active {
  background-color: var(--primary-color);
  color: var(--background-color);
}

.project-name:hover {
  background-color: var(--primary-color);
  color: var(--background-color);
}

.project-name:not(.active) {
  color: var(--dark-gray-color);
}

.project-name:not(.active):hover {
  color: var(--background-color);
}

/* Project Gallery Styles */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.project-gallery img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 0;
  min-height: 150px;
}

.project-gallery img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

/* Video Container Styles */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  margin: 20px 0;
  overflow: hidden;
}

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

/* Thesis Container */
.thesis-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}

.thesis-text {
  flex: 1 1 60%;
  min-width: 300px;
  margin-right: 20px;
}

.thesis-text p {
  margin-bottom: 1em;
  line-height: 1.6;
}

.thesis-text ul {
  margin-left: 20px;
  margin-bottom: 1em;
}

.thesis-text li {
  margin-bottom: 0.5em;
}

.thesis-images {
  flex: 1 1 35%;
  min-width: 250px;
}

/* Publications Container Styles */
.publications-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 40px auto;
  padding: 20px;
  background-color: var(--light-orange-color);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.publications-container h3 {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: var(--secondary-color);
  position: relative;
}

.publications-container h3::after {
  content: '';
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -10px;
}

.publications-container ul {
  list-style: none;
  padding: 0;
  font-size: 1.1em;
  line-height: 1.8;
  color: var(--text-color);
  width: 100%;
  max-width: 800px;
}

.publications-container ul li {
  margin-bottom: 15px;
}

/* Remove bullets from Publications List Items */
.publications-container ul li::before {
  content: none; /* Remove custom bullets */
}

/* Remove padding-left for Publications List Items */
.publications-container ul li {
  padding-left: 0; /* Remove space reserved for bullets */
}

/* Publications Links */
.publications-container ul li a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.2s;
}

.publications-container ul li a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Footer Styles */
footer {
  background-color: var(--secondary-color);
  color: var(--background-color);
  text-align: center;
  padding: 20px 0;
}

/* Loading Spinner Styles */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.loading-spinner::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 6px solid var(--gray-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Animation for Loading Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */

/* Tablets and Below */
@media (max-width: 1024px) {
  .project-nav-btn {
    font-size: 1em;
    padding: 8px 12px;
  }

  .project-name {
    font-size: 1.5rem; /* Retain the base enlarged size on tablets */
    margin: 0 10px;
    padding: 10px 15px;
  }
}

/* Mobile Phones */
@media (max-width: 480px) {
  /* 1. Remove White Space on Sides for Projects and Publications */
  .project-gallery,
  .publications-container,
  .project-slide,
  .thesis-container,
  .thesis-images,
  .thesis-text {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: none;
  }

  /* Add Padding to Publications Container */
  .publications-container {
    padding-left: 15px; /* Added padding */
    padding-right: 15px; /* Added padding */
  }

  /* Ensure no horizontal padding/margin on parent containers */
  .carousel-container,
  section {
    padding-left: 0;
    padding-right: 0;
  }

  /* 2. Fix Bullet Offsets in Projects */
  /* Since bullets are excluded from navigation and publications, ensure other lists align properly */

  /* Adjust bullet size and position */
  ul li::before {
    font-size: 0.9em; /* Slightly smaller bullets on mobile */
    left: 0;          /* Ensure bullets are aligned to the very left */
  }

  /* Adjust padding for list items */
  ul li {
    padding-left: 18px; /* Reduced padding to move bullets more to the left */
  }

  /* Specific adjustments for publications */
  .publications-container ul li {
    padding-left: 0; /* Ensure no padding left for publications */
  }

  /* 3. Additional Adjustments to Prevent Overflow and Ensure Responsiveness */
  .project-gallery {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 10px;
  }

  .project-gallery img {
    width: 100%;
    height: auto;
    min-width: 100%;
    min-height: auto;
  }

  .thesis-container {
    flex-direction: column;
    padding: 0 10px;
  }

  .thesis-images {
    margin-top: 15px;
    padding: 0 10px;
  }

  /* 4. Ensure Project Navigation Doesn't Overflow */
  .project-navigation {
    flex-direction: row;
    align-items: center;
    width: 100%;
    overflow: hidden; /* Prevent overflow */
    padding: 0 5px; /* Minimal padding */
  }

  /* Adjust project-nav-btn for mobile */
  .project-nav-btn {
    margin: 0 5px;
    width: 40px;
    max-width: 40px;
    padding: 8px 8px;
    /* Remove any box-shadow or background styles causing the white mist */
    background: none;
    box-shadow: none;
    outline: none;
  }

  /* Adjust project-names for horizontal scrolling with visual indicators */
  .project-names {
    flex: 1;
    margin: 0 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    position: relative;
    padding: 0 20px; /* Ensure space for scroll indicators */
  }

  /* Disable gradient overlays to remove the mist */
  .project-names::before,
  .project-names::after {
    display: none; /* Hides the mist */
  }

  /* Adjust project-name styles for mobile */
  .project-name {
    margin: 0 5px;
    padding: 8px 12px;
    font-size: 1.8rem; /* Enlarged project titles on mobile using rem */
  }

  /* Adjust thesis-images margin */
  .thesis-images {
    margin-top: 20px;
  }

  /* Remove any remaining padding/margin that could cause white space */
  .project-navigation,
  .project-names {
    margin: 0;
    padding: 0;
  }

  /* 5. Ensure Body Doesn't Allow Horizontal Scroll */
  body {
    font-size: 14px;
  }

  /* Additional Adjustments */
  .header-text h1 {
    font-size: 2em;
  }

  section h3 {
    font-size: 1.8em;
  }

  .project-nav-btn {
    font-size: 0.9em;
    padding: 6px 10px;
  }

  .project-nav-btn i {
    font-size: 2.0em;
  }
}

/* Subtitle for Project Date */
.project-date {
  color: var(--medium-gray-color); /* Uses the defined dark gray color */
  font-style: italic;            /* Optional: Makes the subtitle italic */
}
