/* Ensure row stays in one line */
.row {
    display: flex !important;
    flex-wrap: wrap !important; /* Prevents wrapping */
}
/* Under 800px, allow wrapping */
@media (max-width: 990px) {
    .row {
      flex-wrap: wrap !important;
    }
  }
  
  /* Over 800px, prevent wrapping */
  @media (min-width: 991px) {
    .row {
      flex-wrap: nowrap !important;
    }
  }
  
  @media (max-width: 422px) {
    .hide-on-small {
      display: none;
    }
  }
  
    
/* Ensures a perfect 16:9 aspect ratio */
.video-container {
    position: relative;
    width: 100%;
    max-width: 900px; /* Set a max width */
    padding-bottom: 56.25%; /* This keeps 16:9 ratio (9 / 16 * 100) */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0px 15px 40px rgba(0, 0, 0, 0.5),
        0px 8px 20px rgba(0, 0, 0, 0.3);
}

/* Make sure the iframe fills its container */
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

.player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Keep it behind other content */
    pointer-events: none; /* Prevent users from clicking the video */
}

/* Ensure the container is positioned for absolute elements */
.portfolio-img {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden; /* Prevents extra spacing */
}

/* Image is visible by default */
.preview-image {
  display: block;
  width: 100%;
  transition: opacity 0.3s ease-in-out;
}

.play-video.selected {
  
  color: #007bff; /* Or any color that works for your design */
}


/* Video is placed exactly over the image but hidden initially */
.hover-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures video fits like an image */
  opacity: 0; /* Hide by default */
  transition: opacity 0.3s ease-in-out;
}

/* On hover, hide the image and show the video */
.portfolio-img:hover .preview-image {
  opacity: 0;
}

.portfolio-img:hover .hover-video {
  opacity: 1;
}
.video-proto {
   
  justify-content: center;  /* horizontal center */
  align-items: center;      /* vertical center */
}
.video-wrapper {
  position: relative;
  display: inline-block; /* So it fits the video size */
  justify-content: center;  /* horizontal center */
  align-items: center;      /* vertical center */
}
.video-centered {
  width: 600px; /* Set fixed width */
  height: 320px; /* Set fixed height */
  object-fit: cover; /* Ensures the video fills the area and cuts off overflow */
  display: block;
  overflow: hidden;
  border-radius: 10px; /* Optional rounded corners */
  box-shadow: 
      0px 15px 40px rgba(0, 0, 0, 0.2),
      0px 8px 20px rgba(0, 0, 0, 0.1);
  transition: filter 0.3s ease; /* Smooth transition */
  position: relative; /* Required for z-index to work */
  z-index: 10; /* Higher number = higher stacking order */
}
@media (max-width: 550px) {
  .video-centered{
    width: 100%; 
    height: auto;
  }
}

.video-fixed {
  width: 500px; /* Set fixed width */
  height: 320px; /* Set fixed height */
  object-fit: cover; /* Ensures the video fills the area and cuts off overflow */
  display: block;
  overflow: hidden;
  border-radius: 10px; /* Optional rounded corners */
  box-shadow: 
      0px 15px 40px rgba(0, 0, 0, 0.2),
      0px 8px 20px rgba(0, 0, 0, 0.1);
  transition: filter 0.3s ease; /* Smooth transition */
}
.video-col{
  position: relative;
}
@media (max-width: 550px) {
  .video-col {
    width:100%; /* Shrinks the width by 20px to account for the padding */
    height: auto;
    /*padding-right: 20px;  Adds padding inside the video */
  }
}

.video-fixed-contain {
  width: 500px; /* Set fixed width */
  height: 320px; /* Set fixed height */
  object-fit: contain !important; /* Ensures the video fills the area and cuts off overflow */
  display: block;
  overflow: hidden;
  border-radius: 10px; /* Optional rounded corners */
  background-color: #333;

  box-shadow: 
      0px 15px 40px rgba(0, 0, 0, 0.2),
      0px 8px 20px rgba(0, 0, 0, 0.1);
  transition: filter 0.3s ease; /* Smooth transition */
}

@media (max-width: 550px) {
  .video-fixed,
  .video-fixed-contain {
    width: 100%; /* Shrinks the width by 20px to account for the padding */
    height: auto;
   /* padding-right: 20px;  Adds padding inside the video */
  }
}



.video-fixed-contain.inactive {
  filter: grayscale(100%) brightness(0.6); /* Makes it grey and slightly darker */
  opacity: 0.5; /* Adjust this value as needed (0 = fully transparent, 1 = fully visible) */
 
}

.video-fixed.inactive {
  filter: grayscale(100%) brightness(0.6); /* Makes it grey and slightly darker */
  opacity: 0.5; /* Adjust this value as needed (0 = fully transparent, 1 = fully visible) */
 
}


  /* Flexbox layout: Makes sure video & text are side by side on large screens */
  .project-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
  }

  .project-row-centered {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start; /* Aligns video and text */
    justify-content: center;
  }

  /* Video column defaults to 100% (stacked) */
  .sticky-video-col,
  .info-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Make them side by side on larger screens (>= 1069px) */
  @media (min-width: 900px) {
    .sticky-video-col {
      flex: 0 0 500px;  /* Fixed video width */
      max-width: 500px;
    }
    .info-col {
      flex: 1; /* Text column takes remaining space */
      max-width: calc(100% - 500px);
    }
  }

  /* Fixed size video */
  .sticky-video-col video {
    margin: 0 auto;
    width: 500px;
    height: 320px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    box-shadow:
      0px 15px 40px rgba(0, 0, 0, 0.2),
      0px 8px 20px rgba(0, 0, 0, 0.1);
  }

  /* Sticky video ONLY on large screens */
  @media (min-width: 900px) {
    .sticky-video-col {
      position: -webkit-sticky;
      position: sticky;
      top: 20px;
      align-self: flex-start;
      z-index: 10;
    }
  }

  @media (max-width: 550px) {
    .sticky-video-col {
      width: 100% !important;
      height: auto !important;
    }
  
    .sticky-video-col video {
      width: 100% !important;
      height: auto !important;
    }
  }
  

.thumbnail-container-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  width: 520px;
  overflow: hidden;
  margin-top: 20px;
}
.thumbnail-container.small {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  white-space: nowrap;
  gap: 5px;
}
.thumbnail-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  z-index: 10;
  display: none; /* Will be toggled by JS */
}
.thumbnail-container.small::-webkit-scrollbar {
  display: none; /* Hide scrollbar in WebKit browsers */
}
.thumbnail-arrow.left {
  left: 0;
}

.thumbnail-arrow.right {
  right: 0;
}

.thumbnail-container { 
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap; /* Allow thumbnails to wrap to new lines */
  justify-content: flex-start; /* Align thumbnails to the left */
  gap: 10px;
  padding-left: 10px;
  width: 520px; /* Match video width */
}

.thumbnail-container-nopadding { 
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap; /* Allow thumbnails to wrap to new lines */
  justify-content: flex-start; /* Align thumbnails to the left */
  gap: 10px; 
  width: 520px; /* Match video width */
}

.thumbnail-container-tiny { 
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap; /* Allow thumbnails to wrap to new lines */
  justify-content: flex-start; /* Align thumbnails to the left */ 
  width: 610px; /* Match video width */
  transform: translateX(5px); /* Push left by 10px */
}

@media (max-width: 550px) {
  .thumbnail-container{
    width: 100%; 
    height: auto;
  }
  .thumbnail-container-nopadding{
    width: 100%; 
    height: auto;
  }
}

.thumbnail {
  flex: 1 1 calc(20% - 10px); /* Stretch thumbnails evenly */
  max-width: calc(20% - 10px); /* Limit max width */
  height: 50px; /* Adjust thumbnail height if needed */
  object-fit: cover;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border: 2px solid transparent; /* Default no border */
  filter: grayscale(100%); 
}

.thumbnail.small {
  flex: 1 1 calc(15.7% - 5px); /* Smaller size, adjust percentage as needed */
  max-width: calc(15.7% - 5px); /* Reduce max width */
  height: 40px; /* Smaller height */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); /* Softer shadow */
  border-radius: 4px; /* Slightly smaller radius */
  filter: grayscale(100%);
}

.thumbnail.small:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  filter: grayscale(0%);
}

.thumbnail.tiny {
  flex: 1 1 calc(6% - 5px); /* Smaller size, adjust percentage as needed */
  max-width: calc(6% - 5px); /* Reduce max width */
  height: 30px; /* Smaller height */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); /* Softer shadow */
  border-radius: 2px; /* Slightly smaller radius */
  filter: grayscale(100%);
}
@media (max-width: 550px) {
  .thumbnail.tiny{
    height: 20px; 
  }  
}

.thumbnail.tiny:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  filter: grayscale(0%);
}


.thumbnail:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
  filter: grayscale(0%);
}


.thumbnail.selected {
  border: 3px solid #007bff; /* Highlight the selected thumbnail */
  filter: grayscale(0%);
}

.thumbnail.hidden {
  display: none;
}

#hiddenThumbnails {
  display: none; /* Start hidden */
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease-out, opacity 0.3s ease-out;
}

#hiddenThumbnails.show {
  overflow: visible;
  display: flex; /* Ensure grid layout is kept */
  flex-wrap: wrap;
  gap: 10px; /* Match the gap from .thumbnail-container */
  height: auto; /* Let it expand naturally */
  opacity: 1;
}

/* Ensure hidden thumbnails have the same styles as the others */
#hiddenThumbnails .thumbnail {
  flex: 1 1 calc(20% - 10px);
  max-width: calc(20% - 10px);
  height: 50px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border: 2px solid transparent;
  filter: grayscale(100%);
}

/* Ensure hidden thumbnails have the same hover effect */
#hiddenThumbnails .thumbnail:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
  filter: grayscale(0%);
}

/* Ensure hidden thumbnails have the selected effect */
#hiddenThumbnails .thumbnail.selected {
  border: 3px solid #007bff; /* Same border highlight */
  filter: grayscale(0%);
}

/*small */
/* Ensure hidden thumbnails have the same styles as the others */
#hiddenThumbnails .thumbnail.small{
  flex: 1 1 calc(12.4% - 10px);
  max-width: calc(12.4% - 10px);
  height: 40px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border: 2px solid transparent;
  filter: grayscale(100%);
}

/* Ensure hidden thumbnails have the same hover effect */
#hiddenThumbnails .thumbnail.small:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
  filter: grayscale(0%);
}

/* Ensure hidden thumbnails have the selected effect */
#hiddenThumbnails .thumbnail.small.selected {
  border: 3px solid #007bff; /* Same border highlight */
  filter: grayscale(0%);
}


#showMoreBtn {
  height: 30px; /* Adjust as needed */
  width: 97%;
  line-height: 50px; /* Ensures vertical centering */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px; /* Horizontal padding for better spacing */
  font-size: 12px; /* Adjust if needed */
  text-align: center;
  padding: 10px 20px;
  margin-top: 10px;
  margin-bottom: 20px;
}

/* Start with the popup fully shrunk and invisible */
.mfp-zoom-in .mfp-content {
  opacity: 0;
  transform: scale(0.8); /* Slight shrink effect */
  will-change: transform, opacity; /* Ensures smooth animation */
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

/* When popup appears, it becomes visible and scales up */
.mfp-zoom-in.mfp-ready .mfp-content {
  opacity: 1;
  transform: scale(1);
}

/* When closing, fade out and shrink slightly */
.mfp-zoom-in.mfp-removing .mfp-content {
  opacity: 0;
  transform: scale(0.8);
}

.mfp-slide-in .mfp-content {
  opacity: 0;
  transform: translateY(600px);
  transition: opacity 0.25s ease-out, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mfp-slide-in.mfp-ready .mfp-content {
  opacity: 1;
  transform: translateY(0);
}

.mfp-slide-in.mfp-removing .mfp-content {
  opacity: 0;
  transform: translateY(600px);
}

.ajax-header {
  display: flex;
  align-items: center; /* Vertically center */
  justify-content: center; /* Horizontally center */
  width: calc(100% + 60px); /* Adjust based on the .ajax-container padding */
  margin: -30px -30px 40px -30px; /* Offset the padding */
  height: 60px;
  background-color: #f5df4e;
  text-align: center; 
}

.ajax-header h2 {
  font-size: 28px; /* Adjust size */
  font-weight: bold;
  margin: 0; /* Remove default margin */
  color: black; /* Make it stand out */
  text-transform: uppercase; /* Optional: Makes text look cleaner */
  letter-spacing: 1px; /* Optional: Adds spacing for readability */
}

/*---- prototype secion video wrapper --- */
.video-wrapper {
  position: relative;
  width: 100%; 
  max-width: 100%;
  aspect-ratio: 16 / 9;  
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

/* ORIGINAL:
.video-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}*/

.video-arrows {
  display: flex;
  gap: 10px; /* space between arrows */
  height: 50px;
  transform: translate(0, -350%);
}

/* Arrows styling */
.video-arrow {
  display: flex;                /* Turns it into a flexbox */
  justify-content: center;      /* Centers content horizontally */
  align-items: center;          /* Centers content vertically */

  font-size: 2rem;
  color: white;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
}


/* Default position for desktop */
.video-arrow.left {
  transform: scaleX(-1); 
  position: absolute;
  left: -50px;
}

.video-arrow.right {
  position: absolute;
  right: -50px;
}

.video-arrow:hover { 
  background-color: rgba(0, 0, 0, 0.5);
}



/* ---- MOBILE (under 680px) ---- */
@media (max-width: 680px) {
  .video-wrapper {
    flex-direction: column; /* stack elements vertically */
  }

  .video-arrows {
    height: 50px;
    width: 100%;
    margin-top: 10px;
    transform: translate(0, 0);
    justify-content: center;
  }

  /* Remove absolute positioning on mobile */
  .video-arrow.left,
  .video-arrow.right {
    width: 100%;
    position: static; /* No absolute positioning */
  }
  .description-wrapper {   
    margin-bottom: -10px;
    margin-top: 5px !important;
  }
}

/* Description under video */
.description-wrapper {
  width: 100%;
  text-align: center;
  margin-bottom: 0px;
  margin-top: -30px;
}

.text-2 {
  font-size: 14px !important;
}

/*--- VIDEO LOADER ---*/
.video-loader {
  position: absolute;
  transform: translate(-50%, -50%);  
  width: 64px;
  height: 64px;
  z-index: 10;  
  border: 6px solid #cccccc;
  border-top: 6px solid #666666;
  border-radius: 50%;
  background-color: #ffffff;  
  animation: spin 0.8s linear infinite;
}


.video-loader-sticky {
  position: absolute;
  transform: translate(-50%, -50%);  
  width: 64px;
  height: 64px;
  z-index: 10;  
  border: 6px solid #cccccc;
  border-top: 6px solid #666666;
  border-radius: 50%;
  background-color: #ffffff;  
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none !important; /* Make sure it's solid */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
