/* styles.css */

/* 메뉴 스타일 (현재 변경된 스타일 유지) */
.menu {
  background-color: #2a2a4e;
  padding: 10px 0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu ul li {
  display: inline;
  margin: 0 20px;
}

.menu ul li a {
  color: white;
  text-decoration: none;
  font-size: 1.5em;
  transition: color 0.3s;
}

.menu ul li a:hover {
  color: #aaa;
}

/* 기본 스타일 */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  font-size: 13px; /* 기본 폰트 크기 명시 */
  line-height: 1.6; /* 줄 간격 추가 */
  background-color: #1a1a2e;
  color: #e0e0e0;
}

/* 태블릿 (768px 이하) */
@media (max-width: 768px) {
  .main-content p {
    font-size: 1em; /* 14px * 1 = 14px */
  }
  body {
    font-size: 14px; /* 태블릿에서 조금 작게 */
  }

  h1 {
    font-size: 1.8em; /* 제목 크기 조정 */
  }

  h2 {
    font-size: 1.5em;
  }

  .grid-item p {
    font-size: 12px; /* 시그 아이템 텍스트 크기 */
    line-height: 1.4;
  }

  .menu ul li a {
    font-size: 1.3em; /* 메뉴 텍스트 크기 */
  }
}

/* 휴대폰 (480px 이하) */
@media (max-width: 480px) {
  .main-content p {
    font-size: 0.9em; /* 12px * 0.9 = 10.8px */
  }
  body {
    font-size: 12px; /* 휴대폰에서 더 작게 */
  }

  h1 {
    font-size: 1.5em;
  }

  h2 {
    font-size: 1.2em;
  }

  .grid-item p {
    font-size: 10px;
    line-height: 1.3;
  }

  .menu ul li a {
    font-size: 1.2em;
  }
}

h1 {
  text-align: center; /* 수평 중앙 정렬 */
  font-size: 2.5em;
  color: #e0e0e0;
  margin: 20px 0; /* 메뉴와 콘텐츠 사이 여백 */
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 메인 페이지 스타일 */
.main-content {
  text-align: center;
  padding: 50px 20px;
}

.main-content h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
}

.main-content p {
  font-size: 1.2em;
  margin: 10px 0;
}

/* 필터 및 검색 스타일 */
.filter-search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

/* 필터 컨테이너 스타일 (기존 유지) */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* 날짜 필터 버튼 스타일 */
.filter-container button {
  background-color: #2a2a4e; /* 기본 배경색 */
  color: white;
  border: 2px solid transparent; /* 기본 테두리 */
  padding: 8px 16px; /* 패딩 조정 */
  border-radius: 20px; /* 둥근 버튼 */
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px; /* 체크 아이콘과 텍스트 간격 */
  transition: all 0.3s ease;

  white-space: nowrap; /* 텍스트 줄바꿈 방지 */
  min-width: 110px; /* 버튼 너비 일정하게 */
  flex-shrink: 0; /* 줄어들지 않게 */
}

/* 호버 시 스타일 */
.filter-container button:hover {
  background-color: #3a3a6e;
}

/* 선택된 버튼 스타일 */
.filter-container button.active {
  background-color: transparent; /* 투명 배경 */
  border: 2px solid #4a4a8e; /* 선택된 테두리 색상 */
  color: #4a4a8e; /* 선택된 텍스트 색상 */
}

/* 체크 아이콘 추가 (선택된 버튼에만 표시) */
.filter-container button.active::before {
  content: "✔"; /* 체크 표시 */
  font-size: 12px;
  color: #4a4a8e; /* 체크 표시 색상 */
}

/* 데스크톱용 필터 버튼 */
.desktop-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* 모바일/태블릿용 필터 아이콘 컨테이너 */
.filter-icon-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#filterButton {
  background-color: #2a2a4e;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

#filterButton:hover {
  background-color: #3a3a6e;
}

#selectedFilterLabel {
  color: #e0e0e0;
  font-size: 14px;
}

/* 필터 오버레이 스타일 */
.filter-overlay {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.filter-overlay-content {
  background-color: #2a2a4e;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 400px;
  position: relative;
  box-sizing: border-box;
}

.filter-overlay-content h3 {
  color: #e0e0e0;
  margin-bottom: 20px;
  text-align: center;
}

.close-overlay {
  position: absolute;
  top: 10px;
  right: 20px;
  color: white;
  font-size: 30px;
  cursor: pointer;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.filter-options button {
  background-color: #2a2a4e;
  color: white;
  border: 2px solid transparent;
  padding: 12px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.filter-options button:hover {
  background-color: #3a3a6e;
}

.filter-options button.active {
  background-color: transparent;
  border: 2px solid #4a4a8e;
  color: #4a4a8e;
}

.filter-options button.active::before {
  content: "✔";
  font-size: 12px;
  color: #4a4a8e;
  margin-right: 5px;
}

.apply-filter {
  background-color: #4a4a8e;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  transition: background-color 0.3s;
}

.apply-filter:hover {
  background-color: #5a5a9e;
}

/* 반응형 조정 */
@media (max-width: 768px) {
  .desktop-filter {
    display: none; /* 태블릿 이하에서 숨김 */
  }
  .mobile-filter {
    display: flex; /* 태블릿 이하에서 표시 */
  }
}

@media (min-width: 769px) {
  .desktop-filter {
    display: flex; /* 데스크톱에서 표시 */
  }
  .mobile-filter {
    display: none; /* 데스크톱에서 숨김 */
  }
}

@media (max-width: 480px) {
  .filter-overlay-content {
    width: 90%;
    margin: 20% auto;
  }
  .filter-options button {
    font-size: 14px;
    padding: 10px 14px;
  }
  .apply-filter {
    font-size: 14px;
    padding: 8px 16px;
  }
}

.search-container {
  display: flex;
  gap: 10px;
}

.search-container input {
  padding: 8px;
  border: none;
  border-radius: 5px;
  background-color: #2a2a4e;
  color: #e0e0e0;
  width: 200px;
}

.search-container input::placeholder {
  color: #aaa;
}

.search-container button {
  background-color: #2a2a4e;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.search-container button:hover {
  background-color: #3a3a6e;
}

/* 그리드 스타일 (시그 및 노래 목록 공통) */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1400px; /* 최대 너비 설정 (250px * 5 + 20px * 4 = 1330px + 여유분) */
  margin: 0 auto; /* 좌우 여백 추가로 가운데 정렬 */
}

.grid-item {
  background-color: #2a2a4e;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  letter-spacing: 0.5px; /* 글자 간격 조정 */
}

.grid-item:hover {
  transform: scale(1.05);
}

.grid-item video {
  width: 100%;
  height: auto;
  display: block;
}

.grid-item p {
  margin: 10px 0;
  font-size: 14px;
}

/* 모달 스타일 */
.modal {
  display: none;
  position: fixed;
  z-index: 2000; /* 메뉴(z-index:100) 위로 올림 */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  background-color: #2a2a4e;
  margin: 5% auto;
  padding: 20px; /* 필요에 따라 줄일 수 있음, 예: 10px */
  border-radius: 10px;
  width: 90%;
  max-width: 900px;
  position: relative;
  box-sizing: border-box; /* 패딩이 너비에 포함되도록 */
}

.close {
  position: absolute;
  top: 10px;
  right: 20px;
  color: white;
  font-size: 30px;
  cursor: pointer;
  z-index: 2100; /* 모바일에서 메뉴보다 위에 표시 */
}

#videoContainer {
  width: 100%;
  max-width: 900px; /* 모달 창의 최대 너비와 일치 */
  margin: 0 auto; /* 가운데 정렬 */
}

#videoContainer iframe,
#videoContainer video {
  width: 100%;
  height: auto; /* 고정 높이 제거 */
  aspect-ratio: 16 / 9; /* 동영상의 원래 비율(16:9) 유지 */
  border-radius: 10px;
  display: block; /* 불필요한 여백 방지 */
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: 600px;
  }

  #videoContainer iframe,
  #videoContainer video {
    width: 100%;
    height: auto; /* 비율에 따라 자동 조정 */
    aspect-ratio: 16 / 9; /* 비율 유지 */
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 98%;
    max-width: 400px;
  }

  #videoContainer iframe,
  #videoContainer video {
    width: 100%;
    height: auto; /* 비율에 따라 자동 조정 */
    aspect-ratio: 16 / 9; /* 비율 유지 */
  }
}

/* 소셜 섹션 스타일 */
.social-section {
  margin: 40px 0;
}

.social-section h2 {
  font-size: 1.8em;
  margin-bottom: 20px;
  color: #e0e0e0;
}

/* 영상/포스트 그리드 스타일 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 0 20px;
}

#youtube-videos.video-grid {
  grid-template-columns: repeat(2, 1fr); /* 유튜브 영상 2열 고정 */
  max-width: 1200px; /* 최대 폭 설정 */
  margin: 0 auto; /* 가운데 정렬 */
}

.video-grid iframe,
.video-grid blockquote {
  width: 100%;
  aspect-ratio: 16 / 9; /* 16:9 비율 유지 */
  border-radius: 10px;
  overflow: hidden;
}

/* 반응형 조정 */
@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  #youtube-videos.video-grid {
    grid-template-columns: 1fr; /* 작은 화면에서 1열 */
  }
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr; /* 작은 화면에서는 1열 */
  }
}

#youtube-shorts.video-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* 수평 가운데 정렬 */
  align-items: center; /* 수직 가운데 정렬 */
  gap: 10 !important; /* 간격 제거 */
  padding: 0 !important; /* 패딩 제거 */
  box-sizing: border-box;
}

#youtube-shorts iframe {
  width: 250px !important;
  height: 444px !important;
  border-radius: 10px;
  margin: 0 !important; /* 혹시 모를 마진 제거 */
}

footer {
  background-color: #1a1a2e;
  padding: 20px;
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #e0e0e0;

  margin-top: 20px; /* 콘텐츠와 footer 사이 간격 */
}

.footer-content p {
  margin: 0;
}

.footer-content ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.footer-content li {
  display: inline;
  margin: 0 15px;
}

.footer-content a {
  text-decoration: none;
  color: #007bff;
}

.footer-content ul li {
  color: #007bff; /* 브라우저 기본 파란색 코드 */
}

.footer-content a:hover {
  text-decoration: underline;
}

/* 기존 .sooptv-link 스타일 유지 및 개선 */
.sooptv-link {
  text-align: center;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sooptv-image {
  width: 100%; /* 화면 너비에 맞춰 꽉 차게 */
  max-width: 1000px; /* 최대 크기 400px로 키움 */
  height: auto; /* 비율 유지 */
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.sooptv-image:hover {
  transform: scale(1.05); /* 마우스 올리면 살짝 커짐 */
}

.sooptv-info {
  margin-top: 0px;
}

.sooptv-info h3 {
  font-size: 1.8em;
  color: #e0e0e0; /* 열정적인 느낌의 빨간색 */
  margin: 0;
}

.sooptv-info p {
  margin: 5px 0;
  font-size: 1.2em; /* 기본 크기와 맞춤 */
  color: #e0e0e0; /* 기존 텍스트 색상과 통일 */
}

.sooptv-info p:first-of-type {
  font-weight: bold;
  color: #e0e0e0; /* "열정의 은빈이💖" 강조 */
}

.video-only-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #e0e0e0;
  font-size: 15px;
}

.video-only-filter input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  background-color: #2a2a4e;
  border: 2px solid #4a4a8e;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

.video-only-filter input[type="checkbox"]:checked {
  background-color: #4a4a8e;
}

.video-only-filter input[type="checkbox"]:checked::before {
  content: "✔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white !important;
  font-size: 12px;
  font-weight: bold; /* 더 선명하게 */
  text-shadow: 0 0 2px black; /* 대비 효과 추가 */
}

.video-only-filter label {
  cursor: pointer;
}

/* 반응형 조정 */
@media (max-width: 768px) {
  .sooptv-image {
    max-width: 500px; /* 태블릿에서는 조금 작게 */
  }
  .sooptv-info h3 {
    font-size: 1.5em;
  }
  .sooptv-info p {
    font-size: 1em; /* 태블릿에서 읽기 쉽게 */
  }
  .filter-search-container {
    flex-direction: column; /* 세로로 쌓이게 */
    gap: 13px; /* 간격 조정 */
  }

  .filter-icon-container {
    width: 100%; /* 필터 버튼이 가로로 꽉 차게 */
    display: flex;
    justify-content: center;
    gap: 10px;
  }

  .search-container {
    width: 100%; /* 검색창이 가로로 꽉 차게 */
    display: flex;
    justify-content: center;
    gap: 10px;
  }

  .search-container input {
    width: 50%; /* 검색창 너비 조정 */
  }

  .video-only-filter {
    font-size: 15px;
  }

  .video-only-filter input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }

  .video-only-filter input[type="checkbox"]:checked::before {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .sooptv-image {
    max-width: 400px; /* 휴대폰에서는 더 작게 */
  }
  .sooptv-info h3 {
    font-size: 1.3em;
  }
  .sooptv-info p {
    font-size: 0.9em; /* 휴대폰에서 깔끔하게 */
  }
  .video-only-filter {
    font-size: 13px;
  }

  .video-only-filter input[type="checkbox"] {
    width: 14px;
    height: 14px;
  }

  .video-only-filter input[type="checkbox"]:checked::before {
    font-size: 10px;
  }

  .grid-container {
    grid-template-columns: repeat(
      auto-fill,
      minmax(150px, 1fr)
    ); /* 썸네일 크기 축소 */
    gap: 10px; /* 간격도 약간 줄임 */
    padding: 10px;
  }

  .grid-item p {
    font-size: 12px; /* 텍스트도 작게 */
  }

  .grid-item img {
    max-height: 120px; /* 썸네일 높이 제한 */
    object-fit: cover; /* 잘리지 않게 조정 가능 (contain도 가능) */
  }

  .grid-item video {
    max-height: 120px; /* 비디오도 동일하게 축소 */
  }
}

/* 시그 아이템 스타일 */
.grid-item img {
  width: 100%;
  height: auto;
  object-fit: contain; /* 이미지가 잘리지 않고 전체 보이게 */
  display: block;
}

/* 날짜 버튼을 한 줄로 만들고, 스크롤 숨기기 */
.date-scroll-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  gap: 10px;
  margin-bottom: 20px;
  position: relative;
}

/* 실제 날짜 버튼들이 담긴 컨테이너 */
#dateFilter {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#dateFilter::-webkit-scrollbar {
  display: none;
}

/* 좌우 화살표 버튼 */
.date-scroll-arrow {
  background-color: #2a2a4e;
  border: none;
  color: white;
  font-size: 22px;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  flex-shrink: 0;
}

.date-scroll-arrow:hover {
  background-color: #3a3a6e;
}

.date-scroll-arrow.left {
  margin-right: 4px;
}

.date-scroll-arrow.right {
  margin-left: 4px;
}

/* 재생 버튼 스타일 - styles.css 맨 아래에 추가 */
#playAllButton,
#playRandomButton {
  background-color: #2a2a4e;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin-left: 10px;
  transition: background-color 0.3s;
}

#playAllButton:hover,
#playRandomButton:hover {
  background-color: #3a3a6e;
}

/* 모바일 화면에서 버튼 스택 배치 */
@media (max-width: 768px) {
  .search-container {
    flex-wrap: wrap;
  }

  #playAllButton,
  #playRandomButton {
    margin-top: 10px;
    margin-left: 0;
    flex: 1;
    min-width: 100px;
  }
}

/* 모바일 환경에서만 적용되는 CSS */
@media (max-width: 768px) {
  /* 모바일에서만 사용할 재생 버튼 컨테이너 스타일 */
  .play-buttons-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
    margin-top: 10px;
  }

  /* 필터-검색 컨테이너 세로 배치 */
  .filter-search-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  /* 검색 컨테이너 너비 확장 */
  .search-container {
    width: 100%;
    display: flex;
    justify-content: center; /* space-between에서 center로 변경 */
    gap: 10px; /* 검색창과 버튼 사이 간격 */
  }

  /* 그리고 아래 부분을 추가하세요 */
  .search-container input {
    width: 70%; /* 검색창 너비 조정 */
  }

  .search-container button {
    width: auto; /* 검색 버튼은 내용에 맞게 */
  }

  /* 버튼 스타일 재정의 */
  #playAllButton,
  #playRandomButton {
    margin: 0;
    padding: 8px 10px;
    flex: 1;
    background-color: #2a2a4e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
  }

  #playAllButton:hover,
  #playRandomButton:hover {
    background-color: #3a3a6e;
  }
}

/* 작은 모바일 화면을 위한 추가 조정 */
@media (max-width: 480px) {
  .search-container {
    display: flex;
    flex-wrap: nowrap;
  }

  .search-container input {
    min-width: 0;
  }

  #playAllButton,
  #playRandomButton {
    font-size: 14px;
    padding: 8px 5px;
  }
}

/* 플레이어 컨트롤 스타일 */
.player-controls {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  margin-top: 15px;
  background-color: #2a2a4e;
  padding: 10px 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  position: relative;
}

/* 메인 컨트롤 (이전곡, 재생/일시정지, 다음곡) */
.main-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* 추가 컨트롤 (한곡반복, 전체반복, 셔플) */
.extra-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* 재생/일시정지 버튼 크기 약간 키우기 */
#playPauseBtn {
  font-size: 22px;
  width: 45px;
  height: 45px;
}

.player-controls button {
  background-color: transparent;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 18px;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.player-controls button:hover {
  color: #007bff;
  background-color: rgba(255, 255, 255, 0.1);
}

.player-controls button.active {
  color: #007bff;
  background-color: rgba(0, 123, 255, 0.2);
}

/* 한 곡 반복 버튼 스타일 */
#repeatBtn {
  position: relative;
}

#repeatBtn span {
  font-size: 10px;
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-weight: bold;
}

/* 모바일에서의 플레이어 컨트롤 */
@media (max-width: 768px) {
  .player-controls {
    padding: 8px 10px;
    flex-direction: column;
    gap: 10px;
  }

  .main-controls {
    position: static;
    transform: none;
    justify-content: center;
    width: 100%;
  }

  .extra-controls {
    margin-left: 0;
    justify-content: center;
    width: 100%;
  }

  .player-controls button {
    margin: 0 5px;
    padding: 6px;
    font-size: 16px;
    width: 36px;
    height: 36px;
  }

  #playPauseBtn {
    font-size: 20px;
    width: 40px;
    height: 40px;
  }

  #repeatBtn span {
    font-size: 9px;
    bottom: 6px;
    right: 7px;
  }
}

@media (max-width: 480px) {
  .player-controls button {
    margin: 0 3px;
    padding: 5px;
    font-size: 14px;
    width: 32px;
    height: 32px;
  }

  #playPauseBtn {
    font-size: 18px;
    width: 36px;
    height: 36px;
  }

  #repeatBtn span {
    font-size: 8px;
    bottom: 6px;
    right: 6px;
  }
}

/* 클립 페이지 특화 스타일 */
body:has(.grid-container[id="clipGrid"]) .grid-item small {
  display: block;
  color: #888;
  font-size: 12px;
  margin-top: 5px;
  text-align: center;
}

/* 클립 페이지에서만 이미지 높이 조정 */
body:has(.grid-container[id="clipGrid"]) .grid-item img {
  width: 100%;
  height: 200px; /* 150px에서 200px로 증가 */
  object-fit: cover;
  display: block;
}

/* 클립 페이지에서 그리드 아이템 크기 통일 */
body:has(.grid-container[id="clipGrid"]) .grid-item {
  width: 100%;
  max-width: 350px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

/* 기본 그리드 아이템 텍스트 스타일 (sigs.html 등에 적용) */
.grid-item p {
  margin: 10px 0;
  font-size: 14px;
}

/* 클립 페이지에서만 텍스트 정렬 조정 */
body:has(.grid-container[id="clipGrid"]) .grid-item p {
  text-align: center;
  margin: 10px 0;
  font-size: 14px;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 클립 페이지에서만 그리드 컨테이너 너비 늘리기 */
body:has(.grid-container[id="clipGrid"]) .grid-container {
  max-width: 1800px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  justify-items: center;
}

/* 모바일에서 클립 목록 비율 조정 */
@media (max-width: 768px) {
  body:has(.grid-container[id="clipGrid"]) .grid-container {
    max-width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
    justify-items: center;
  }
  
  body:has(.grid-container[id="clipGrid"]) .grid-item img {
    height: 160px; /* 모바일에서 높이 늘림 */
  }
  
  body:has(.grid-container[id="clipGrid"]) .grid-item p {
  font-size: 13px;
  margin: 8px 0;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
  
  body:has(.grid-container[id="clipGrid"]) .grid-item small {
    font-size: 11px;
    margin-top: 3px;
  }
}

@media (max-width: 480px) {
  body:has(.grid-container[id="clipGrid"]) .grid-container {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding: 12px;
    justify-items: center;
  }
  
  body:has(.grid-container[id="clipGrid"]) .grid-item img {
    height: 140px; /* 작은 모바일에서도 높이 늘림 */
  }
  
  body:has(.grid-container[id="clipGrid"]) .grid-item p {
  font-size: 12px;
  margin: 6px 0;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
  
  body:has(.grid-container[id="clipGrid"]) .grid-item small {
    font-size: 10px;
    margin-top: 2px;
  }
}

/* 클립 모달 스타일 */
#modalVideoContainer {
  width: 100%;
  margin-bottom: 20px;
}

#modalVideoContainer iframe {
  width: 100%;
  height: 600px;
  border-radius: 8px;
  border: none;
}

/* 클립 페이지에서 모달 상단 여백을 늘려 닫기 버튼과 콘텐츠 겹침 방지 */
body:has(.grid-container[id="clipGrid"]) .modal-content {
  padding-top: 56px; /* 기본 20px + 상단 여백 추가 */
}

/* 모바일에서 클립 모달 크기 조정 */
@media (max-width: 768px) {
  body:has(.grid-container[id="clipGrid"]) .modal-content {
    width: 95%;
    max-width: 500px;
    margin: 10% auto;
    padding: 56px 15px 15px 15px; /* 상단 여백 확보 */
  }
  
  body:has(.grid-container[id="clipGrid"]) #modalVideoContainer iframe {
    height: 300px;
  }
}

@media (max-width: 480px) {
  body:has(.grid-container[id="clipGrid"]) .modal-content {
    width: 98%;
    max-width: 350px;
    margin: 15% auto;
    padding: 60px 10px 10px 10px; /* 더 작은 화면에서 상단 여백 조금 더 */
  }
  
  body:has(.grid-container[id="clipGrid"]) #modalVideoContainer iframe {
    height: 200px;
  }
}

/* 정렬 버튼 스타일 */
.sort-container {
  display: flex;
  gap: 5px;
}

.sort-btn {
  background-color: #2a2a4e;
  color: white;
  border: 2px solid transparent;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.sort-btn:hover {
  background-color: #3a3a6e;
}

.sort-btn.active {
  background-color: transparent;
  border: 2px solid #4a4a8e;
  color: #4a4a8e;
}

/* 모바일에서 정렬 버튼 조정 */
@media (max-width: 768px) {
  .filter-search-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .sort-container {
    width: 100%;
    justify-content: center;
  }
}
