/* スタイリングと詳細設定タブのCSS */

/* 共通のセクションスタイル */
.cmp-styles-section,
.cmp-advanced-section {
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

.cmp-styles-section h3,
.cmp-advanced-section h3 {
  font-size: 16px;
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--primary);
}

.cmp-style-group,
.cmp-advanced-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cmp-style-row,
.cmp-advanced-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.cmp-style-row label,
.cmp-advanced-row label {
  width: 160px;
  flex-shrink: 0;
  font-size: 14px;
}

.cmp-description {
  width: 100%;
  margin: 5px 0 0 160px;
  font-size: 12px;
  color: var(--text-light);
}

/* フォーム要素のスタイル */
.style-setting,
.advanced-setting {
  flex: 1;
  min-width: 120px;
  max-width: 400px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
}

input[type="color"].style-setting {
  padding: 0;
  height: 36px;
  width: 60px;
  min-width: 60px;
  cursor: pointer;
}

textarea.advanced-setting {
  height: 80px;
  padding: 10px;
  font-family: monospace;
  resize: vertical;
}

select.style-setting,
select.advanced-setting {
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E');
  background-position: right 10px top 50%;
  background-repeat: no-repeat;
  padding-right: 30px;
  appearance: none;
}

/* リセットボタン */
.cmp-reset-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 16px;
  width: 20px;
  height: 20px;
  line-height: 1;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.cmp-reset-btn:hover {
  background-color: #f0f0f0;
  color: var(--danger);
}

/* レンジスライダーコントロール */
.cmp-range-control {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 400px;
  gap: 10px;
}

.cmp-range-control input[type="range"] {
  flex: 1;
  height: 4px;
  appearance: none;
  background: #e0e0e0;
  border-radius: 2px;
  outline: none;
}

.cmp-range-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

.cmp-range-control input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}

.cmp-range-value {
  min-width: 40px;
  text-align: right;
  font-size: 14px;
}

/* スイッチコントロール */
.cmp-switch-control {
  position: relative;
  display: inline-block;
}

.cmp-switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cmp-switch-control label {
  display: flex;
  align-items: center;
  cursor: pointer;
  width: auto;
  margin-left: 45px;
}

.cmp-switch-control label:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 18px;
  background-color: #ccc;
  border-radius: 9px;
  transition: .4s;
}

.cmp-switch-control label:after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 12px;
  height: 12px;
  background-color: white;
  border-radius: 50%;
  transition: .4s;
}

.cmp-switch-control input:checked + label:before {
  background-color: var(--primary);
}

.cmp-switch-control input:checked + label:after {
  transform: translateX(18px);
}

/* アクションボタン */
.cmp-style-actions,
.cmp-advanced-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 20px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .cmp-style-row label,
  .cmp-advanced-row label {
    width: 100%;
  }
  
  .cmp-description {
    margin-left: 0;
  }
  
  .style-setting,
  .advanced-setting {
    max-width: 100%;
  }
}