/* メインスタイル */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* レイアウトグリッド */
.main-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 992px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* コントロールパネル */
.control-panel {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  height: fit-content;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.settings-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #dee2e6;
}

.settings-section:last-of-type {
  border-bottom: none;
  margin-bottom: 15px;
}

.settings-section h2 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: #495057;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #212529;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input[type="range"] {
  width: calc(100% - 60px);
  vertical-align: middle;
}

.form-group span {
  display: inline-block;
  width: 50px;
  text-align: right;
  font-weight: 600;
  color: #007bff;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #6c757d;
  font-size: 0.875rem;
}

.form-group input[type="checkbox"] {
  margin-right: 8px;
}

/* アクションボタン */
.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #0056b3;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #545b62;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* プレビューコンテナ */
.preview-container {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 15px;
  height: calc(100vh - 200px);
}

@media (max-width: 768px) {
  .preview-container {
    grid-template-rows: 1fr 1fr;
  }
}

.preview-panel {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 10px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.preview-panel h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: #495057;
}

#canvas2d {
  width: 100%;
  flex: 1;
  border: 1px solid #ced4da;
  background: white;
}

#canvas3d {
  width: 100%;
  flex: 1;
  border: 1px solid #ced4da;
  background: #f0f0f0;
}

.dimensions-info {
  margin-top: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #495057;
}

/* ステータスメッセージ */
.status-message {
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 4px;
  display: none;
}

.status-message.info {
  background: #cfe2ff;
  border: 1px solid #b6d4fe;
  color: #084298;
  display: block;
}

.status-message.success {
  background: #d1e7dd;
  border: 1px solid #badbcc;
  color: #0f5132;
  display: block;
}

.status-message.error {
  background: #f8d7da;
  border: 1px solid #f5c2c7;
  color: #842029;
  display: block;
}

.status-message.warning {
  background: #fff3cd;
  border: 1px solid #ffecb5;
  color: #664d03;
  display: block;
}

/* 説明セクション */
.instructions {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-top: 30px;
}

.instructions h2 {
  margin-top: 0;
  color: #212529;
}

.instructions h3 {
  margin-top: 20px;
  color: #495057;
}

.instructions ol,
.instructions ul {
  line-height: 1.8;
  color: #495057;
}

/* ストラップ設定の表示制御 */
.strap-settings {
  display: none;
}

.strap-settings.active {
  display: block !important;
}

/* ローディングインジケータ */
.loading {
  position: relative;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #007bff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* グリッドオーバーレイ */
.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.3;
}