/**===============================
 * アンケート全体に対するCSS
 ================================*/

 /* ボタン隠し バリデーションエラー */
[data-name="hideButton"] .spg-question__erbox .sv-string-viewer {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  line-height: 1.5 !important;
}

.sv-components-container-contentBottom{
  background-color: var(--sjs-footer-backcolor, transparent);
}

.sl-table__cell .svc-action-button .svc-question-link__set-button {
  overflow: visible !important;
  display: block !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
}

/* プログレスボタンページタイトルのカスタムスタイル */
 .sd-progress-buttons__page-title { 
  font-family: "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, Osaka, "ＭＳ Ｐゴシック", "MS P Gothic", sans-serif !important;
  font-weight: 400 !important;  /* 通常のフォントウェイト、太字を避ける */
  height: 20px !important;
  padding: 0px !important;
  width: 250px !important;
  margin: 0 0 0 auto !important;  /* margin-left: auto を使用して右端に配置 */
  color: #00761c !important;
  font-size: 120% !important;  /* 元の80%から1.5倍に拡大 */
  flex-grow: 0 !important;  /* 残りのスペースを占有しない */
  justify-content: flex-end !important;  /* コンテンツを右揃え */
}

/*コンポーネントコンテナのホバー（固定）効果をキャンセル */
.sv-components-container-center,
.sv-root--sticky-top .sv-components-container-center {
  position: static !important;
  box-shadow: none !important;
  z-index: auto !important;
  transition: none !important;
  animation: none !important;
  transform: none !important;
  will-change: auto !important;
  border-left: none !important;
  border-right: none !important;
}

.sd-navigation__prev-btn,
.sd-navigation__next-btn{
  border: 1px solid #525252 !important;
  box-shadow: 1px 2px 2px #ccc, 0 1px 1px #fff inset !important;
  background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#fff)) !important;
  color: #363636 !important;
}

.sd-body.sd-body--static{
  padding-bottom: calc(6 * (var(--sjs-base-unit, var(--base-unit, 8px)))) !important;
}

/* Header を参考に作成している、オリジナルのもの */
.sv-footer__content--static{
  max-width:calc(90*(var(--sjs-base-unit, var(--base-unit, 8px))));
  margin-left:auto;
  margin-right:auto;
}

/**===============================
 * SAに関するCSS(マトリクスのSAはマトリクスの箇所に記載)
 ================================*/

/* SAの外枠 */
.sd-radio__decorator{
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 25px !important;
  height: 25px !important;
  margin-right: 4px !important;
  vertical-align: middle !important;
  box-shadow: 0 1px 3px -1px #eee !important;
  -webkit-box-shadow: 0px 0px 3px #555, 1px 1px 2px #aaa inset !important;
  -webkit-border-radius: 15px !important;
  border: #fff 1px solid !important;
}
/* SAの選択の要素 通常時は非表示でないと常に表示された状態になる */
.sd-radio__decorator::before,
.sd-radio__decorator::after {
  content: "" !important;
  display: none !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 15px !important;
  height: 15px !important;
  background: #000 !important;
  border-radius: 50% !important;
  -webkit-border-radius: 50% !important;
}

/* チェック状態の時のみ黒丸を表示 */
.sd-item--checked.sd-radio--checked .sd-radio__decorator::before,
.sd-item--checked .sd-radio__decorator::before {
  display: block !important;
}

/* decoratorを相対位置に設定 */
.sd-radio__decorator {
  position: relative !important;
}

/* SAチェックに関する背景色 */
.sd-item--checked .sd-radio__decorator{
  background: #fff !important;
}

/**===============================
 * MAに関するCSS(マトリクスのMAはマトリクスの箇所に記載)
 ================================*/

/* MAの外枠 */
.sd-checkbox__decorator{
  -webkit-appearance: none !important;
  width: 25px !important;
  height: 25px !important;
  margin-right: 2px !important;
  vertical-align: middle !important;
  -webkit-box-shadow: 0px 0px 3px #555, 1px 1px 2px #aaa inset !important;
  -webkit-border-radius: 2px !important;
  border: #fff 1px solid !important;
}
.sd-checkbox__svg {
  display: none !important;
}

/* MAの選択の要素 通常時は非表示 */
.sd-checkbox__decorator::before {
  content: "" !important;
  display: none !important;
  position: relative !important;
  top: -2px !important;
  left: 0px !important;
  width: 12px !important;
  height: 22px !important;
  border-bottom: #333 6px solid !important;
  border-right: #333 6px solid !important;
  -webkit-transform: rotate(45deg) !important;
  transform: rotate(45deg) !important;
}


/* チェック状態の時のみ表示 */
.sd-item--checked.sd-checkbox--checked .sd-checkbox__decorator::before,
.sd-item--checked .sd-checkbox__decorator::before {
  display: block !important;
}

/* MAチェックに関する背景色 */
.sd-item--checked .sd-checkbox__decorator{
  background: #fff !important;
}

/**===============================
 * マトリクスに関するCSS
 ================================*/

/* マトリクス（文字）のスタイルで必要 */
.sd-table__cell textarea.sd-comment,
.sd-table__cell input.sd-input{
  /* テキストエリア自体の設定 */
  margin: 0 auto; /* 左右の余白を自動で均等に */
  display: block; /* ブロック要素として表示 */
}

/* マトリクス（文字）のスタイルで必要 */
.sd-table__cell textarea.sd-comment {
  width: 100% !important;
}

.matrix-text-container {
  width: auto !important;
  overflow-x: auto;
}

.matrix-ma-container,
.matrix-sa-container,
.matrix-sd-container {
  overflow-x: auto;
  max-width: 100%;
}

.create-matrix-table {
  width: 50%;
  max-width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
}

.matrix-text-container .create-matrix-table {
  table-layout: auto !important;
}

/* 左列は内容に応じて伸びる */
.matrix-text-container .create-matrix-table th:first-child,
.matrix-text-container .create-matrix-table td:first-child {
  width: 150px;
  min-width: 150px;
  white-space: nowrap;
}

.matrix-text-container .create-matrix-table th {
  white-space: normal;
}

.create-matrix-table th,
.create-matrix-table td {
  border: 1px solid #ddd;
  padding: 4px 4px;
  text-align: center;
  font-size: 0.9em;
  min-width: 60px;
}

.create-matrix-table th {
  background-color: #f8f9fa;
  font-weight: normal;
  height: 120px;
  vertical-align: middle;
  text-orientation: upright;
  white-space: nowrap;
  padding: 4px 10px;
}

.vertical-text {
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  min-height: 100px;
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.create-matrix-table th:first-child,
.create-matrix-table td:first-child{
  background-color: #f8f9fa;
  width: 150px;
  min-width: 150px;
}

.sd-matrix-table th:last-child,
.sd-matrix-table td:last-child{
  background-color: #f8f9fa;
  width: 150px;
  min-width: 150px;
  max-width: 200px;
}

.create-matrix-table td:first-child,
.sd-matrix-table td:last-child{
  text-align: left;
}

.create-matrix-table tr:hover {
  background-color: #f5f5f5;
}

.create-matrix-row {
  left: 0;
  z-index: 50;
}

/* Sticky有効時のコンテナスタイル */
.matrix-height {
  overflow-y: auto;
  max-height: 400px;
}

/* Sticky有効時のヘッダースタイル */
.matrix-header-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Sticky無効時のヘッダースタイル */
.matrix-header-static {
  position: static;
}

/*====
 * マトリクスのSAのスタイル
 ====*/

/* マトリクス内のラジオボタンに同じスタイルを適用 */
.radio-input {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 25px !important;
  height: 25px !important;
  margin-right: 4px !important;
  vertical-align: middle !important;
  box-shadow: 0 1px 3px -1px #eee !important;
  -webkit-box-shadow: 0px 0px 3px #555, 1px 1px 2px #aaa inset !important;
  -webkit-border-radius: 15px !important;
  border: #fff 1px solid !important;
  position: relative !important;
  cursor: pointer !important;
  transform: scale(1.0) !important;
}

/* 選択状態の背景色 */
.radio-input:checked {
  background: #fff !important;
}

/* チェック状態の黒丸 */
.radio-input::before {
  content: "" !important;
  display: none !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 15px !important;
  height: 15px !important;
  background: #000 !important;
  border-radius: 50% !important;
  -webkit-border-radius: 50% !important;
}

/* チェック状態の時のみ黒丸を表示 */
.radio-input:checked::before {
  display: block !important;
}

/*====
 * マトリクスのMAのスタイル
 ====*/
/* チェックボックスの基本スタイル */
.checkbox-input {
  -webkit-appearance: none !important;
  width: 25px !important;
  height: 25px !important;
  margin-right: 2px !important;
  vertical-align: middle !important;
  -webkit-box-shadow: 0px 0px 3px #555, 1px 1px 2px #aaa inset !important;
  -webkit-border-radius: 2px !important;
  border: #fff 1px solid !important;
  position: relative !important;
  cursor: pointer !important;
  transform: scale(1.0) !important;
}

/* 選択状態の背景色 */
.checkbox-input:checked {
  background: #fff !important;
}

/* チェックマーク（通常時は非表示） */
.checkbox-input::before {
  content: "" !important;
  display: none !important;
  position: relative !important;
  top: -2px !important;
  left: 6px !important;
  width: 12px !important;
  height: 22px !important;
  border-bottom: #333 6px solid !important;
  border-right: #333 6px solid !important;
  -webkit-transform: rotate(45deg) !important;
  transform: rotate(45deg) !important;
}

/* チェック状態の時のみチェックマークを表示 */
.checkbox-input:checked::before {
  display: block !important;
}

.checkbox-wrapper {
  margin-bottom: 5px;
}

/* ヘッダーセルのレイアウト調整 */
.header-cell-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  height: 100%;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .create-matrix-table {
    font-size: 0.85em;
  }

  .create-matrix-table th,
  .create-matrix-table td {
    padding: 8px 4px;
    min-width: 36px;
  }

  .create-matrix-table th {
    height: 100px;
    font-size: 0.9em;
    padding: 4px 2px;
  }

  .create-matrix-table th:first-child,
  .create-matrix-table td:first-child,
  .sd-matrix-table th:last-child,
  .sd-matrix-table td:last-child{
    width: 80px;
    min-width: 80px;
    padding: 8px 6px;
    line-height: 1.3;
  }

  .radio-input {
    transform: scale(1.0) !important;
  }
  .radio-cell {
    padding: 10px 4px;
  }
}


/**===============================
 * TextareaにかかわるCSS
 ================================*/

textarea.sd-input {
  width: auto !important;
}

.checkbox-textarea-container {
  display: flex;
  flex-direction: column;
}

.textarea-container {
  display: block;
  gap: 5px;
}

.textarea-container textarea{
  display: block;
  margin-bottom: 10px;
}

.matrix-input-text {
  border: 1px solid #000 !important;
  border-radius: 6px !important;
  resize: none;
}

/* 縦書きテキストエリアのスタイル */
.vertical-writing-textarea {
  writing-mode: vertical-rl;
  text-orientation: upright;
  resize: none;
  font-family: sans-serif;
  line-height: 1.5;
  padding: 8px;
  margin-left: 10px;
  border: 1px solid #000 !important;
  border-radius: 6px !important;
}

/* 縦書きラベル */
.vertical-text-label {
  writing-mode: vertical-rl;
  text-orientation: upright;
  min-width: 1em;
  align-items: center;
  justify-content: center;
}

/* テキストエリアコンテナの調整 */
.textarea-container.vertical {
  display: flex;
  flex-direction: row; /* 横に並べる */
  gap: 10px;
  min-height: 120px;
  margin-left: 10px;
}

/* 縦書きプレースホルダーテキストの調整 */
.vertical-writing-textarea::placeholder {
  writing-mode: vertical-rl;
  text-orientation: upright;
}

/* MA設問のテキストエリア */
.radio-input-text ,
.checkbox-input-text {
  resize: none;
  padding: 8px;
  margin-left: 10px;
  border: 1px solid #000 !important;
  border-radius: 6px !important;
}

@media (max-width: 768px) {
  .vertical-writing-textarea {
    width: 60px;
    font-size: 0.9em;
    padding: 5px;
  }
}

/**===============================
 * コピーダイアログのスタイル（copy専用）
 ================================*/

/* コピーダイアログのサイズ調整 */

.sv-popup.sv-property-editor.choices-copy-dialog > .sv-popup__container {
  min-width: 600px !important;
  max-width: 900px !important;
  width: 600px !important;
}

.sv-popup.sv-property-editor.choices-copy-dialog > .sv-popup__container > .sv-popup__body-content {
  min-width: 600px !important;
  max-width: 800px !important;
  width: 100% !important;
}


/* ダイアログ内のsurveyコンテナ */
.sv-popup.sv-property-editor.choices-copy-dialog .sd-root-modern,
.sv-popup.sv-property-editor.choices-copy-dialog .sd-body {
  min-width: 500px !important;
  white-space: normal;
  word-break: break-all;
}

/* ダイアログ内のチェックボックスリストのスタイル */
.sv-popup.sv-property-editor.choices-copy-dialog .sd-selectbase {
  max-height: 300px;
  overflow-y: auto;
}

/* ダイアログ内の質問要素のスタイル */
.sv-popup.sv-property-editor.choices-copy-dialog .sd-question__content {
  min-width: 400px;
}

/* ダイアログ内のドロップダウンのスタイル */
.sv-popup.sv-property-editor.choices-copy-dialog .sd-dropdown {
  min-width: 400px;
}

/* 確認メッセージの文字色を黒に */
.sv-popup.sv-property-editor.choices-copy-dialog .sd-page__description {
  color: #000000 !important;
  white-space: pre-line;
}
