/* 1. Define Custom Properties at the top */
:root {
  --primary-color: #3498db;
  --primary-hover: #2980b9;
  --secondary-color: #2ecc71;
  --heading-color: #2c3e50;
  --text-color: #555;
  --background-light: #f4f6f8;
  --background-white: #fff;
  --border-color: #e1e1e1;
  --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  display: flex;
  background-color: var(--background-light);
}

#main-container {
  display: flex;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.sidebar {
  width: 300px;
  padding: 30px;
  flex-shrink: 0;
}

.sidebar header {
  text-align: center;
}

.profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--background-white);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.sidebar h1 {
  color: var(--heading-color);
}

.sidebar .intro p {
  text-align: left;
  color: var(--text-color);
  line-height: 1.6;
}

.sidebar a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.sidebar a:hover {
  color: var(--secondary-color);
}

.main-content {
  flex-grow: 1;
  padding: 40px;
  background: var(--background-white);
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

.project-category {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.project-category:last-child {
  border-bottom: none;
}

.project {
  margin-bottom: 30px;
}

.project h4 {
  color: var(--primary-hover);
}

.read-more-btn {
  background-color: var(--primary-color);
  color: var(--background-white);
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 15px;
  transition: background-color 0.3s ease;
}

.read-more-btn:hover {
  background-color: var(--primary-hover);
}

.project-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.8s ease-out;
  margin-top: 0;
  padding-left: 15px;
  padding-right: 15px;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.project-details.active {
  max-height: 2000px;
  padding-top: 20px;
  padding-bottom: 20px;
  margin-top: 20px;
  border: 1px solid var(--border-color);
}

.project-details h5 {
  margin-top: 0;
  color: var(--heading-color);
  font-size: 18px;
}

.project-details ul {
  padding-left: 20px;
}

.project-details li {
  margin-bottom: 8px;
}

.embed-container {
  position: relative;
  margin-top: 20px;
  max-w: 504px;
}

.embed-container iframe {
  width: 100%;
  height: 542px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: block;
}

.embed-container .read-more-btn {
  position: absolute;
  bottom: 15px;
  left: 15px;
  margin-top: 0;
}

.videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.videos iframe {
  border: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}

/* --- Media Queries --- */
@media (max-width: 768px) {
  #main-container, body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    text-align: center;
  }

  .sidebar .intro p {
    text-align: center;
  }
}

.project-media {
  position: relative; /* This allows us to position the button inside */
  margin-top: 20px;
  max-width: 504px; /* Matches the embed width */
}

.project-media iframe {
  width: 100%;
  height: 542px; /* Matches the embed height */
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: block; /* Ensures proper layout */
}

.project-media .read-more-btn {
  position: absolute;
  bottom: 15px; /* Adjust as needed */
  left: 15px; /* Adjust as needed */
  margin-top: 0;
}

