/* 型紙メーカー */

#sewing-app {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* ステップインジケーター */
.sewing-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.sewing-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f0f0f0;
  border-radius: 20px;
  font-size: 13px;
  color: #999;
  transition: all 0.3s;
}

.sewing-step.active {
  background: #4a90d9;
  color: #fff;
}

.sewing-step.done {
  background: #6cb06c;
  color: #fff;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  font-weight: bold;
  font-size: 12px;
}

.step-label {
  font-size: 13px;
}

/* ステップパネル */
.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
}

.step-panel h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #333;
}

.step-desc {
  color: #666;
  margin-bottom: 20px;
}

/* カテゴリタブ */
.category-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.category-tab {
  padding: 10px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #999;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.category-tab:hover {
  color: #666;
}

.category-tab.active {
  color: #4a90d9;
  border-bottom-color: #4a90d9;
  font-weight: bold;
}

.category-panel {
  display: none;
}

.category-panel.active {
  display: block;
}

/* 採寸ガイド */
.pet-measure-guide {
  background: #f0f7ff;
  border: 1px solid #c8ddf0;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.pet-measure-guide h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: #4a7a9b;
}

.pet-measure-guide ul {
  padding-left: 18px;
  margin: 0;
}

.pet-measure-guide li {
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
  line-height: 1.5;
}

/* ヒントテキスト */
.hint {
  font-size: 12px;
  color: #999;
}

/* アイテムグリッド */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.item-card {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.item-card:hover {
  border-color: #4a90d9;
  box-shadow: 0 2px 12px rgba(74, 144, 217, 0.2);
  transform: translateY(-2px);
}

.item-card.selected {
  border-color: #4a90d9;
  background: #f0f7ff;
}

.item-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.item-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: #333;
}

.item-card p {
  font-size: 12px;
  color: #888;
  line-height: 1.4;
}

/* プリセットボタン */
.preset-selector {
  margin-bottom: 20px;
}

.preset-selector label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #555;
}

.preset-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 8px 20px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.preset-btn:hover {
  border-color: #4a90d9;
}

.preset-btn.active {
  border-color: #4a90d9;
  background: #4a90d9;
  color: #fff;
}

/* 寸法フォーム */
.dims-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.dim-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dim-field label {
  font-size: 14px;
  font-weight: bold;
  color: #555;
}

.dim-field .input-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dim-field input[type="number"] {
  width: 100px;
  padding: 8px 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  text-align: right;
}

.dim-field input[type="number"]:focus {
  border-color: #4a90d9;
  outline: none;
}

.dim-field .unit {
  font-size: 14px;
  color: #888;
}

.dim-field input[type="range"] {
  width: 100%;
  margin-top: 4px;
}

/* バリデーション */
.validation-feedback {
  margin-bottom: 16px;
  min-height: 24px;
}

.validation-ok {
  color: #4caf50;
  font-size: 14px;
}

.validation-warn {
  color: #ff9800;
  font-size: 14px;
}

.validation-error {
  color: #f44336;
  font-size: 14px;
}

/* 詳細設定 */
.advanced-options {
  margin-bottom: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
}

.advanced-options summary {
  cursor: pointer;
  font-size: 14px;
  color: #666;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 14px;
}

.option-row label {
  color: #555;
}

.option-row select,
.option-row input[type="number"] {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

/* ナビゲーションボタン */
.step-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  gap: 12px;
}

.btn-back {
  padding: 10px 24px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  transition: all 0.2s;
}

.btn-back:hover {
  border-color: #bbb;
  color: #333;
}

.btn-next {
  padding: 10px 32px;
  border: none;
  border-radius: 8px;
  background: #4a90d9;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-next:hover {
  background: #3a7bc8;
}

.btn-primary {
  padding: 12px 36px;
  border: none;
  border-radius: 8px;
  background: #e67e22;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #d35400;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* プレビュー */
.preview-container {
  text-align: center;
  margin: 20px 0;
  padding: 20px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

.preview-container svg {
  max-width: 100%;
  height: auto;
}

.size-summary {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

.size-summary h3 {
  font-size: 15px;
  margin-bottom: 8px;
  color: #555;
}

.size-summary table {
  width: 100%;
  border-collapse: collapse;
}

.size-summary td {
  padding: 4px 8px;
  font-size: 14px;
  border-bottom: 1px solid #e0e0e0;
}

.size-summary td:first-child {
  font-weight: bold;
  color: #666;
  width: 120px;
}

/* 印刷設定 */
.print-options {
  margin-bottom: 20px;
}

.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.radio-group label {
  font-size: 14px;
  cursor: pointer;
}

.print-notice {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.print-notice p {
  margin-bottom: 8px;
  font-size: 14px;
}

.print-notice ul {
  padding-left: 20px;
}

.print-notice li {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}

/* レンダー状態 */
.render-status {
  text-align: center;
  padding: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #4a90d9;
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ダウンロード */
.download-area {
  text-align: center;
  padding: 24px;
  background: #e8f5e9;
  border-radius: 12px;
  margin-top: 20px;
}

.download-area p {
  font-size: 16px;
  color: #388e3c;
  margin-bottom: 12px;
}

.btn-download {
  display: inline-block;
  padding: 14px 40px;
  background: #4caf50;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-download:hover {
  background: #388e3c;
  color: #fff;
}

/* レスポンシブ */
@media (max-width: 600px) {
  #sewing-app {
    padding: 10px;
  }

  .sewing-steps {
    gap: 4px;
  }

  .sewing-step {
    padding: 6px 10px;
    font-size: 11px;
  }

  .step-label {
    display: none;
  }

  .item-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .dims-form {
    grid-template-columns: 1fr;
  }

  .step-nav {
    flex-direction: column;
  }

  .btn-next, .btn-primary {
    width: 100%;
    text-align: center;
  }
}
