/* SVGIconSetting Inline Selector Styles */

/* レスポンシブ対応 */
.svg-icon-setting {
  position: relative;
}

.svg-icon-inline-selector {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 0; /* ボタンのすぐ下に表示 */
  z-index: 30;
}

/* アイコン選択ボタンの下のマージン調整 */
.svg-icon-setting__controls {
  margin-bottom: 0 !important;
}

/* モバイルでの最適化 */
@media (max-width: 768px) {
  .svg-icon-inline-selector {
    margin-top: 0;
    padding: 12px;
    border-radius: 4px;
    max-height: 350px;
  }
  
  .svg-icon-inline-selector__header {
    margin-bottom: 12px;
  }
  
  .svg-icon-inline-selector__title {
    font-size: 13px;
  }
  
  .svg-icon-inline-selector__categories {
    gap: 3px;
  }
  
  .svg-icon-inline-selector__categories .components-button {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 28px;
  }
  
  .svg-icon-inline-selector__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  
  .svg-icon-inline-selector__item {
    height: 50px;
    padding: 4px 2px;
  }
  
  .icon-preview-wrapper {
    width: 20px !important;
    height: 20px !important;
  }
}

/* 小さなスマートフォンでの最適化 */
@media (max-width: 480px) {
  .svg-icon-inline-selector {
    max-height: 300px;
    padding: 10px;
  }
  
  .svg-icon-inline-selector__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
  
  .svg-icon-inline-selector__item {
    height: 45px;
  }
  
  .svg-icon-inline-selector__item span:last-child {
    font-size: 8px;
  }
}

/* フォーカススタイルの改善 */
.svg-icon-inline-selector__item:focus {
  outline: 2px solid #2669e6;
  outline-offset: 2px;
}

/* スクロールバーのスタイル改善 */
.svg-icon-inline-selector::-webkit-scrollbar {
  width: 8px;
}

.svg-icon-inline-selector::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.svg-icon-inline-selector::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.svg-icon-inline-selector::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* アニメーション */
.svg-icon-inline-selector {
  opacity: 0;
  transform: translateY(-10px);
  animation: fadeInSlideDown 0.2s ease-out forwards;
}

@keyframes fadeInSlideDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ボタンレイアウトの改善 */
.svg-icon-setting__controls {
  margin-bottom: 0 !important;
}

.svg-icon-setting__controls .icon-selection-button {
  min-height: 36px;
}

/* アイコンプレビューボタンのスタイル */
.icon-preview-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

.icon-preview-button > span {
  display: inline-block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 22px !important;
  max-height: 22px !important;
  overflow: hidden !important;
  object-fit: contain !important;
}

.icon-preview-button svg {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  object-fit: contain !important;
  display: block !important;
  margin: auto !important;
}

/* 選択ボタン内アイコンの色を黒に強制 */
.icon-selection-button .icon-preview-button svg {
  color: #333 !important;
}

.icon-selection-button .icon-preview-button svg path,
.icon-selection-button .icon-preview-button svg rect,
.icon-selection-button .icon-preview-button svg circle,
.icon-selection-button .icon-preview-button svg polygon {
  stroke: #333 !important;
}

.icon-selection-button .icon-preview-button svg[fill="#333333"],
.icon-selection-button .icon-preview-button svg[fill="#333333"] path {
  fill: #333 !important;
}

/* FontAwesome サブカテゴリーボタンのスタイル - 詳細度を高める */
.svg-icon-inline-selector .fontawesome-subcategory-buttons {
  display: flex !important;
  gap: 4px !important;
  margin-bottom: 12px !important;
  flex-wrap: wrap !important;
}

.svg-icon-inline-selector .fontawesome-subcategory-buttons .components-button {
  font-size: 10px !important;
  padding: 3px 6px !important;
  min-height: 26px !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 個別のボタン幅調整 - 文字量に応じて */
.svg-icon-inline-selector .fontawesome-subcategory-buttons .components-button:nth-child(1) {
  flex-basis: 30% !important;
  max-width: 30% !important;
}

.svg-icon-inline-selector .fontawesome-subcategory-buttons .components-button:nth-child(2) {
  flex-basis: 36% !important;
  max-width: 36% !important;
}

.svg-icon-inline-selector .fontawesome-subcategory-buttons .components-button:nth-child(3) {
  flex-basis: 29% !important;
  max-width: 29% !important;
}

/* さらにモバイルでの調整 */
@media (max-width: 480px) {
  .svg-icon-inline-selector .fontawesome-subcategory-buttons .components-button {
    font-size: 9px !important;
    padding: 2px 4px !important;
    min-height: 24px !important;
  }
}

/* カラーボタンのモバイル対応 */
@media (max-width: 768px) {
  .svg-icon-color-button {
    width: 32px !important;
    height: 32px !important;
  }
}
