/* Popup Animation Keyframes */
@keyframes popupSlideUp {
  0% {
    opacity: 0;
    transform: translateY(var(--start-y, 30px)) scale(var(--start-scale, 0.9));
  }
  60% {
    opacity: 0.8;
    transform: translateY(-5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile Image Slide Animations */
@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-100px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(100px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Tablet Responsive Styles for About Video */
@media (min-width: 769px) and (max-width: 1024px) {
  #aboutVideo {
    width: 480px !important;
    height: 270px !important;
    max-width: 90vw;
  }

  /* Work Content Container Spacing for Tablet */
  .work-content-container {
    padding-top: 12% !important;
    padding-bottom: 8% !important;
  }

  .work-project {
    padding: 4% 0 !important;
  }
}

/* Initial state for mobile floating images - hidden until animated */
.mob-floating-left,
.mob-floating-right {
  opacity: 0;
  transform: translateX(-100px);
}

.mob-floating-right {
  transform: translateX(100px);
}

/* Animation classes to be added when in viewport */
.mob-floating-left.animate-in {
  animation: slideInLeft 1s ease-out forwards;
}

.mob-floating-right.animate-in {
  animation: slideInRight 1s ease-out forwards;
}

/* Our Work Content Transition Styles */
.work-transition-section {
  height: 165vh; /* SIMPLIFIED: Use natural height for better compatibility */
  background-color: #000;
  position: relative;
  overflow: hidden;
}

/* Desktop Spacing Optimization for Work Content */
@media (min-width: 1025px) {
  .work-content-container {
    padding-top: 12% !important;
    padding-bottom: 8% !important;
  }

  .work-project {
    padding: 3% 0 !important;
  }
}

.work-sticky-container {
  position: sticky; /* RESTORED: Match working b2.html exactly */
  top: 0; /* RESTORED: Match working b2.html exactly */
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #000;
}

.work-section-title {
  position: absolute;
  top: 5%;
  /* left: 2rem; */
  z-index: 10;
  width: 100%;
  pointer-events: none;
}

.work-section-title .title-big h2 {
  color: #fff;
  font-size: 4rem;
  text-align: left;
  margin-bottom: 0;
}

.work-title-line {
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, #fff 0%, #888 100%);
  margin-top: 1rem;
  border-radius: 2px;
}

.work-content-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  padding-top: 15%; /* Reduced from 20% for better balance */
  padding-bottom: 10%; /* Added bottom padding for equal spacing */
  align-items: center;
  justify-content: center;
}

.work-project {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  will-change: opacity;
  padding: 5% 0; /* Added vertical padding for consistent spacing */
}

.work-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  padding: 0 2rem;
}

.work-content-left {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-title {
  font-size: 4rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.project-credits {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-credits li {
  color: #fff;
  font-size: 1.1rem;
}

.project-credits .text-grey {
  color: #888;
  margin-right: 0.5rem;
}

.project-btn-wrap {
  margin-top: 1rem;
}

.project-btn {
  display: inline-flex;
  align-items: center;
  padding: 1rem 2rem;
  background-color: transparent;
  border: 2px solid #fff;
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border-radius: 50px;
}

.project-btn:hover {
  background-color: #fff;
  color: #000;
  transform: translateY(-2px);
}

.work-content-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.project-image-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}

/* ENHANCED HOVER EFFECTS - CONSISTENT FOR BOTH PROJECTS */
.project-image-container:hover {
  transform: scale(1.05) !important;
}

/* Ensure hover effects work even during GSAP opacity animations */
#project-1 .project-image-container:hover,
#project-2 .project-image-container:hover {
  transform: scale(1.05) !important;
  transition: transform 0.3s ease !important;
}
#project-1 {
  z-index: 20;
}

#project-2 {
  z-index: 10;
}

.project-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

/* Enhanced image hover effect */
.project-image-container:hover .project-image {
  transform: scale(1.02);
}

.view-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.9);
  color: #000;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto; /* Allow clicks on the overlay */
  z-index: 100; /* Higher z-index to ensure clickability */
}

.view-text {
  color: #000 !important;
  font-weight: 700;
}

/* Ensure overlay hover works for both projects */
.project-image-container:hover .view-overlay,
#project-1 .project-image-container:hover .view-overlay,
#project-2 .project-image-container:hover .view-overlay {
  opacity: 1 !important;
  pointer-events: auto; /* Enable clicking when visible */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .work-content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .project-title {
    font-size: 2.5rem;
  }

  .work-section-title .title-big h2 {
    font-size: 2.5rem;
  }

  .work-section-title {
    top: 5%;
    left: 1rem;
  }

  .work-title-line {
    width: 80px;
    height: 3px;
  }

  .work-transition-section {
    height: 150vh;
  }

  /* MOBILE HOVER EFFECTS - Touch-friendly */
  .project-image-container:active,
  .project-image-container:focus {
    transform: scale(1.05);
  }

  .project-image-container:active .view-overlay,
  .project-image-container:focus .view-overlay,
  #project-1 .project-image-container:active .view-overlay,
  #project-2 .project-image-container:active .view-overlay {
    opacity: 1 !important;
    pointer-events: auto; /* Enable clicking when active/focused */
  }

  /* Ensure mobile touch interactions work */
  .project-image-container {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

@media (max-width: 500px) and (min-width: 300px) {
  /* Remove scroll-based animations for mobile */
  .work-transition-section {
    height: auto !important; /* Remove fixed height */
    position: relative !important;
    overflow: visible !important;
  }

  .work-sticky-container {
    position: relative !important; /* Remove sticky positioning */
    height: auto !important;
    display: block !important;
    overflow: visible !important;
  }

  .work-content-container {
    position: relative !important;
    height: auto !important;
    display: block !important;
    padding: 3rem 0 2rem 0 !important; /* Balanced top and bottom spacing */
  }

  /* Arrange projects vertically */
  .work-project {
    position: relative !important; /* Remove absolute positioning */
    opacity: 1 !important; /* Always visible */
    display: block !important;
    margin-bottom: 3rem;
    padding: 1.5rem 0;
  }

  /* Vertical layout for work content between 300px-500px */
  .work-content-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left; /* Changed to left alignment */
    gap: 1.5rem;
    max-width: 400px;
    margin: 0 auto;
    padding: 0 1rem;
  }

  /* Image first with popup animation */
  .work-content-right {
    order: 1;
    width: 100%;
    animation: popupSlideUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)
      forwards;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }

  /* Content below image */
  .work-content-left {
    order: 2;
    width: 100%;
    gap: 1rem;
    text-align: left; /* Left alignment for content */
    align-items: flex-start; /* Align items to the left */
  }

  /* Title with popup animation and custom font */
  .project-title {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    animation: popupSlideUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s
      forwards;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    text-align: left !important; /* Force left alignment */
    font-family: url("assets/fonts/fa-regular-400.woff2") format("woff2"),
      sans-serif;
  }

  /* Credits with staggered popup animation and custom font */
  .project-credits {
    animation: popupSlideUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.4s
      forwards;
    opacity: 0;
    transform: translateY(15px) scale(0.98);
    text-align: left !important; /* Force left alignment */
    align-items: flex-start !important;
  }

  .project-credits li {
    font-size: 1rem;
    text-align: left !important; /* Force left alignment */
    font-family: url("assets/fonts/fa-regular-400.woff2") format("woff2"),
      sans-serif;
  }

  /* Button with popup animation and custom font */
  .project-btn-wrap {
    margin-top: 1.2rem;
    animation: popupSlideUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.6s
      forwards;
    opacity: 0;
    transform: translateY(10px) scale(0.99);
    text-align: left !important; /* Force left alignment */
    align-self: flex-start; /* Align button to the left */
  }

  .project-btn {
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    font-family: url("assets/fonts/fa-regular-400.woff2") format("woff2"),
      sans-serif;
  }

  /* Image container adjustments */
  .project-image-container {
    max-width: 350px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  }

  /* Staggered animations for different projects - BALANCED FOR BOTH PROJECTS */

  /* Project 1 animations */
  #project-1 .work-content-right {
    animation-delay: 0.2s;
  }

  #project-1 .project-title {
    animation-delay: 0.4s;
  }

  #project-1 .project-credits {
    animation-delay: 0.6s;
  }

  #project-1 .project-btn-wrap {
    animation-delay: 0.8s;
  }

  /* Project 2 animations */
  #project-2 .work-content-right {
    animation-delay: 0.3s;
  }

  #project-2 .project-title {
    animation-delay: 0.5s;
  }

  #project-2 .project-credits {
    animation-delay: 0.7s;
  }

  #project-2 .project-btn-wrap {
    animation-delay: 0.9s;
  }

  /* ENSURE HOVER EFFECTS WORK DURING GSAP ANIMATIONS */
  /* High specificity rules to override GSAP inline styles */
  .work-project .project-image-container:hover {
    transform: scale(1.05) !important;
  }

  .work-project .project-image-container:hover .project-image {
    transform: scale(1.02) !important;
  }

  .work-project .project-image-container:hover .view-overlay {
    opacity: 1 !important;
    pointer-events: auto !important; /* Enable clicking in mobile section */
  }

  /* Section title adjustments */
  .work-section-title {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin-bottom: 2rem;
    text-align: center;
  }

  .work-section-title .title-big h2 {
    font-size: 2.2rem;
    animation: popupSlideUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)
      forwards;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    font-family: url("assets/fonts/fa-regular-400.woff2") format("woff2"),
      sans-serif;
  }
}

@media (max-width: 480px) {
  .project-title {
    font-size: 2rem;
  }

  .work-section-title .title-big h2 {
    font-size: 2rem;
  }

  .work-content-grid {
    padding: 0 1rem;
  }

  .work-title-line {
    width: 60px;
    height: 2px;
  }

  .work-transition-section {
    height: 120vh;
  }
}

/* Blog Horizontal Scroll Styles */
.blog-carousel-section {
  height: 400vh; /* Increased height for much more scroll area */
  /* background-color: #000; */
  /* background-color: #fff !important; */
  position: relative;
  overflow: hidden;
}

.blog-sticky-container {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  /* background-color: #000 ; */
  background: none;
}

.blog-section-title {
  position: absolute;
  top: 10%;
  left: 2rem;
  z-index: 10;
  pointer-events: none;
}

.blog-section-title .title-big h2 {
  color: #fff;
  font-size: 4rem;
  text-align: left;
  margin-bottom: 3rem;
}

.blog-cards-wrapper {
  display: flex;
  gap: 2rem;
  will-change: transform;
  padding: 0 2rem 0 2rem;
  align-items: center;
  height: 100%;
  padding-top: 140px;
  padding-right: 50vw; /* Add extra padding to ensure last card is fully visible */
}

.blog-card {
  height: 450px;
  width: 400px;
  background-color: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #333;
}

.blog-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
}

.blog-card-image {
  height: 250px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.1);
}

.blog-card-content {
  padding: 1.5rem;
  color: white;
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.blog-card-content h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #fff;
  line-height: 1.4;
}

.blog-card-content p {
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.blog-card-content .post-date {
  font-size: 0.8rem;
  color: #888;
  font-weight: 500;
  margin-top: auto;
}

/* Footer spacing fix */
.footer-section {
  position: relative;
  z-index: 100;
  background-color: #000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* Hide the horizontal scroll blog section on mobile */
  .blog-carousel-section {
    display: none !important;
  }
}

@media (max-width: 480px) {
  /* Hide the horizontal scroll blog section on mobile */
  .blog-carousel-section {
    display: none !important;
  }

  .animation-spacer {
    display: none;
  }
}
@media screen and (min-width: 769px) {
  .blog-carousel-section {
    margin-top: 50px;
  }
}

/* Mobile Blog Section Styles */
.mobile-blog-section {
  background-color: #000;
  padding: 80px 0;
  display: none; /* Hidden by default, shown only on mobile */
}

.mobile-blog-section .title-big h2 {
  color: #fff;
  font-size: 3rem;
  margin-bottom: 4rem;
  text-align: center;
}

/* Mobile Carousel Container */
.mobile-blog-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.mobile-blog-card {
  background-color: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #333;
  cursor: pointer;
  transition: transform 0.3s ease;
  display: none; /* Hide all cards by default */
  animation: fadeIn 0.5s ease-in-out;
}

.mobile-blog-card.active {
  display: block; /* Show only active card */
}

.mobile-blog-card:hover {
  transform: scale(1.02);
}

.mobile-blog-image {
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.mobile-blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.mobile-blog-card:hover .mobile-blog-image img {
  transform: scale(1.05);
}

.mobile-blog-content {
  padding: 1.5rem;
  color: #fff;
}

.mobile-blog-content h4 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.mobile-blog-content p {
  color: #ccc;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.mobile-blog-content .post-date {
  color: #888;
  font-size: 0.85rem;
  font-style: italic;
}

/* Carousel Navigation */
.mobile-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.carousel-btn {
  background-color: #333;
  border: none;
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.carousel-btn:hover {
  background-color: #555;
  transform: scale(1.1);
}

.carousel-btn:disabled {
  background-color: #222;
  color: #666;
  cursor: not-allowed;
  transform: scale(1);
}

/* Carousel Dots */
.carousel-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background-color: #fff;
  transform: scale(1.2);
}

.carousel-dot:hover {
  background-color: #666;
}

/* Fade animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Show mobile blog section only on mobile devices */
@media (max-width: 768px) {
  .mobile-blog-section {
    display: block !important;
  }

  .mobile-blog-section .title-big h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
  }

  .mobile-blog-image {
    height: 200px;
  }

  .mobile-blog-content {
    padding: 1.25rem;
  }

  .carousel-btn {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }

  .carousel-dot {
    width: 10px;
    height: 10px;
  }
}
