/** Web Components スタイル **/
genre-search {
  display: inline-block;
  min-width: 250px;
}

.genre-search-wrapper {
  margin-bottom: 1em;
}

/** カスタムドロップダウンスタイル **/
.custom-dropdown-container {
  position: relative;
  display: inline-block;
  min-width: 250px;
}

/* ドロップダウンボタン */
.custom-dropdown-button {
  width: 100%;
  padding: 0.4em 2.5em 0.4em 0.8em;
  font-size: 16px;
  background-color: #f5f5f5;
  border: 1px solid #bdbdae;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.custom-dropdown-button:hover {
  background-color: #fafafa;
  border-color: #999;
}

.custom-dropdown-button:focus {
  outline: none;
  border-color: #666;
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* ドロップダウンの矢印 */
.dropdown-arrow {
  position: absolute;
  right: 0.8em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8em;
  color: #666;
  pointer-events: none;
}

.custom-dropdown-container.open .dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* ドロップダウンリスト */
.custom-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

/* ドロップダウンオプション */
.custom-dropdown-option {
  padding: 0.3em 0.8em;
  cursor: pointer;
  transition: background-color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-dropdown-option:hover {
  background-color: #f0f0f0;
}

.custom-dropdown-option.selected {
  background-color: #e8e8e8;
  font-weight: bold;
}

.custom-dropdown-option.placeholder {
  color: #999;
}

.option-text {
  display: block;
}

/* タイトル表示コンテナ */
.genre-titles-container {
  position: fixed;
  padding: 1em;
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
  z-index: 1001;
  max-height: 680px;
  overflow-y: auto;
}

.genre-titles-container h3 {
  margin-top: 0;
  margin-bottom: 0.8em;
  font-size: 1.2em;
  color: #333;
}

.genre-titles-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.genre-titles-list li {
  padding: 0.5em 0;
  border-bottom: 1px solid #e5e5e5;
}

.genre-titles-list li:last-child {
  border-bottom: none;
}

.genre-titles-list a {
  color: #0066cc;
  text-decoration: none;
  display: block;
  transition: color 0.2s ease;
}

.genre-titles-list a:hover {
  color: #004499;
  text-decoration: underline;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .genre-titles-container {
    position: fixed;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 100px);
    top: 50px !important;
  }
}
