/* ファイル: /html/user_data/assets/css/customize.css */

/* ─── モーダル本体 ─── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 10000;
}

.modal-content {
  background: #fff;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 900px;
  max-height: 90%;
  overflow: auto;
  position: relative;
}

/* ─── ここが肝心！グリッドを modal-body に当てる ─── */
.modal-content .modal-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "image info"
    "image control";
  gap: 20px;
  padding: 20px;
}

/* 説明文を黒に */
.modal-content .modal-body .info-area {
  margin-top:20px;
  color: #000;
}
.modal-content .modal-body .info-area h2{
  color: #000;
  font-weight: bold;
}

.modal-content .modal-body .info-area p {
  color: #000;
}

/* 左：画像エリア */
.modal-content .image-area {
  grid-area: image;
  background: #f2f2f2;
  display: flex;
  flex-direction: column; 
  justify-content: flex-start;
  align-items: center;
  padding: 8px;
}

/* canvas とボタンの間に余白 */
.modal-content .modal-body .image-area canvas {
  margin-bottom: 5px;  /* 円の下にスペース確保 */
}

/* 「作成完了」ボタンをフッター風に */
.modal-content .modal-body .confirm-area {
  width: 100%;
  text-align: center;
}

.modal-content .modal-body .confirm-area button {
  border: 1px solid #333;
  background: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

/* 作成完了ボタンは .confirm-area 内にある想定 */
.modal-content .confirm-area {
  width: 100%;
  text-align: center;
  margin-top: 10px;
}

/* 右上：説明エリア */
.modal-content .info-area {
  grid-area: info;
  overflow: auto;
  line-height: 1.6;
}
.modal-content .info-area h2 {
  margin-top: 0;
  font-size: 1.2em;
}
.modal-content .info-area p {
  margin-bottom: 1em;
}

/* 右下：コントロールエリア */
.modal-content .control-area {
  grid-area: control;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-content .control-area > div {
  display: flex;
  gap: 20px;
}
.modal-content .control-area .slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-content .control-area input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
}
.modal-content .control-area input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #666;
  border-radius: 50%;
  margin-top: -6px;
}
.modal-content .control-area button {
  border: 1px solid #333;
  background: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ×ボタン */
.modal-content #btnCancel {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  z-index: 1;
}

/* レスポンシブ：横幅狭いときは縦積み */
@media (max-width: 768px) {
  .modal-content .modal-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "info"
      "control";
    grid-template-rows: auto auto auto;
  }
}

/* --- Style4: スライダー操作時のポップアップ --- */
.slider-container {
  position: relative;
}
.slider-popup {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  display: none;
}
.slider-popup::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0,0,0,0.7) transparent transparent transparent;
}
