* {
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: normal;
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Yu Gothic", "YuGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Arial", "Meiryo", sans-serif;

  width: 100vw;
  min-height: 100vh;
  background-size: auto;
  background-repeat: repeat;
  background-attachment: fixed;
}

button {
  cursor: pointer;
}

p {
  line-height: 1.8em;
}

p+p {
  margin-top: 1em;
}

.CENTER {
  text-align: center;
}

.BOLD {
  font-weight: bold;
}


footer {
  text-align: center;
  font-size: 0.7em;
  color: #999999;
  padding: 2.5em 0 2em 0;
}



/* ========== admin section ========== */

#bg {
  padding: 0 10px;
}

#list,
#enq_ctrl {
  height: 100vh;
  background-image: url(bg2.png);
}

#list #wrap,
#form_edit #wrap,
#enq_ctrl #wrap {
  width: calc(100vw - 100px);
  min-width: 1000px;
  margin: 0 auto;
  padding-top: 6em;
  box-sizing: border-box;
}

#list #wrap2,
#form_edit #wrap2,
#enq_ctrl #wrap2 {
  width: 100%;
  padding: 2em;
  margin-top: 0.5em;
  border: 1px #333333 solid;
  background: #ffffff;
  box-sizing: border-box;
}

#list button,
#enq_ctrl button {
  border: 1px #000000 solid;
  border-radius: 0.333em;
  padding: 0.25em 0.666em;
  vertical-align: baseline;
}



/************ list *************/

#list table.enqList {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5em 0 0 0;
}

#list table.enqList th,
#list table.enqList td {
  border: 1px #999999 solid;
  padding: 0.25em 0.5em;
  text-align: center;
}

#list table.enqList th {
  background: #DDDDDD;
}

#list table.enqList td {
  font-size: 0.9em;
  padding: 0.5em;
  text-align: center;
}

#list span.datetime {
  display: inline-block;
  vertical-align: middle;
  margin-right: 1em;
  text-align: right;
}

#list span.line-through {
  text-decoration: line-through;
  color: #999999;
}





/************ form_edit ***********/
#form_edit button,
#form_edit select,
#form_edit input[type=checkbox],
#form_edit label {
  cursor: pointer;
}

#form_edit input[type=text] {
  padding: 0 2px;
  box-sizing: border-box;
  font-size: 1em;
}

#form_edit input[type="checkbox"],
#form_edit input[type="radio"] {
  margin-right: 0.2em;
}

#form_edit select {
  width: 20em;
  font-size: 1em;
}

#form_edit textarea {
  padding: 0.3em 0.5em;
  box-sizing: border-box;
  font-size: 1.0em;
  line-height: 1.5em;
  width: 100%;
  height: 10em;
  resize: vertical;
}

#form_edit button.ui {
  height: 2.0em;
  padding: 0 0.5em;
}

#form_edit button.addBtn {
  padding: 0.3em 0.6em;
  border-radius: 0.2em;
  border: 1px #999999 solid;
}

#form_edit button.delBtn {
  border: 0;
}

#form_edit button.upBtn,
#form_edit button.downBtn {
  border: 0;
}

#form_edit .material-symbols-outlined {
  vertical-align: -0.25em;
}

#form_edit .header_bar {
  position: fixed;
  top: 0;
  width: 60%;
  height: 2.5em;
  line-height: 2.5em;
  background: #DDDDDD;
}

#form_edit #column_container {
  display: flex;
}

#form_edit #column_L {
  position: fixed;
  top: 2.5em;
  left: 0;
  overflow: scroll;
  width: 60%;
  height: calc(100vh - 2.5em);
  padding: 1em;
  box-sizing: border-box;
}

#form_edit #column_R {
  position: fixed;
  right: 0;
  overflow: scroll;
  width: 40%;
  height: 100vh;
  padding: 0;
  box-sizing: border-box;
  border-left: 4px #CCCCCC solid;
}

#form_edit .prev_sw {
  position: fixed;
  top: 0;
  width: 100%;
  height: 2.5em;
  line-height: 2.5em;
  padding-left: 1em;
  background: #FFFFFF;
}

#form_edit #formarea {
  width: 100%;
  margin-top: 1em;
}

#form_edit #jsonData {
  width: 100%;
  height: calc(100vh - 3em);
  font-size: 0.9em;
  border: 0;
  margin-top: 2.5em;
  padding: 1em;
}

#form_edit #preview {
  position: fixed;
  top: 2.5em;
  overflow: scroll;
  width: 40%;
  height: calc(100vh - 2.5em);
  padding: 1em 1em 0 1em;
  box-sizing: border-box;
  font-size: 0.9em;
}

#form_edit div.questionContainer {
  /* border: 1px #000000 solid; */
  text-align: center;
}

#form_edit div.questionContainer2 {
  display: flex;
  width: 100%;
  margin: 1.5em 0;
  padding: 1.5em 2em;
  box-sizing: border-box;
  line-height: 2em;
  text-align: left;
  border-radius: 1em;
  background: #eeeeee;
}

#form_edit hr {
  margin: 1em 0;
}

#form_edit #overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: #FFFFFF;
  background: rgba(0, 0, 0, 0.75);
  text-align: center;
  z-index: 100;
}





/********** enq_ctrl **********/

#enq_ctrl h3 {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 0.5em;
}


/* ========== public section ========== */

#index,
#start,
#form {
  height: 100vh;
  background-image: url(bg.png);
}

#index #wrap,
#start #wrap,
#form #wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 6em 1em 0 1em;
  box-sizing: content-box;
}

#index #wrap2,
#start #wrap2,
#form #wrap2 {
  width: 100%;
  padding: 40px;
  margin-top: 0.5em;
  border: 1px #333333 solid;
  background: #ffffff;
  box-sizing: border-box;
}

#index h1 {
  text-align: center;
  font-size: 3em;
  font-weight: bold;
}

#start h1,
#form h1 {
  text-align: center;
  font-size: 2em;
  font-weight: bold;
}

#start h3 {
  text-align: center;
  font-size: 1.5em;
  font-weight: bold;
  margin: 1em 0 0.5em 0;
}

#form h3 {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 0.5em;
}

#form div.enq_wrap {
  padding: 1em;
  margin-top: 1em;
  border: 1px #d7d7d7 solid;
  background: #f3f3f3;
}

#form select {
  width: 100%;
  height: 2em;
}

#form textarea {
  width: 100%;
  height: 7em;
  padding: 0.25em;
  box-sizing: border-box;
  resize: vertical;
}

#form input[type="text"] {
  padding: 0.25em;
  box-sizing: border-box;
  margin-right: 0.5em;
}

#form .addtxt {
  margin-bottom: 1em;
}

#form .row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 0.5em;
}

#form .label {
  flex: 0 0 4.5em;
  min-width: 4.5em;
  line-height: 2em;
}

#form .input-wrapper {
  flex: 1 1 auto;
  min-width: 0;
}

#form .input {
  width: 100%;
  min-width: 5em;
  box-sizing: border-box;
}

#form #postcode {
  max-width: 100px;
}

#form #autoAddressButton {
  margin-left: 0.5em;
  padding: 0.25em;
  font-size: 0.9em;
  height: auto;
}

/* ========== モバイル対応 ========== */
@media screen and (max-width: 768px) {

  #form #wrap {
    width: 100%;
    padding: 1em 0 0 0;
  }

  #form #wrap2 {
    padding: 10px;
  }

  #form select {
    height: 3em;
  }

}






/***** アンケートリスト *****/
#index button.enq_btn {
  width: 100%;
  padding: 0.75em 2em;
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

#index button.enq_btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#index button.enq_btn::after {
  content: '▶';
  position: absolute;
  right: 1.2em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2em;
  color: #6c757d;
  transition: color 0.3s ease, transform 0.3s ease;
}

#index button.enq_btn:hover::after {
  color: #007bff;
  transform: translateY(-50%) translateX(8px);
  animation: slideRight 0.6s ease-in-out infinite alternate;
}

@keyframes slideRight {
  0% {
    transform: translateY(-50%) translateX(0px);
  }

  100% {
    transform: translateY(-50%) translateX(12px);
  }
}

#index button.enq_btn+button.enq_btn {
  margin-top: 0.666em;
}

#index p.enq_name {
  font-weight: bold;
  font-size: 1.5em;
  margin: 0;
}

#index p.enq_close {
  font-size: 1.0em;
  margin: 0;
}

#index div.enq_none {
  text-align: center;
  padding: 0.5em;
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 8px;
}



/***** アンケート直前 *****/

#start button,
#form .btn {
  font-size: 1.2em;
  margin: 0 0.5em;
  padding: 0.5em 1em;
  border: 1px #333333 solid;
  border-radius: 2em;
}



/***** 規約 *****/

.kiyaku-wrapper {
  position: relative;
  height: 150px;
  margin-bottom: 25px;
}

.kiyaku {
  height: 100%;
  overflow-y: scroll;
  padding: 5px;
  border: solid 1px #dcdcdc;
}

.scroll-hint {
  position: absolute;
  bottom: 0.25em;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  border: 4px #FFFFFF solid;
  /* グレーの長方形 */
  padding: 0.4em 1em;
  /* 内側の余白 */
  border-radius: 1em;
  /* 角を少し丸く */
  display: none;
  /* 最初は隠す */
  text-align: center;
}

.scroll-hint::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  /* 大きめの三角形 */
  border-right: 10px solid transparent;
  border-top: 14px solid white;
  /* 白い三角形 */
  margin: 1px auto 3px;
  /* 上に少し隙間、下は中央 */
}

.scroll-hint span {
  color: white;
  font-size: 13px;
  display: block;
  /* 文字と三角形を縦に */
}






/****** フォームのエラーメッセージ *****/
@keyframes blinking {
  0% {
    opacity: 0.2;
  }

  100% {
    opacity: 1;
  }
}

div.error_msg {
  display: inline-block;
  animation: blinking 0.5s ease-in-out infinite alternate;
  color: #FF0000;
}

div.error_msg_email {
  display: block;
  animation: blinking 0.5s ease-in-out infinite alternate;
  color: #FF0000;
}

/***** エラーダイアログ *****/
div.error_dialog {
  display: inline-block;
  border: 1px #FF0000 solid !important;
  padding: 0.5em;
  margin: 0.5em 0;
  color: #FF0000;
}

/* フォームエディタ */
#form_edit footer {
  display: none;
}

#form_edit .questionContainer {
  margin-bottom: 1em;
}

#form_edit .questionContainer2 {
  display: flex;
  padding: 1em;
  background-color: #f5f5f5;
  border-radius: 4px;
}

#form_edit .question-content {
  flex-grow: 1;
}

#form_edit .question-row {
  display: flex;
  margin: 0.5em 0;
  align-items: center;
}

#form_edit .question-label {
  display: inline-block;
  width: 4em;
  margin-right: 0.5em;
}

#form_edit .question-input {
  flex-grow: 1;
}

#form_edit .question-select {
  flex-grow: 1;
}

#form_edit .button-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-left: 1em;
}

#form_edit .question-title {
  font-weight: bold;
}

#form_edit .min-required,
#form_edit .required {
  color: #990033;
}

#form_edit .preview-input {
  width: 100%;
}

#form_edit .preview-textarea {
  width: 100%;
  height: 4em;
}

#form_edit .preview-text-input {
  width: 50%;
  margin-left: 0.5em;
}

#form_edit .addBtn {
  width: 100%;
  padding: 0.5em;
  margin: 0.5em 0;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#form_edit .upBtn,
#form_edit .downBtn,
#form_edit .delBtn {
  padding: 0.25em;
  margin: 0.25em 0;
  background-color: #fff;
  border: 1px solid #ccc !important;
  border-radius: 5px;
  cursor: pointer;
}

#form_edit .upBtn:disabled,
#form_edit .downBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#form_edit .material-symbols-outlined {
  font-size: 1.2em;
  vertical-align: middle;
}

/* グラフ切り替えボタン */
.chart-switch {
  display: flex;
  gap: 0.5em;
  margin-bottom: 1em;
}

.chart-btn {
  padding: 0.5em 1em;
  border: 1px solid #ccc;
  background-color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chart-btn.active {
  background-color: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.chart-btn:hover {
  background-color: #f5f5f5;
}

.chart-btn.active:hover {
  background-color: #45a049;
}

/* タブ表示 */
.tab-container {
  margin-bottom: 0;
}

.tab-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 10px;
}

.tab-button {
  background: none;
  border: none;
  padding: 8px 15px;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  position: relative;
  transition: all 0.3s ease;
  font-weight: bold;
}

.tab-button img {
  height: 30px;
  vertical-align: middle;
}

.tab-button.active {
  color: #000;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #000;
}

.tab-button:hover {
  color: #000;
}

.show-deleted-container {
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 4px;
}