.team-project-section {
  padding: 5rem 0;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

.team-project-section::before {
  display: none;
}

.team-project-section h1 {
  text-align: center;
  margin-bottom: 4rem;
  color: var(--text-primary);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 900;
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, var(--text-primary), #667eea, #764ba2);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.team-project-section h1::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
  border-radius: 2px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.8;
    transform: translateX(-50%) scaleX(1);
  }

  50% {
    opacity: 1;
    transform: translateX(-50%) scaleX(1.1);
  }
}

/* Team project container - match project section exactly */
.team-project-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.team-project {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.1));
  border-radius: 25px;
  padding: 3rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid rgba(139, 92, 246, 0.3);
  backdrop-filter: blur(20px);
  width: 100%;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
  min-height: 500px;
}

/* Shine effect on hover */
.team-project::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: rotate(45deg);
  transition: all 0.8s ease;
  opacity: 0;
}

.team-project:hover::after {
  opacity: 1;
  animation: shine 1.5s ease-in-out;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }

  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.team-project:hover {
  transform: translateY(-15px) scale(1.02);
}

/* Content area with perfect spacing */
.team-project-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.team-project h2 {
  color: var(--text-primary);
  font-size: clamp(1.8rem, 3.5vw, 2.3rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-align: left;
  background: linear-gradient(135deg, var(--text-primary), #667eea);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.team-project p {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  margin-bottom: 2rem;
  text-align: left;
  opacity: 0.9;
}

.team-project p span {
  background: linear-gradient(135deg, #667eea, #764ba2);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* Tech stack with perfect spacing */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2.5rem;
  justify-content: flex-start;
}

.tech-tag {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tech-tag:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.12));
  transform: translateY(-3px) scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Button container with perfect spacing */
.team-project-actions {
  display: flex;
  justify-content: flex-start;
}

.site-btn {
  padding: 1.2rem 2rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 15px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 220px;
}

.site-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.site-btn:hover::before {
  left: 100%;
}

.site-btn:hover {
  transform: translateY(-3px) scale(1.05);
  background: linear-gradient(135deg, #764ba2, #f093fb);
}

.site-btn i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.site-btn:hover i {
  transform: rotate(360deg);
}

/* Image area with enhanced styling */
.project-image-container {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: all 0.6s ease;
  height: 100%;
  min-height: 350px;
}

.project-image-container a {
  display: block;
  text-decoration: none;
  height: 100%;
}

.team-project img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s ease;
  filter: brightness(0.95) contrast(1.1) saturate(1.1);
}

.team-project:hover img {
  transform: scale(1.15) rotate(2deg);
  filter: brightness(1.1) contrast(1.25) saturate(1.2);
}

/* Light theme */
[data-theme="light"] .team-project {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.05));
  border-color: rgba(139, 92, 246, 0.25);
}

[data-theme="light"] .tech-tag {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.03));
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .tech-tag:hover {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.06));
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .project-image-container {
  border-color: rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .team-project-container {
    padding: 0 1.5rem;
  }

  .team-project {
    padding: 2.5rem;
    gap: 3rem;
  }

  .project-image-container {
    min-height: 320px;
  }
}

@media (max-width: 768px) {
  .team-project-container {
    padding: 0 1rem;
  }

  .team-project {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
    min-height: auto;
  }

  .team-project h2 {
    text-align: center;
    margin-bottom: 1.2rem;
    font-size: 1.8rem;
  }

  .team-project p {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1rem;
  }

  .tech-stack {
    justify-content: center;
    margin-bottom: 2rem;
    gap: 0.6rem;
  }

  .tech-tag {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .team-project-actions {
    justify-content: center;
  }

  .project-image-container {
    height: 250px;
    min-height: 250px;
    order: -1;
    /* Move image to top on mobile */
    margin-bottom: 1rem;
  }

  .team-project-section {
    padding: 3rem 0;
  }

  .site-btn {
    width: 100%;
    max-width: 300px;
    padding: 1rem 1.8rem;
    font-size: 0.95rem;
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .team-project-container {
    padding: 0 0.5rem;
  }

  .team-project {
    padding: 1.8rem;
    gap: 1.5rem;
  }

  .team-project h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .project-image-container {
    height: 200px;
    min-height: 200px;
    margin-bottom: 0.8rem;
  }

  .team-project p {
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
  }

  .tech-stack {
    margin-bottom: 1.5rem;
    gap: 0.5rem;
  }

  .tech-tag {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  .team-project-section h1 {
    font-size: 2rem;
  }

  .site-btn {
    padding: 0.9rem 1.5rem;
    font-size: 0.9rem;
    max-width: 280px;
  }
}

/* Entrance animation */
.team-project {
  opacity: 0;
  transform: translateY(60px);
  animation: slideInUp 1s ease forwards;
  animation-delay: 0.2s;
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button ripple effect */
.site-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.site-btn:active::after {
  width: 300px;
  height: 300px;
}
