/* 오픈소스 기여 섹션 개선 버전 */
.contribute {
  padding: 120px 0;
  background: linear-gradient(135deg, #0a0a14 0%, #131339 100%);
  position: relative;
  overflow: hidden;
}

/* 배경 효과 */
.contribute::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-image: radial-gradient(
      circle at 15% 50%,
      rgba(61, 90, 254, 0.1) 0%,
      transparent 25%
    ),
    radial-gradient(
      circle at 85% 30%,
      rgba(255, 56, 100, 0.08) 0%,
      transparent 25%
    );
  opacity: 0.8;
  z-index: 0;
}

.contribute .container {
  position: relative;
  z-index: 1;
}

.contribute .section-title {
  font-size: 2.5rem;
  margin-bottom: 60px;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(90deg, #4d7cff, #ff4b91);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

/* 새로운 레이아웃 */
.contribute-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
}

/* 정보 부분 스타일 개선 */
.contribute-info {
  width: 100%;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards 0.2s;
}

.contribute-info p {
  font-size: 1.25rem;
  margin-bottom: 40px;
  color: #e9ecef;
  line-height: 1.6;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* 기여 리스트 카드 형태로 개선 */
.contribute-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* 컨테이너를 만들어 두 번째 줄 아이템을 감싸고 중앙 정렬 */
.contribute-list-second-row {
  grid-column: 1 / 4;
  display: flex;
  justify-content: center;
  gap: 30px;
  width: 100%;
}

/* 두 번째 행의 아이템 너비 조정 */
.contribute-list-second-row li {
  width: calc((100% - 30px) / 3); /* 첫 번째 행의 아이템과 동일한 너비 */
  max-width: 350px; /* 너무 넓어지지 않도록 제한 */
}

/* 반응형에서도 컨테이너 유지 */
@media (max-width: 992px) {
  .contribute-list-second-row {
    grid-column: 1 / 3;
  }
}

.contribute-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: calc(0.3s + var(--i, 0) * 0.1s);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #e9ecef;
}

.contribute-list li:hover {
  transform: translateY(-10px);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.1);
}

.contribute-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  display: inline-block;
  background: linear-gradient(45deg, #4d7cff, #ff4b91);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform 0.5s ease;
}

.contribute-list li:hover .contribute-icon {
  transform: scale(1.2) rotate(8deg);
}

.contribute-list li span.text {
  font-size: 1.125rem;
  font-weight: 500;
  margin-top: 10px;
}

/* CTA 버튼 영역 */
.contribute-cta {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards 0.6s;
}

.contribute-cta a.btn {
  padding: 16px 30px;
  border-radius: 50px;
  font-size: 1.125rem;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 220px;
  letter-spacing: 0.5px;
}

.contribute-cta a.btn-primary {
  background: linear-gradient(45deg, #4d7cff, #ff4b91);
  color: white;
  border: none;
  box-shadow: 0 10px 20px rgba(77, 124, 255, 0.3);
}

.contribute-cta a.btn-primary:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 25px rgba(77, 124, 255, 0.4);
}

.contribute-cta a.btn-secondary {
  background: transparent;
  color: #e9ecef;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.contribute-cta a.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
}

.github-btn i {
  font-size: 1.25rem;
}

/* 애니메이션 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floating {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0);
  }
}

/* 배경 요소 추가 */
.contributor-dots {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
}

.contributor-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  animation: floatingDots 8s infinite ease-in-out;
}

@keyframes floatingDots {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(30px, -30px);
  }
  50% {
    transform: translate(0, -60px);
  }
  75% {
    transform: translate(-30px, -30px);
  }
}

/* 반응형 디자인 - 컨트리뷰트 관련 */
@media (max-width: 992px) {
  .contribute-content {
    gap: 40px;
  }

  .contribute .section-title {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  .contribute-cta {
    flex-direction: column;
    align-items: center;
  }

  .contribute-cta a.btn {
    width: 100%;
    max-width: 300px;
  }
  .contribute-list-second-row {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .contribute {
    padding: 80px 0;
  }

  .contribute-list {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
  }

  .contribute-list-second-row {
    flex-wrap: wrap;
  }

  .contribute-list-second-row li {
    width: calc(50% - 15px);
    max-width: none;
  }

  .contribute-list li {
    padding: 20px 15px;
  }

  .contribute-info p {
    font-size: 1.1rem;
  }
}

@media (max-width: 576px) {
  .contribute .section-title {
    font-size: 1.75rem;
  }
  .contribute-list {
    grid-template-columns: 1fr;
  }

  .contribute-list-second-row {
    flex-direction: column;
    width: 100%;
    gap: 20px;
  }

  .contribute-list-second-row li {
    width: 100%;
  }
}
