/* ===== PROJECTS SECTION ===== */
.projects-section {
  padding: 3rem 5%;
  background: var(--card-bg);
}

.projects-container {
  max-width: 1200px;
  margin: 0 auto;
}

.projects-title {
  text-align: center;
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-shadow: 0 0 20px var(--primary-glow);
  animation: titleGlow 3s ease-in-out infinite;
}

.projects-subtitle {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-gray);
  margin-bottom: 4rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Projects Grid - 3 Column Layout */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 4rem;
}

/* Project Card */
.project-card {
  background: var(--bg-darker);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  border: 1px solid rgba(201, 169, 97, 0.15);
  position: relative;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(201, 169, 97, 0.25);
  border-color: var(--primary-color);
}

/* Project Image Container */
.project-image {
  height: 200px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image and Video Styles */
.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

/* CRITICAL FIX: Video specific styles */
.project-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  /* This is the key fix: */
  pointer-events: none;
}

.project-card:hover .project-img {
  transform: scale(1.05);
}

.project-card:hover .project-image video {
  transform: scale(1.05);
}

/* Project Overlay - Make sure this is above everything */
.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 100; /* Very high z-index to ensure it's on top */
  pointer-events: none; /* Allow clicks to pass through when hidden */
}

.project-card:hover .project-overlay {
  opacity: 1;
  pointer-events: auto; /* Enable clicks when visible */
}

/* Project Links */
.project-links {
  display: flex;
  gap: 1rem;
  position: relative;
  z-index: 101; /* Even higher than overlay */
}

.project-link {
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: var(--bg-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  pointer-events: auto; /* Ensure links are always clickable */
}

.project-link:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(201, 169, 97, 0.4);
}

/* Project Tech Tags */
.project-tech {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  z-index: 50; /* Above video but below overlay */
}

.project-tech span {
  background: rgba(0, 0, 0, 0.7);
  color: var(--primary-color);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--primary-color);
  pointer-events: none; /* Don't interfere with clicks */
}

/* Project Content */
.project-content {
  padding: 2rem;
}

.project-content h3 {
  font-size: 1.5rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.project-content p {
  color: var(--text-gray);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.project-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-features span {
  background: rgba(201, 169, 97, 0.08);
  color: var(--primary-color);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  border: 1px solid rgba(201, 169, 97, 0.25);
}

/* CTA Section */
.projects-cta {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid rgba(201, 169, 97, 0.2);
}

.projects-cta p {
  color: var(--text-gray);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(201, 169, 97, 0.35);
  border-color: var(--primary-dark);
}

/* Tablet Responsive */
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .projects-container {
    padding: 0 3%;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .projects-section {
    padding: 2rem 3%;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .project-card {
    max-width: 100%;
    margin: 0 auto;
  }
  
  .projects-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
  
  .projects-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
  }
  
  .project-image {
    height: 180px;
  }
  
  .project-content {
    padding: 1.5rem;
  }
  
  .project-content h3 {
    font-size: 1.3rem;
  }
  
  .project-content p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }
  
  .project-tech {
    bottom: 0.5rem;
    left: 0.5rem;
    gap: 0.3rem;
  }
  
  .project-tech span {
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
  }
  
  .project-features span {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .project-link {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }
  
  .projects-cta {
    padding: 2rem 0;
  }
  
  .projects-cta p {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .cta-btn {
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .projects-title {
    font-size: 1.8rem;
  }
  
  .projects-subtitle {
    font-size: 0.9rem;
  }
  
  .project-image {
    height: 160px;
  }
  
  .project-content {
    padding: 1.2rem;
  }
  
  .project-content h3 {
    font-size: 1.2rem;
  }
  
  .project-content p {
    font-size: 0.9rem;
  }
  
  .project-tech span {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }
  
  .project-features {
    gap: 0.4rem;
  }
  
  .project-features span {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
}