/* 그룹 카드 기본 CSS - 새로 작성 */
.group-section {
  overflow: visible;
  position: relative;
  padding: 120px 0 0;
  background-color: #fff;
}

.group-container {
  width: 95vw;
  max-width: 1800px;
  margin: 0 auto;
  position: relative;
}

.group-title {
  font-size: 44px;
  font-weight: 800;
  margin-bottom: 60px;
  color: #111;
  letter-spacing: -1px;
  padding-left: 20px;
}

.group-cards {
  display: flex;
  gap: 5px;
  width: 100%;
}

.group-card {
  flex: 1;
  height: 520px;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  transition: flex 0.5s ease;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.group-card::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4));
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.group-cards:not(.second) .group-card::before {
  display: none;
}

.group-cards.second .group-card {
  position: relative;
}

.group-cards.second .group-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0) 100%
  );
  z-index: 2;
  pointer-events: none;
  border-radius: 15px 15px 0 0;
}

/* 호버 시 확장 효과 */
.group-card:hover {
  flex: 2;
}

/* 카드 이미지 */
.group-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 카드 오버레이 */
/* .group-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
    border-radius: 15px;
} */

/* 호버 시 오버레이 변경 */
.group-card:hover .group-card-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0, 85, 179, 0.8) 0%,
    rgba(0, 85, 179, 0.9) 100%
  );
}

/* 카드 로고 */
.group-card-logo {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  transform: rotate(180deg);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
  opacity: 1;
  transform: rotate(90deg);
  display: none;
}

.group-card-logo img {
  height: 120px;
  width: auto;
  opacity: 1;
}

/* 카드 콘텐츠 */
.group-card-content {
  position: absolute;
  /* bottom: 30px; */
  top: 0;
  left: 20px;
  z-index: 2;
  transition: opacity 0.3s ease;
  max-width: 80%;
  color: #fff;
  /* writing-mode: vertical-rl; */
  text-orientation: sideways;
}

.group-card-subtitle {
  font-size: 22px;
  opacity: 0.9;
  /* margin-bottom: 10px; */
  font-weight: 400;
}

.group-card-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 10px;
}

.group-card-title.multi-line {
  font-size: 32px;
}

/* 호버 시 콘텐츠 숨기기 */
.group-card:hover .group-card-content {
  opacity: 0;
}

/* 플러스 버튼 */
.group-card-button {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  z-index: 2;
  transition: opacity 0.3s ease;
  background-color: transparent;
}

.group-cards.second .group-card-button {
  left: 20px;
  right: auto;
}

.group-cards.second .group-card-content {
  justify-content: flex-start; /* 상단으로 정렬 */
}
/* 호버 시 버튼 숨기기 */
.group-card:hover .group-card-button {
  opacity: 0;
}

/* 확장된 콘텐츠 (호버 시 표시) */
.group-card-expanded {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: start;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  color: #fff;
  text-align: left;
}

.group-card:hover .group-card-expanded {
  opacity: 1;
  visibility: visible;
  transition-delay: 0.1s;
}

.expanded-logo {
  width: 120px;
  height: auto;
  margin-bottom: 30px;
}

.expanded-description {
  color: #fff;
  font-size: 20px;
  line-height: 1.6;
  text-align: left;
  margin-bottom: 30px;
  max-width: 400px;
}

.expanded-button {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 30px;
  border: 2px solid #fff;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-top: 15px;
}

.expanded-button:hover {
  background-color: #fff;
  color: #0055b3;
}

/* AOS 무효화 - 위로 떠오르는 효과 방지 */
.group-card[data-aos],
.group-cards[data-aos] {
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* 반응형 스타일 */
@media (max-width: 1200px) {
  .group-cards {
    gap: 4px;
  }

  .group-card {
    height: 480px;
  }
}

@media (max-width: 992px) {
  .group-cards {
    flex-wrap: wrap;
    gap: 4px;
  }

  .group-card {
    flex: 1 1 calc(50% - 2px);
    height: 420px;
    margin-bottom: 4px;
  }

  .group-card:hover {
    flex: 1 1 calc(50% - 2px) !important;
  }
}

@media (max-width: 576px) {
  .group-card {
    flex: 1 1 100%;
    height: 360px;
  }

  .group-card:hover {
    flex: 1 1 100% !important;
  }
}

/* 뒤집히는 모션을 위한 스타일 - 첫 번째 group-cards에만 적용 */
.group-cards.flip-style {
  display: flex;
  gap: 5px;
  width: 100%;
  padding-top: 20px;
}

.group-cards.flip-style .group-card {
  flex: 1;
  height: 520px;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transition: none; /* 기존 확장 효과 제거 */
}

.group-cards.flip-style .group-card:hover {
  flex: 1; /* 확장 효과 제거 */
}

/* 카드 뒤집기 구조 */
.group-cards.flip-style .group-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.group-cards.flip-style .group-card:hover .group-card-inner {
  transform: rotateY(180deg);
}

.group-cards.flip-style .group-card-front,
.group-cards.flip-style .group-card-back {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 15px;
  overflow: hidden;
}

.group-cards.flip-style .group-card-front {
  transform: rotateY(0deg);
  z-index: 1;
}

.group-cards.flip-style .group-card-back {
  background: linear-gradient(135deg, #004080 0%, #001e3c 100%);
  color: white;
  transform: rotateY(180deg);
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 앞면 스타일 - 기존과 동일하게 유지 */
.group-cards.flip-style .group-card-front .group-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-cards.flip-style .group-card-front::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4));
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.group-cards.flip-style .group-card-front .group-card-logo {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  display: none;
}

.group-cards.flip-style .group-card-front .group-card-content {
  position: absolute;
  top: 0;
  left: 20px;
  z-index: 2;
  color: #fff;
  max-width: 80%;
}

.group-cards.flip-style .group-card-front .group-card-button {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  z-index: 2;
  background-color: transparent;
  transition: all 0.3s ease;
}

.group-cards.flip-style .group-card:hover .group-card-front .group-card-button {
  transform: rotate(45deg);
}

/* 뒷면 스타일 */
.group-cards.flip-style .group-card-back::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.group-cards.flip-style .group-card-back::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
}

.group-cards.flip-style .group-card-back .card_text {
  position: relative;
  z-index: 2;
}

.group-cards.flip-style .group-card-back .group-card-subtitle {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 15px;
  font-weight: 400;
}

.group-cards.flip-style .group-card-back .group-card-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
}

.group-cards.flip-style .group-card-back .expanded-description {
  font-size: 22px;
  line-height: 1.5;
  opacity: 0.9;
  margin-bottom: 20px;
}

.group-cards.flip-style .group-card-back .expanded-button {
  display: inline-block;
  padding: 12px 24px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  align-self: flex-start;
}

.group-cards.flip-style .group-card-back .expanded-button:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}
