/* ================= 유튜브 모달 팝업 CSS ================= */

/* 유튜브 모달 오버레이 */
.youtube-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.youtube-modal.active {
  display: flex;
  opacity: 1;
}

/* 모달 콘텐츠 */
.youtube-modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.youtube-modal.active .youtube-modal-content {
  transform: scale(1);
}

/* iframe 스타일 */
.youtube-modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* 닫기 버튼 */
.youtube-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 30px;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.youtube-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 로딩 스피너 */
.youtube-modal-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
}

.spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .youtube-modal-content {
    width: 95%;
    margin: 0 10px;
  }
  
  .youtube-modal-close {
    top: -40px;
    right: -10px;
    font-size: 24px;
    width: 40px;
    height: 40px;
  }
}

/* 비디오 아이템 스타일 개선 */
.video-content {
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
}

.video-content:hover {
  opacity: 0.9;
}

/* 플레이 버튼 중앙 배치 및 호버 효과 */
.playbtn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.video-content:hover .playbtn {
  transform: translate(-50%, -50%) scale(1.15);
}

/* 비디오 썸네일은 원래 스타일 유지 */
.video-thumb {
  /* 기본 스타일은 인라인으로 설정되어 있으므로 건드리지 않음 */
  transition: filter 0.3s ease;
}

.video-content:hover .video-thumb {
  filter: brightness(1.1);
}
