@charset "UTF-8";
.discover-controls-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #0f3460; /* 테마 색상에 맞춰 조정 가능 */
  padding-bottom: 15px;
}

.global-country-header {
  height: 0;
  margin: 0;
  overflow: hidden; /* 시각적으로 숨김 */
}

.global-country-title {
  /* 스크린 리더를 위해 접근성 있게 숨김 */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

#current-country-flag {
  font-size: 2.5rem; /* 국기 아이콘 크기 */
  margin-right: 15px;
}

.chart-tabs {
  display: flex;
  gap: 10px; /* 탭 사이 간격 */
}

/* .tab-button 스타일은 onlycss.css의 .chip-button으로 통합. 여기서는 .active 등 특수 상태만 정의 */
.chip-button.tab-button {
  /* 기본 스타일은 .chip-button 에서 상속 */
  border-color: #0f3460; /* discover.css 고유 테두리 색 */
  color: #a0a0a0; /* discover.css 고유 글자 색 */
}
.chip-button.tab-button.active,
.chip-button.tab-button:hover {
  color: #ffffff;
  background-color: #e94560; /* 활성/호버 시 배경색 */
  border-color: #e94560; /* 활성/호버 시 테두리색 */
}

.header-controls {
  display: flex;
  justify-content: flex-end; /* 오른쪽 정렬 */
}

.global-country-selector {
  position: relative; /* 드롭다운 기준점 */
}

#selected-country-display {
  background-color: #0f3460; /* 버튼 배경색 */
  color: #e94560; /* 버튼 글자색 */
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  min-width: 150px; /* 최소 너비 */
  justify-content: space-between; /* 내부 요소 양쪽 정렬 */
}

#selected-country-display:hover {
  background-color: #e94560; /* 호버 시 배경색 */
  color: #ffffff; /* 호버 시 글자색 */
}

#selected-country-display .fas {
  /* 드롭다운 화살표 아이콘 */
  margin-left: 10px;
}

.country-dropdown-panel {
  position: absolute;
  top: 100%; /* 버튼 바로 아래 */
  right: 0; /* 오른쪽 정렬 */
  background-color: #1a1a2e; /* 드롭다운 배경색 */
  border: 1px solid #0f3460; /* 드롭다운 테두리 */
  border-radius: 12px;
  width: 300px; /* 드롭다운 너비 */
  max-height: 60vh; /* 최대 높이 (화면 넘어가지 않도록) */
  overflow: hidden; /* 내부 스크롤 위해 */
  z-index: 1000; /* 다른 요소 위에 오도록 */
  display: flex;
  flex-direction: column;
  margin-top: 5px; /* 버튼과의 간격 */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); /* 그림자 효과 */
  visibility: hidden; /* 기본 숨김 (JS로 제어) */
  opacity: 0;
  transform: translateY(-10px); /* 나타날 때 약간 위에서 내려오는 효과 */
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.country-dropdown-panel.show {
  /* JS로 .show 클래스 추가 시 보임 */
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

#country-search-input {
  width: calc(100% - 20px); /* 내부 여백 고려한 너비 */
  padding: 10px;
  margin: 10px 10px 5px 10px;
  border-radius: 6px;
  border: 1px solid #0f3460; /* 검색창 테두리 */
  background-color: #16213e; /* 검색창 배경 */
  color: #e0e0e0; /* 검색창 글자색 */
  font-size: 1rem;
}

#country-search-input:focus {
  outline: none; /* 포커스 시 기본 아웃라인 제거 */
  border-color: #e94560; /* 포커스 시 테두리색 변경 */
}

#countries-list {
  overflow-y: auto; /* 국가 목록 스크롤 */
  flex-grow: 1; /* 남은 공간 채우기 */
  padding: 0 10px 10px 10px; /* 내부 여백 */
}

#countries-list::-webkit-scrollbar {
  width: 6px;
}
#countries-list::-webkit-scrollbar-track {
  background: transparent;
}
#countries-list::-webkit-scrollbar-thumb {
  background-color: #0f3460;
  border-radius: 3px;
}
#countries-list::-webkit-scrollbar-thumb:hover {
  background-color: #e94560;
}

.country-option {
  padding: 12px 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 8px;
  transition: background-color 0.2s;
}
.country-option:hover {
  background-color: #0f3460; /* 호버 시 배경색 */
}

.country-flag {
  font-size: 1.5rem; /* 국기 아이콘 크기 */
  margin-right: 15px;
  min-width: 30px; /* 국기 아이콘 영역 확보 */
}
.country-name {
  font-size: 1rem;
  color: #ffffff;
}

#countries-list hr {
  /* 구분선 (필요시 사용) */
  border: none;
  border-top: 1px solid #0f3460;
  margin: 8px 0;
}

.playlist-container iframe {
  /* 유튜브 플레이리스트 임베드 */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.playlist-message {
  /* 로딩 메시지 */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 1.2rem;
  color: #a0a0a0;
}
.playlist-message .fas {
  /* 로딩 아이콘 */
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* --- Mobile Responsive Styles for Discover Controls --- */
@media (max-width: 768px) {
  #discover-section {
    /* onlycss.css 에서도 정의될 수 있으므로, 필요한 경우 !important 사용 또는 구체성 높이기 */
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .discover-controls-wrapper {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 15px;
    padding-bottom: 20px;
  }

  .header-controls {
    justify-content: center;
    width: 100%;
  }

  .global-country-selector {
    width: 100%;
  }

  #selected-country-display {
    width: 100%;
    justify-content: center;
  }

  .chart-tabs {
    width: 100%;
    justify-content: center;
  }

  .chip-button.tab-button {
    /* .chip-button 으로 통합 후 반응형 스타일 적용 */
    flex-grow: 1;
    text-align: center;
    padding: 10px 5px;
    font-size: 0.85rem;
  }
}
