/* Base styles for the entire document */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #1a1a1a;
  line-height: 1.7;
  font-size: 16px;
}

/* Layout and container styles */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem;
}

/* Header styles, including portrait and introduction */
header {
  background: linear-gradient(to right, #ffffff, #f8f9fa);
  border-bottom: 2px solid #dee2e6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2.5rem;
}

.portrait img {
  border-radius: 50%;
  width: 160px;
  height: 160px;
  object-fit: cover;
  object-position: 0px -9px;
  border: 4px solid #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portrait img:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.intro h1 {
  font-size: 3rem;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
  font-family: Georgia, "Times New Roman", serif;
}

.intro p {
  font-size: 1.1rem;
  color: #495057;
  margin: 0.5rem 0;
  line-height: 1.8;
}

.linkedin {
  display: inline-block;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #0077b5, #005582);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 119, 181, 0.2);
}

.linkedin:hover {
  background: linear-gradient(135deg, #005582, #003d5c);
  box-shadow: 0 6px 20px rgba(0, 119, 181, 0.3);
  transform: translateY(-2px);
}

/* Navigation menu styles */
.menu {
  background-color: #ffffff;
  border-top: 1px solid #e9ecef;
  padding: 1rem 0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.menu a {
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  color: #495057;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.menu a:hover {
  background-color: #e9ecef;
  color: #1a1a1a;
  transform: translateY(-1px);
}

.menu a.active {
  color: #0077b5;
  font-weight: 600;
  position: relative;
}

.menu a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 2px;
  background-color: #0077b5;
  border-radius: 1px;
}

.menu a.active:hover {
  color: #005582;
  transform: translateY(-1px);
}

.menu a.active:hover::after {
  background-color: #005582;
}

/* Hamburger menu button - hidden on desktop, visible on mobile */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background: #0077b5;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Main content styles for sections and cards */
main h2 {
  font-size: 2rem;
  color: #1a1a1a;
  font-weight: 600;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.3px;
}

.subtle {
  color: #6c757d;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

/* GitHub project frame */
.repo-card {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border-left: 4px solid #0077b5;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.repo-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.repo-card h3 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
  font-family: Georgia, "Times New Roman", serif;
}

.repo-card a {
  color: #0077b5;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.repo-card a:hover {
  color: #005582;
  text-decoration: underline;
}

/* Reverting styles for sections */
.repos, .recommendations, .experience, .education, .volunteer, .about, .media, .not-found {
  background-color: #ffffff;
  border: none;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.repos:hover, .recommendations:hover, .experience:hover, .volunteer:hover, .about:hover, .media:hover, .not-found:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.repos h2, .recommendations h2, .experience h2, .education h2, .volunteer h2, .about h2, .media h2, .not-found h2 {
  font-size: 2.2rem;
  font-weight: 500;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 1.75rem;
  letter-spacing: -0.5px;
  font-family: Georgia, "Times New Roman", serif;
}

.recommendation, .job {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  padding-left: calc(1.25rem + 1px);
  border-left: 4px solid #0077b5;
  background: #f8f9fa;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.recommendation:hover, .job:hover {
  border-left-width: 5px;
  padding-left: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateX(1px);
}

/* Unified background color for endorsements */
.recommendation footer {
  background-color: transparent;
  font-style: italic;
  color: #6c757d;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.job h3 {
  font-style: normal;
  color: #495057;
  margin-top: 0.5rem;
}

.job-title {
  cursor: pointer;
  user-select: none;
  font-style: normal !important;
  color: #1a1a1a !important;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  padding-right: 2.5rem;
  font-size: 1.15rem;
  font-family: Georgia, "Times New Roman", serif;
}

/* Education items with logos */
.education-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  padding-left: calc(1.25rem + 1px);
  border-left: 4px solid #0077b5;
  background: #f8f9fa;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.education-item:hover {
  border-left-width: 5px;
  padding-left: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateX(1px);
}

.education-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}

.education-content {
  flex: 1;
}

.education-content h3 {
  font-style: normal !important;
  color: #1a1a1a !important;
  font-weight: 600;
  font-size: 1.15rem;
  font-family: Georgia, "Times New Roman", serif;
  margin-bottom: 0.5rem;
}

.education-award {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f0f8ff;
  border-left: 3px solid #0077b5;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #495057;
}

.clickable-award {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
}

.clickable-award:hover {
  background: #e6f3ff;
}

/* Award Modal */
.award-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.award-modal-content {
  position: relative;
  background-color: #ffffff;
  margin: 5% auto;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.award-modal-content h3 {
  color: #0077b5;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-family: Georgia, "Times New Roman", serif;
}

.award-modal-content h4 {
  color: #495057;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  font-family: Georgia, "Times New Roman", serif;
}

.award-modal-content p {
  line-height: 1.6;
  color: #495057;
  font-size: 1rem;
}

.award-modal .modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: #6c757d;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
  background: none;
  border: none;
}

.award-modal .modal-close:hover {
  color: #0077b5;
  background: none;
  border: none;
}

.job-title:hover {
  color: #0077b5 !important;
}

.job-title::after {
  content: '+';
  position: absolute;
  right: 0;
  font-size: 1.5em;
  font-weight: 300;
  color: #0077b5;
  transition: transform 0.3s ease;
}

.job-title.active::after {
  content: '−';
}

.job-date {
  font-size: 0.9em;
  color: #6c757d;
  font-weight: 400;
  font-style: normal;
}

.job-description {
  display: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
  overflow: hidden;
  transition: all 0.3s ease;
  color: #495057;
  line-height: 1.7;
}

/* Framed style for textual elements under the 'About Alec' heading */
.about p, .not-found p {
  padding: 1.5rem;
  border-left: 3px solid #0077b5;
  background: linear-gradient(to right, #f8f9fa, #ffffff);
  margin-bottom: 1rem;
  border-radius: 6px;
  color: #495057;
  line-height: 1.8;
}

.not-found p a {
  color: #0077b5;
  text-decoration: none;
  font-weight: 500;
}

.not-found p a:hover {
  text-decoration: underline;
}

/* Scroll to top button */
#scrollToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #0077b5, #005582);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease, background 0.3s ease, box-shadow 0.3s ease;
}

#scrollToTop:hover {
  background: linear-gradient(135deg, #005582, #003d5c);
  box-shadow: 0 6px 20px rgba(0, 119, 181, 0.4);
  transform: translateY(-3px);
}

#scrollToTop.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scrollToTop.visible:hover {
  transform: translateY(-3px);
}

#scrollToTop.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

/* Hide scroll to top button when any modal is open */
#scrollToTop.modal-open {
  display: none !important;
}

/* Footer styles */
footer {
  background: #f8f9fa;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.95rem;
  color: #6c757d;
  border-top: 2px solid #dee2e6;
  margin-top: 3rem;
}

/* Media gallery styles */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.media-item {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}

.media-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: scale(1.02);
}

.media-item img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center;
  border-bottom: 2px solid #0077b5;
}

.media-item iframe,
.media-item video {
  width: 100%;
  aspect-ratio: 9 / 16;
  border: none;
  border-bottom: 2px solid #0077b5;
  pointer-events: none;
  object-fit: cover;
  object-position: 15% center;
  background: #000000;
}



/* Force video thumbnail on mobile */
@media (max-width: 768px) {
  .media-item video {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
}

.media-caption {
  padding: 0.75rem;
  background: #ffffff;
}

.media-caption h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 0.25rem;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.3;
}

.media-caption p {
  font-size: 0.75rem;
  color: #6c757d;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}



/* Video play button overlay */
.media-item[data-type="video"] video,
.media-item[data-type="video"] iframe {
  position: relative;
}

.media-item[data-type="video"]::before {
  content: '';
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
  transition: all 0.3s ease;
}

.media-item[data-type="video"]::after {
  content: '';
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-40%, -50%);
  width: 0;
  height: 0;
  border-left: 20px solid #ffffff;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  z-index: 11;
  pointer-events: none;
  transition: all 0.3s ease;
}

.media-item[data-type="video"]:hover::before {
  background: rgba(0, 119, 181, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

.media-item[data-type="video"]:hover::after {
  border-left-color: #ffffff;
}

/* Instagram post styling */
.instagram-carousel-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-bottom: 2px solid #0077b5;
}

.instagram-carousel-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

.carousel-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.instagram-link {
  text-align: center;
  margin-top: 1rem;
}

.instagram-link a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 500;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.instagram-link a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Carousel styling */
.carousel-container {
  position: relative;
  width: 400px;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carousel-slide {
  display: none;
  width: 400px;
  max-width: 100%;
}

.carousel-slide.active {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 400px;
  max-width: 100%;
}

.carousel-slide img {
  max-width: 100%;
  max-height: 600px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.carousel-slide video {
  width: 100% !important;
  max-width: 400px !important;
  height: auto !important;
  max-height: 600px !important;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.carousel-prev:hover,
.carousel-next:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
  left: 15px;
}

.carousel-next {
  right: 15px;
}

.carousel-dots {
  text-align: center;
  margin-top: 15px;
}

.dot {
  cursor: pointer;
  height: 12px;
  width: 12px;
  margin: 0 5px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s ease;
}

.dot.active,
.dot:hover {
  background-color: #0077b5;
}

/* Modal/Lightbox styles */
.media-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.media-modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}





.modal-media-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.modal-content img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.modal-content iframe,
.modal-content video {
  width: 80vw;
  height: 45vw;
  max-width: 1200px;
  max-height: 675px;
  border: none;
  display: block;
}

.modal-content video {
  background: #000000;
  object-fit: contain;
  object-position: 33% center;
}

.modal-content video::-webkit-media-controls-panel {
  position: relative;
}

.modal-content video::-webkit-media-controls {
  position: relative;
}

.modal-caption {
  padding: 1.5rem;
  background: #ffffff;
}

.modal-caption h3 {
  font-size: 1.5rem;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  font-family: Georgia, "Times New Roman", serif;
}

.modal-caption p {
  font-size: 1rem;
  color: #495057;
  line-height: 1.6;
  margin: 0;
}

.description-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0077b5;
  margin-bottom: 0.5rem;
  font-family: Georgia, "Times New Roman", serif;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: normal;
  line-height: 0;
  cursor: pointer;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  padding: 0;
  margin: 0;
  border: none;
  box-sizing: border-box;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Responsive styles for mobile devices */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .header-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .portrait img {
    width: 120px;
    height: 120px;
  }

  .intro h1 {
    font-size: 2rem;
  }

  .intro p {
    font-size: 1rem;
  }

  .linkedin {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }

  /* Show hamburger menu on mobile */
  .hamburger {
    display: flex;
  }

  /* Mobile menu - full screen modal */
  .menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
  }

  .menu.active {
    display: flex;
  }

  .menu ul {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }

  .menu a {
    font-size: 1.5rem;
    padding: 0.75rem 2rem;
    color: #ffffff;
  }

  .menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }

  main h2 {
    font-size: 1.5rem;
  }

  .repos, .recommendations, .experience, .education, .volunteer, .about, .media {
    padding: 1rem;
  }

  .repo-card h3 {
    font-size: 1.2rem;
  }

  .recommendation, .job {
    padding: 0.5rem;
  }

  footer {
    font-size: 0.9rem;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }

  .modal-content iframe,
  .modal-content video {
    width: 95vw;
    height: 53vw;
  }
  
  .media-caption h3 {
    font-size: 0.85rem;
  }

  /* Ensure modal content uses full width on mobile */
  .modal-content {
    max-width: 95%;
  }
  
  .media-caption p {
    font-size: 0.7rem;
  }

  .education-item {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .education-logo {
    width: 60px;
    height: 60px;
  }
}
