/* リセットとベーススタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* ヘッダー */
header {
  text-align: center;
  padding: 24px 0;
  background-color: #fff;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}

header p {
  font-size: 14px;
  color: #666;
}

/* メインコンテンツ */
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

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

/* コントロールパネル */
.control-panel,
.preview-panel {
  background-color: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.control-panel h2,
.preview-panel h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a1a;
}

/* フォームグループ */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #333;
}

/* セレクト */
select {
  width: 100%;
  height: 44px;
  padding: 8px 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

select:hover {
  border-color: #999;
}

select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* カラーピッカー */
.color-input-group {
  display: flex;
  gap: 8px;
}

input[type="color"] {
  width: 60px;
  height: 44px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  background-color: #fff;
}

input[type="text"] {
  flex: 1;
  height: 44px;
  padding: 8px 12px;
  font-size: 16px;
  font-family: 'Courier New', monospace;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.15s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* ドロップゾーン */
.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  background-color: #fafafa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drop-zone:hover {
  border-color: #007bff;
  background-color: #f0f8ff;
}

.drop-zone.drag-over {
  border-color: #007bff;
  background-color: #e6f2ff;
}

.drop-zone p {
  margin-bottom: 8px;
  color: #666;
}

.drop-zone-hint {
  font-size: 14px;
  color: #999;
}

input[type="file"] {
  display: none;
}

.file-label {
  display: inline-block;
  padding: 8px 16px;
  background-color: #007bff;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.15s ease;
}

.file-label:hover {
  background-color: #0056b3;
}

/* 画像プレビュー */
.image-preview {
  margin-top: 16px;
  text-align: center;
}

.image-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* スライダー */
input[type="range"] {
  width: 100%;
  height: 6px;
  background: #ddd;
  border-radius: 3px;
  outline: none;
  margin-bottom: 16px;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #007bff;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #0056b3;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #007bff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: background-color 0.15s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  background: #0056b3;
}

/* ボタン */
.btn-primary,
.btn-secondary {
  width: 100%;
  height: 48px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.btn-primary:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-secondary:hover {
  background-color: #5a6268;
}

/* プレビューパネル */
.canvas-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 16px;
  min-height: 300px;
}

#preview-canvas {
  max-width: 100%;
  height: auto;
  border: 1px solid #ddd;
  background-color: #fff;
}

.preview-note {
  margin-top: 12px;
  font-size: 13px;
  color: #666;
  text-align: center;
}

/* フッター */
footer {
  text-align: center;
  padding: 16px 0;
  color: #666;
  font-size: 14px;
}

footer a {
  color: #007bff;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* アクセシビリティ: フォーカスインジケータ */
*:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}
