/* -----------------------------------
  全体フォントと背景
----------------------------------- */

/* ページ全体の背景色と文字色、基本フォント・サイズ・行間 */
body {
  background-color: #121212;
  color: #e0e0e0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 20px;
}

/* -----------------------------------
  見出しスタイル
----------------------------------- */

/* 最上位見出し（大見出し）サイズと色、下余白 */
h1 {
  font-size: 20px;
  color: #ffffff;
  margin-bottom: 16px;
}

/* 中見出しサイズと色、下余白 */
h2 {
  font-size: 18px;
  color: #ffffff;
  margin-bottom: 14px;
}

/* 小見出しサイズと色、下余白 */
h3 {
  font-size: 16px;
  color: #ffffff;
  margin-bottom: 12px;
}

/* -----------------------------------
  リンクスタイル
----------------------------------- */

/* リンク色と装飾 */
a {
  color: #66b2ff;
  text-decoration: none;
}

/* ホバー時のリンク下線 */
a:hover {
  text-decoration: underline;
}

/* -----------------------------------
  入力フォーム関連スタイル
----------------------------------- */

/* テキスト、数値、メール、パスワード、テキストエリア、セレクトボックスの背景色・文字色・枠線・角丸・パディング・文字サイズ */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
}

/* チェックボックスのサイズ拡大と色、カーソル形状 */
input[type="checkbox"] {
  transform: scale(1.2);
  accent-color: #66b2ff;
  cursor: pointer;
}

/* -----------------------------------
  ボタン共通スタイル
----------------------------------- */

/* ボタンの背景色・文字色・枠なし・パディング・文字サイズ・角丸・カーソル・背景色変化・右マージン */
button {
  background-color: #333;
  color: #fff;
  border: none;
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  margin-right: 8px;   /* ボタン間のスペースを追加 */
}

/* ホバー時の背景色変化 */
button:hover {
  background-color: #555;
}

/* 削除ボタン用の赤系背景色 */
button.delete-btn {
  background-color: #b00020;
}

/* 削除ボタンホバー時の暗め赤背景色 */
button.delete-btn:hover {
  background-color: #900;
}

/* 登録ボタン用ブルー系背景色 */
button.register-btn {
  background-color: #1c3f5f;
}

/* 登録ボタンホバー時ブルー系濃い色 */
button.register-btn:hover {
  background-color: #285377;
}

/* 更新ボタン用グリーン系背景色 */
button.update-btn {
  background-color: #235d3a;
}

/* 更新ボタンホバー時グリーン系濃い色 */
button.update-btn:hover {
  background-color: #2e7d51;
}

/* 操作ボタン縦並び */
.action button {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}

/* 最後のボタンの下マージンなし */
.action button:last-child {
  margin-bottom: 0;
}

/* -----------------------------------
  無効化されたボタンのスタイル
----------------------------------- */

/* ボタン無効時の透明度とクリック無効化 */
button[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

/* -----------------------------------
  テーブルレイアウト
----------------------------------- */

/* テーブル幅全体100%、固定幅テーブルレイアウト、セルの境界線処理、文字サイズ */
table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

/* テーブルヘッダー背景色と文字色 */
thead {
  background-color: #222;
  color: #fff;
}

/* テーブルボディの偶数行背景色 */
tbody tr:nth-child(even) {
  background-color: #1c1c1c;
}

/* テーブルボディの奇数行背景色 */
tbody tr:nth-child(odd) {
  background-color: #2a2a2a;
}

/* セル共通パディング・ボーダー・テキスト揃え・縦揃え */
th, td {
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

/* 画像カラムの幅と中央寄せ */
.pic {
  width: 80px;
}

/*IDカラムの幅*/
.id {
  width: 120px; 
}

/*名前カラムの幅*/
.name {
  width: 120px;
}

/* 説明カラムの文字サイズ・幅・折返し禁止 */
.explanation{
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

/* カテゴリカラムの文字サイズ・幅・折返し禁止 */
.category{
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

/* 並び順カラムの幅 */
.sort {
  width: 80px;
}

/* 日付カラムの文字サイズ・幅・折返し禁止 */
.date {
  font-size: 12px;
  width: 150px;
  white-space: nowrap;
}

/* 価格カラムの幅*/
.priceModifier{
  width: 120ps;
}

/* 売り切れチェックボックスの幅 */
.soldOut{
  width: 100px;
}

/* 操作ボタンカラム幅・折返し禁止・中央寄せ */
.action {
  width: 80px; /* 調整可：90px〜120pxくらいが目安 */
  white-space: nowrap;
  text-align: center;
}

/* -----------------------------------
  カラム名行のスタイル調整
----------------------------------- */

/* 見出し行を太字にして少し下余白をつける */
.header-row {
  font-weight: bold;
  margin-bottom: 8px;
}

/* -----------------------------------
  コンテナレイアウト
----------------------------------- */

/* 最大幅960pxで中央寄せ */
.container {
  max-width: 960px;
  margin: auto;
}

/* -----------------------------------
  フォーム全体のスタイル
----------------------------------- */

/* 背景色、パディング、角丸、影 */
form {
  background: #1a1a1a;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

/* -----------------------------------
  ヘッダー
----------------------------------- */

/* ヘッダー部分を左右に間隔を空けて配置 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* -----------------------------------
  option-edit & option-upload用の行
----------------------------------- */

/* 横並びで中央寄せ、アイテム間は20pxの隙間、下マージン */
.value-row {
  display: flex;
  align-items: center;
  gap: 20px; /* ← ここが重要 */
  margin-bottom: 10px;
}

/* -----------------------------------
  option-edit テーブルカラム幅調整
----------------------------------- */

/* 名前セル幅250px、横並び中央寄せ、間隔8px */
.name-cell {
  width: 250px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 名前入力欄の背景色・文字色・枠・角丸・パディング・文字サイズ */
.name-input {
  flex: 1;
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
}

/* 価格入力欄の幅・背景色・文字色・枠・角丸・パディング・文字サイズ */
.price-input {
  width: 100px;
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
}

/* チェックボックスの大きさと色、カーソル */
.available-checkbox {
  transform: scale(1.2);
  accent-color: #66b2ff;
  cursor: pointer;
}

/* -----------------------------------
  ドラッグハンドルアイコン
----------------------------------- */

/* ドラッグ用の手のカーソルと基本サイズ */
.drag-handle {
  cursor: grab;
  display: inline-flex;
  justify-content: center;  /* 横方向中央寄せ */
  align-items: center;      /* 縦方向中央寄せ */
  width: 18px;
  height: 18px;
  position: relative;
  user-select: none;
}

.drag-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background-color: #888;
  border-radius: 50%;
  /* 2列3行の6個ドット */
  box-shadow:
    0 -6px #888,    /* 上段左 */
    6px -6px #888,  /* 上段右 */
    0 0 #888,       /* 中段左 */
    6px 0 #888,     /* 中段右 */
    0 6px #888,     /* 下段左 */
    6px 6px #888;   /* 下段右 */
  transform: translate(-50%, -50%);
}

.selectedOptionsList .drag-handle::before {
  top: 70%; /* 下げたい位置 */
}

/* -----------------------------------
  ドラッグ中の行の見た目
----------------------------------- */

/* ドラッグで移動中の行を半透明にして分かりやすく */
.sortable-ghost {
  opacity: 0.5;
}

/* -----------------------------------
  1. 親カテゴリのチェックボックス行全体
----------------------------------- */

/* 親カテゴリチェックボックス行の横並び・中央寄せ・アイテム間隔・フォントサイズ・行間・余白調整 */
.parent-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

/* -----------------------------------
  2. チェックボックス自体
----------------------------------- */

/* チェックボックスのマージン・パディングリセット */
.parent-option input[type="checkbox"] {
  margin: 0;
  padding: 0;
}

/* -----------------------------------
  ワイドフォームの入力関連
----------------------------------- */

/* ワイドフォーム内のテキスト、数値、メール、パスワード、テキストエリア、セレクトボックスの幅・ボックスサイズ・文字サイズ・パディング・最小高さ・下マージン・角丸・枠線・背景色・文字色・フォーカス時の枠線変化 */
.wide-form input[type="text"],
.wide-form input[type="number"],
.wide-form input[type="email"],
.wide-form input[type="password"],
.wide-form textarea,
.wide-form select {
  width: 80%;
  box-sizing: border-box;
  font-size: 16px;
  padding: 8px 12px;
  min-height: 36px;
  margin-bottom: 16px;
  border-radius: 6px;
  border: 1px solid #555;
  background-color: #1e1e1e;
  color: #e0e0e0;
  transition: border-color 0.3s ease;
}

/* ワイドフォーム内の入力要素フォーカス時の枠線色変化とアウトライン除去 */
.wide-form input[type="text"]:focus,
.wide-form input[type="number"]:focus,
.wide-form input[type="email"]:focus,
.wide-form input[type="password"]:focus,
.wide-form textarea:focus,
.wide-form select:focus {
  border-color: #66b2ff;
  outline: none;
}

/* -----------------------------------
  サブカテゴリ表示用テキストエリア（ワイドフォーム内）
----------------------------------- */

/* サブカテゴリ表示エリアの背景色・文字色・パディング・枠線・幅・ボックスサイズ・文字サイズ・最小高さ・下マージン */
form.wide-form #subCategoryDisplay {
  background-color: #1e1e1e;
  color: #e0e0e0;
  padding: 8px 12px;
  border: 1px solid #444;
  width: 80%;                  /* 他のフォーム要素と揃える */
  box-sizing: border-box;
  font-size: 16px;
  min-height: 36px;
  margin-bottom: 16px;
}

/* -----------------------------------
  ローディングスピナー（丸く回るアニメーション）
----------------------------------- */

/* スピナーの大きさ・ボーダー設定・角丸・回転アニメーション・余白 */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  display: inline-block;
  vertical-align: middle;
}

/* スピナーの回転アニメーション */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* -----------------------------------
  ファイル名省略スタイル（画像プレビュー内）
----------------------------------- */

/* 画像ファイル名の文字サイズ・折返し禁止・省略・最大幅・上余白・中央寄せ・テキスト選択禁止 */
≈ .filename {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  margin-top: 4px;
  text-align: center;
  user-select: none;
}

/* -----------------------------------
  モーダルウィンドウ（ポップアップ）全体のスタイル
----------------------------------- */

/* モーダルの非表示・固定位置・全画面幅・背景の半透明黒・中央寄せ */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* モーダル内コンテンツの最大幅・最大高さ・角丸・影 */
.modal-content {
  max-width: 80%;
  max-height: 70vh;
  border-radius: 8px;
  box-shadow: 0 0 10px #000;
}

/* モーダルの閉じるボタンの位置・色・サイズ・カーソル */
.modal-close {
  position: absolute;
  top: 20px; right: 30px;
  color: #fff;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
}

/* -----------------------------------
  モーダルのナビゲーションボタン（左右矢印）
----------------------------------- */

/* ナビゲーションボタンの位置・サイズ・文字色・カーソル・ユーザー選択無効・パディング・角丸・縦位置調整・背景半透明黒 */
.modal-nav {
  position: absolute;
  top: 50%;
  font-size: 48px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  user-select: none;
  padding: 12px;
  border-radius: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.4);
}

/* 左矢印ボタンの位置 */
.modal-prev { left: 30px; }

/* 右矢印ボタンの位置 */
.modal-next { right: 30px; }

/* -----------------------------------
  送料オプションの余白
----------------------------------- */

/* 送料オプション部分の下マージン */
.shipping-options {
  margin-bottom: 20px;
}

/* -----------------------------------
  送料オプションの余白
----------------------------------- */

/* 送料オプション部分の下マージン */
.shipping-options {
  margin-bottom: 20px;
}

/* -----------------------------------
  フォームのエラーメッセージ表示
----------------------------------- */

/* エラーメッセージの赤文字、少し下余白 */
.error-message {
  color: #f44336;
  font-size: 13px;
  margin-top: 4px;
  margin-bottom: 8px;
}

/* -----------------------------------
  小さい補足テキスト
----------------------------------- */

/* フォーム説明用の小さな文字 */
.small-text {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* -----------------------------------
  メディアクエリ（レスポンシブ対応）
----------------------------------- */

/* 画面幅が600px以下の場合 */
@media screen and (max-width: 600px) {
  /* コンテナ幅を狭くして左右のパディングを増やす */
  .container {
    padding: 10px;
  }

  /* フォーム要素の幅を100%に */
  .wide-form input[type="text"],
  .wide-form input[type="number"],
  .wide-form input[type="email"],
  .wide-form input[type="password"],
  .wide-form textarea,
  .wide-form select,
  form.wide-form #subCategoryDisplay {
    width: 100%;
  }

  /* テーブルのフォントサイズを少し小さく */
  table {
    font-size: 12px;
  }

  /* ボタンのパディングを小さく */
  button {
    padding: 6px 10px;
    font-size: 13px;
  }

  /* 画像カラム幅を狭く */
  .pic {
    width: 60px;
  }
}


/* ===== 共通ラベル表示の調整 ===== */
label {
  display: block;
  margin: 8px 0 4px;
}

/* ===== サブカテゴリ表示エリアの見た目 ===== */
#subCategoryDisplay {
  padding: 6px 8px;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: #1e1e1e;
  color: #e0e0e0;
  min-height: 30px;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow-x: auto;
}

/* ===== ファイル名表示（画像） ===== */
.image-filename {
  text-align: center;
  font-size: 12px;
  margin-top: 4px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* ===== 売り切れチェックボックスの下に余白追加 ===== */
#soldOutCheckbox {
  margin-bottom: 16px;
}

/* ===== 配送方法チェックボックス：左インデント + 縦並び ===== */
.shipping-options label {
  padding-left: 1em;
  display: block;
}

/* ===== 画像プレビュー（既にstyle.cssにあった部分、重複排除済） ===== */
.image-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.image-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 50px;
}
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid #ccc;
  padding: 2px;
  cursor: move;
  border-radius: 4px;
}
.delete-image {
  position: absolute;
  top: 7px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  padding: 0;
}

/* 発売日など共通フォーム用スタイル */
.dark-input {
  padding: 6px 8px;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: #1e1e1e;
  color: #e0e0e0;
  width: 250px; /* 必要に応じて調整 */
}

.dark-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* 横並びと中央揃え */
.release-soldout-container {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.release-group label,
.soldout-group label {
  display: block;
  margin-bottom: 4px;
}

.soldout-check {
  display: flex;
  align-items: center;
  gap: 6px;
}

.soldout-check input[type="checkbox"] {
  transform: translateY(8px); /* ← これ追加 */
}


/* スライダーのサムネイル画像を小さくする */
.slider-thumb img {
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
  border: 1px solid #ccc;
  border-radius: 4px;
}





input[type="text"] {
  padding: 6px 10px;
  font-size: 14px;
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
}
.meta {
  font-size: 13px;
  color: #aaa;
  text-align: right;
}
.sub-input {
  flex: 1;
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 10px;
}

/* テーブルセルの縦位置を中央に揃える */
#subcategory-list tr td {
  vertical-align: middle;
}

/* 削除ボタンの上下マージンをリセット */
#subcategory-list tr td button {
  margin-top: 0;
  margin-bottom: 0;
}


/*.商品追加などの画面の検索タグ */
.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 4px 8px;
  background: #1e1e1e;
  cursor: pointer;
}