/* style.css — Admin UI upgraded styles */
/* color system */
:root{
  --bg: #fbfdff;
  --card: #ffffff;
  --muted: #6b7280;
  --border: #e6eef8;
  --primary: #2563eb; /* blue-600 */
  --primary-600: #1e40af;
  --accent: #06b6d4; /* teal-400 */
  --danger: #ef4444;
  --tag-bg: #eef2ff;
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.04);
  --shadow-md: 0 6px 18px rgba(2,6,23,0.08);
  --radius: 12px;
  --glass: rgba(255,255,255,0.6);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
}

/* page layout */
*{box-sizing:border-box}
html,body{height:100%}
body{
  font-family: Inter, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg, #f7fbff 0%, #fbfbff 100%);
  color: #0f172a;
  margin: 18px auto;
  max-width:1100px;
  padding: 14px;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
}

/* header */
header{
  display:flex;
  gap:16px;
  align-items:center;
  background: linear-gradient(90deg, rgba(255,255,255,0.6), rgba(255,255,255,0.45));
  padding:12px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
header h1{margin:0;font-size:1.25rem;letter-spacing:-0.02em}
header .controls{margin-left:auto;display:flex;gap:8px;align-items:center}

nav {
  margin-top: 12px;
  position: relative; /* インジケーターを絶対配置するため */
}
.center-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* タブ群 */
nav ul {
  width: 500px;
  padding: 6px; /* 見た目調整 */
  background-color: rgb(158, 158, 158);
  border-radius: 50px;
  display: flex;
  gap: 20px; /* 元の 50% は不安定なので具体値推奨 */
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 個々のタブ */
nav li.tab {
  position: relative;
  z-index: 2; /* テキストがインジケーターの上に来るように */
  padding: 8px 18px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: #222;
}

/* 選択中に色を変えたいなら active クラスで */
nav li.tab.active {
  color: #000;
}

/* インジケーター（細長い白い角丸） */
.tab-indicator {
  position: absolute;
  top: 6px; /* nav の上余白に合わせる */
  height: calc(100% - 12px); /* 少し上下に余白を残す */
  width: 60px; /* 初期値。JSで更新される */
  background: #fff;
  border-radius: 30px; /* ほそながい角丸 */
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transform: translateX(0);
  transition: transform 300ms cubic-bezier(.2,.9,.2,1), width 300ms cubic-bezier(.2,.9,.2,1);
  z-index: 1;
  pointer-events: none; /* タブクリックを妨げない */
}

/* form / boxes */
.box{
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  margin-top: 16px;
  box-shadow: var(--shadow-md);
}
label{display:block;margin:8px 0 6px;font-weight:600;color:var(--muted)}
input[type="text"], input[type="password"], textarea, select{
  width:100%;
  padding:10px 12px;
  margin: 10px 0;
  border-radius:10px;
  border:1px solid #dbeafe;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  transition: box-shadow .12s ease, border-color .12s ease, transform .06s ease;
  font-size:14px;
}
input:focus, textarea:focus, select:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(37,99,235,0.12);
  transform: translateY(-1px);
}

/* layout helpers */
.row{display:flex;gap:10px}
.row > *{flex:1}

/* buttons */
button{
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding:8px 12px;
  background: #f1f5f9;
  color: #071124;
  transition: transform .08s ease, box-shadow .08s ease, background .12s ease;
  box-shadow: none;
  font-weight:600;
}
button:hover{transform:translateY(-2px)}
button:active{transform:translateY(0)}
button:focus{outline: 3px solid rgba(37,99,235,0.14); outline-offset:2px}

/* primary / accent buttons */
button.primary{
  background: linear-gradient(180deg,var(--primary),var(--primary-600));
  color: #fff;
  box-shadow: 0 8px 20px rgba(37,99,235,0.14);
}
button.ghost{
  background: transparent;
  border:1px dashed #e6eef8;
}
button.warn{background:linear-gradient(180deg,#f97316,#fb923c);color:#fff}
button.danger{background:linear-gradient(180deg,#ef4444,#f97316);color:#fff}

/* small text */
.small{font-size:12px;color:var(--muted);margin-top:6px}

/* lists */
ul{list-style:none;padding:0;margin:0}
li{padding:8px 0;border-bottom:1px solid rgba(2,6,23,0.04)}
.meta{font-size:12px;color:var(--muted)}
.actions{display:flex;gap:8px}

/* tags (triggers) */
.tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.tag{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background: linear-gradient(180deg,var(--tag-bg),#f8fbff);
  border:1px solid rgba(99,102,241,0.06);
  color:#0f172a;
  font-size:13px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.03);
  transition: transform .08s ease, box-shadow .08s ease;
}
.tag:hover{transform:translateY(-3px);box-shadow:0 10px 28px rgba(15,23,42,0.06)}

/* reply item */
.reply-item{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:10px;background:linear-gradient(180deg,#fff,#fbfdff);border:1px solid rgba(2,6,23,0.03)}
.reply-row{display:flex;justify-content:space-between;align-items:center}
.reply-content{white-space:pre-wrap;font-size:14px;color:#06243a}

/* JSON editor area */
.json-area{
  height:320px;
  font-family: var(--mono);
  font-size:13px;
  white-space:pre;
  overflow:auto;
  resize:none;
  padding:12px;
  border-radius:10px;
  border:1px solid #e6eef8;
  background: linear-gradient(180deg,#fafcff,#ffffff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

/* file input row */
.file-row{display:flex;gap:8px;align-items:center;margin-top:8px}

/* fixed-height lists */
#repliesList, #messagesList{max-height:460px;overflow:auto;padding:4px}

/* error */
.error{color:var(--danger);font-weight:700;margin-top:8px}

/* responsive */
@media (max-width:720px){
  header{flex-direction:column;align-items:flex-start;gap:8px}
  .row{flex-direction:column}
  .tags{gap:6px}
}

/* subtle custom scrollbar (webkit) */
#repliesList::-webkit-scrollbar, #messagesList::-webkit-scrollbar, .json-area::-webkit-scrollbar{
  height:10px;width:10px;
}
#repliesList::-webkit-scrollbar-thumb, #messagesList::-webkit-scrollbar-thumb, .json-area::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(37,99,235,0.18), rgba(37,99,235,0.12));
  border-radius:999px;
}
#repliesList::-webkit-scrollbar-track, .json-area::-webkit-scrollbar-track{
  background: transparent;
}

/* focus improvements for accessibility */
button:focus, input:focus, textarea:focus, select:focus{
  box-shadow: 0 8px 20px rgba(37,99,235,0.12);
}

/* utility */
.hidden{display:none}
.padded{padding:12px}
