/* 基本的なページ設定 */
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background-color: #f0f4f8;
  padding: 20px;
  margin: 0; /* ブラウザのデフォルトマージンをリセット */
}

/* ページ全体のタイトル */
h1 {
  font-family: "Mochiy Pop One", sans-serif;
  color: #4a4a4a;
  text-align: center; /* テキストを中央揃え */
  margin-bottom: 20px;
}

/* アプリのコンテナ設定 */
.letter-app-container {
  /* ★★★ この margin: auto; でコンテナ自体が中央に配置されます ★★★ */
  margin-left: auto;
  margin-right: auto;

  max-width: 950px;
  width: 100%;

  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* --- ここから下は変更ありません --- */

/* 左側の操作パネル */
.editor-panel {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 右側のプレビューパネル */
.canvas-panel {
  flex: 2;
  min-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* プレビューエリア */
#preview-area {
  width: 100%;
  max-width: 500px;
  border: 1px dashed #ccc;
  background-color: #fff;
  border-radius: 5px;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

#preview-area img {
  width: 100%;
  height: auto;
  display: block;
}

/* 入力欄やボタンの共通スタイル */
textarea,
select,
button,
input[type="color"] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
  box-sizing: border-box;
  cursor: pointer;
}

textarea {
  height: 150px;
  resize: vertical;
  font-family: "Yomogi", "Kiwi Maru", "Mochiy Pop One", "Kaisei Decol",
    "Hina Mincho", "Zen Kurenaido", sans-serif;
}

input[type="color"] {
  height: 50px;
  padding: 5px;
}

label {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 14px;
  color: #333;
  display: block;
}

/* 便箋セレクター */
.stationery-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 10px;
}

.stationery-thumb {
  width: 100%;
  height: 60px;
  border: 3px solid transparent;
  border-radius: 8px;
  object-fit: cover;
  transition: all 0.2s ease-in-out;
}

.stationery-thumb:hover {
  transform: scale(1.05);
  border-color: #a9c7ff;
}

.stationery-thumb.selected {
  border-color: #007bff;
  box-shadow: 0 0 8px rgba(0, 123, 255, 0.5);
}

/* ページナビゲーション */
#page-navigation {
  display: none;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
}

#page-navigation button {
  width: auto;
  padding: 8px 15px;
  background-color: #6c757d;
  color: white;
  border: none;
}

#page-navigation button:disabled {
  background-color: #c0c0c0;
  cursor: not-allowed;
}

#page-indicator {
  font-weight: bold;
  font-size: 16px;
  min-width: 80px;
  text-align: center;
}

/* ボタン類 */
#update-button {
  background-color: #007bff;
  color: white;
  font-weight: bold;
  border: none;
  margin-top: auto;
}
#update-button:hover {
  background-color: #0056b3;
}

#save-button {
  background-color: #28a745;
  color: white;
  font-weight: bold;
  border: none;
}
#save-button:hover {
  background-color: #218838;
}
