/* Approximated from DataBoard.vue style to render red boxes */
.databoard-number {
  background-color: salmon;
  height: 80px;
  width: 80px;
  text-align: center;
  color: white;
  font-size: xx-large;
  display:flex; align-items:center; justify-content:center;
  border-radius: 4px;
}
.adjustor button {
  border: none;
  border-radius: 5px;
  padding: 0.25em 1em 0.25em 1em;
  color: white;
}

/* ----- overrides to mimic original banner ----- */
header { background:#e9e9e9; border-bottom:2px solid #efe7b0; }
header nav { height:64px; display:flex; justify-content:space-between; align-items:center; }
header nav .logo { height:30px; }
header nav a { font-size:22px; font-weight:600; color: #3a3a3a; text-decoration:none; margin-left:.5rem; }

/* ----- adjustor inputs look ----- */
.adjustor input.form-control { text-align:center;
  background:#dcdcdc;
  border:none;
  height:36px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
  font-size: 15px;
  color: gray;
  width: 80px !important;
}
.adjustor button.bg-lightblue{
  background:#8cc6d4;
  color:#fff;
  min-width:38px;
}
.adjustor .bg-blue{ background:#6c9bd2; color:#fff; }
.adjustor td{ padding:.4rem .35rem; vertical-align:middle; }

/* ----- History panel layout to match original ----- */
.hist-panel table { margin:0 auto; }
.hist-panel td{ padding:.35rem .5rem; vertical-align:middle; }
.hist-panel .label{ color:#666; width:48px; text-align:right; }
.hist-panel .btn-info{ background:#23b1cd; border:0; }
.hist-panel .btn-danger{ background:#df5c5c; border:0; }

/* unify selects/inputs sizing */
.form-select-sm, .form-control-sm, .hist-panel select, .hist-panel input[type="date"]{
  min-width:120px;
  height:32px;
  padding:.25rem .5rem;
}

/* v4 refinements */
.hist-panel td{ text-align:center; vertical-align:middle; }
.hist-panel .label{ text-align:center; width:auto; color:#666; }

/* Center the value text inside selects (supported browsers) */
.hist-panel select{ text-align:center; text-align-last:center; }

/* Imitate original light-grey inputs */
.hist-panel select,
.hist-panel input[type="date"]{
  background:#dcdcdc;
  border:none;
  border-radius:4px;
  height:36px;
  padding:0 .5rem;
  font-size:15px;
  color:gray;
}

.hist-panel select:focus,
.hist-panel input[type="date"]:focus{
  outline:none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}

/* 包一層容器，讓偽元素渲染在容器上 */
.hist-panel .select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

/* 把 select 改成沒有預設箭頭 */
.hist-panel .select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  background: #dcdcdc;
  border: none;
  border-radius: 4px;
  height: 36px;
  padding: 0 2rem 0 0.5rem;
  text-align: center;
  text-align-last: center;
}

/* 在 wrapper 上放箭頭 */
.hist-panel .select-wrapper::after {
  content: "";
  position: absolute;
  pointer-events: none;
  top: 50%;
  right: 0.8rem;
  transform: translateY(-50%);
  border-width: 12px 8px 0 8px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

/* 基本互動狀態：游標、過場動畫 */
.bg-blue,
.bg-lightblue,
.btn {
  cursor: pointer;
  transition: transform .03s ease, filter .06s ease, box-shadow .06s ease;
}

/* hover 稍微亮一點 */
.bg-blue:hover,
.bg-lightblue:hover,
.btn:hover {
  filter: brightness(1.03);
}

/* active（按下去）微內凹 + 微位移 */
.bg-blue:active,
.bg-lightblue:active,
.btn:active {
  filter: brightness(0.92);
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.12);
}

/* 鍵盤可及性：focus-visible 時給外框 */
.bg-blue:focus-visible,
.bg-lightblue:focus-visible,
.btn:focus-visible {
  outline: 2px solid rgba(0,123,255,.5);
  outline-offset: 2px;
}

/* iOS 點擊高亮去除（可選） */
.bg-blue, .bg-lightblue, .btn {
  -webkit-tap-highlight-color: transparent;
}

/* 全頁灰蓋 + 轉圈圈 */
.app-overlay{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(1px);
  display: none;               /* 預設不顯示 */
  align-items: center; justify-content: center;
  z-index: 2000;               /* 蓋過頁面所有元素 */
  pointer-events: all;         /* 攔截所有點擊 */
}
.app-overlay.show{ display: flex; }

.app-overlay-box{
  display:flex; flex-direction:column; align-items:center;
  padding:16px 18px; border-radius:10px;
  background: rgba(0,0,0,.35);
  color:#fff; min-width:140px;
}

/* 轉圈圈（純 CSS，不依賴外部套件） */
.spinner{
  width:56px; height:56px;
  border:5px solid #fff;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.18);
}
.msg{ margin-top:10px; font-weight:600; letter-spacing:.05em; }

@keyframes spin{ to { transform: rotate(360deg); } }

/* 顯示遮罩時禁止滾動（可選） */
body.loading{ overflow: hidden; }

/* 讓圖表高度為視窗高度 70%（可依需要再調） */
#chart-wrap {
  height: 70vh;
}
#chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

#g-btn-wrapper {
  display: flex;
  justify-content: center; /* ⭐️ 核心：橫向置中 */
  margin-top: 20px;        /* 可選：控制與上方距離 */
}

#g-btn {
  display: inline-block;
}
