/* tools/_common.css — ダークモード固定・全ツール共通スタイル */

/* ── Reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f0f0f;
  color: #e8e8e8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 80px;
}

/* ── Back link ── */
a.back {
  align-self: flex-start;
  color: #555;
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 32px;
}
a.back:hover { color: #aaa; }

/* ── Header ── */
header { text-align: center; margin-bottom: 40px; }
header h1 { font-size: 1.6rem; font-weight: 700; color: var(--color, #e8e8e8); }
header p { margin-top: 6px; font-size: 0.82rem; color: #555; }

/* ── Card ── */
.card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 24px;
}

/* ── Field ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 0.75rem; color: #666; text-transform: uppercase; letter-spacing: 0.08em; }
.field-hint { font-size: 0.75rem; color: #444; }
.field-header { display: flex; align-items: center; justify-content: space-between; }
.section-title { font-size: 0.72rem; color: #555; text-transform: uppercase; letter-spacing: 0.08em; }

/* ── Input / Select / Textarea ── */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="email"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: #111;
  border: 1px solid #2e2e2e;
  border-radius: 8px;
  color: #e8e8e8;
  font-size: 0.95rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 72px; }
input:focus, select:focus, textarea:focus { border-color: var(--color, #4a9eff); }
select option { background: #1a1a1a; }
input[type="checkbox"],
input[type="radio"] { accent-color: var(--color, #4a9eff); width: 16px; height: 16px; }
input[type="range"] { accent-color: var(--color, #4a9eff); width: 100%; cursor: pointer; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: #ccc; cursor: pointer; }

/* ── Buttons ── */
.btn-primary {
  background: var(--color, #4a9eff);
  border: none;
  border-radius: 8px;
  color: #0f0f0f;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  transition: filter 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-primary.sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-primary.full { width: 100%; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }

.btn-secondary {
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #aaa;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 18px;
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover { background: #333; color: #ddd; }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-icon {
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #aaa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: #333; color: #fff; }
.btn-icon.copied { color: #6dda6d; border-color: #3a5a3a; }

.btn-copy {
  background: none;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #555;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 3px 10px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-copy:hover { color: #ccc; border-color: #555; }
.btn-copy.copied { color: #6dda6d; border-color: #6dda6d; }

/* ── Tabs（ピルスタイル） ── */
.tabs {
  display: flex;
  gap: 4px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 4px;
}
.tab {
  background: transparent;
  border: none;
  border-radius: 7px;
  color: #555;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 500;
  padding: 7px 14px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.tab:hover { color: #aaa; }
.tab.active { background: #2e2e2e; color: #e8e8e8; }

/* ── Badge ── */
.badge {
  background: #2a2a2a;
  border-radius: 20px;
  color: #666;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  transition: background 0.2s, color 0.2s;
}
.badge.active { background: var(--color, #4a9eff); color: #0f0f0f; }
.badge.match { background: #13351f; color: #6dda6d; }
.badge.mismatch { background: #3a1416; color: #ff6b6b; }

/* ── Alert ── */
.alert {
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.85rem;
  border: 1px solid;
  display: flex;
  gap: 9px;
  align-items: center;
  width: 100%;
}
.alert-info    { background: #0d1f30; border-color: #1a3a5a; color: #9ac0e8; }
.alert-success { background: #0f2a1e; border-color: #2a6a4a; color: #6dda6d; }
.alert-warning { background: #2e2410; border-color: #5a4a1a; color: #e5c07b; }
.alert-error   { background: #2e1416; border-color: #5a2a2c; color: #ff8b8b; }

/* ── Chip / Tag ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1f1f1f;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 0.8rem;
  color: #ccc;
}
.chip button { background: none; border: none; color: #777; cursor: pointer; font-size: 0.9rem; line-height: 1; padding: 0; }
.chip button:hover { color: #ff6b6b; }

/* ── Progress ── */
.progress { height: 8px; width: 100%; background: #1f1f1f; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--color, #4a9eff); border-radius: 999px; transition: width 0.3s; }

/* ── Spinner ── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid #2a2a2a;
  border-top-color: var(--color, #4a9eff);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toggle switch ── */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: #2e2e2e; border-radius: 999px; cursor: pointer; transition: 0.2s; }
.switch .track::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #888; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .track { background: var(--color, #4a9eff); }
.switch input:checked + .track::before { transform: translateX(20px); background: #0f0f0f; }

/* ── Tooltip ── */
.tip { position: relative; cursor: help; border-bottom: 1px dotted #555; }
.tip:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #2a2a2a; color: #e8e8e8; border: 1px solid #3a3a3a; border-radius: 6px;
  padding: 5px 10px; font-size: 0.75rem; white-space: nowrap; z-index: 100; pointer-events: none;
}

/* ── Drop zone ── */
.drop-zone {
  border: 2px dashed #2a2a2a;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  color: #555;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-size: 0.9rem;
}
.drop-zone:hover,
.drop-zone.over { border-color: var(--color, #4a9eff); color: var(--color, #4a9eff); background: rgba(74,158,255,0.04); }

/* ── Empty state ── */
.empty { width: 100%; text-align: center; color: #444; font-size: 0.88rem; padding: 26px; }

/* ── Output ── */
.output { background: #111; border: 1px solid #2a2a2a; border-radius: 8px; padding: 12px 14px; }
.output-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #1e1e1e; }
.output-row:last-child { border-bottom: none; }
.output-label { font-size: 0.75rem; color: #555; }
.output-value { font-size: 0.9rem; color: #e8e8e8; }
.output-highlight { background: rgba(255,255,255,0.08); border-radius: 3px; padding: 0 3px; }

/* ── Swatch / kbd ── */
.swatch { display: inline-block; border-radius: 8px; border: 1px solid #333; }
kbd {
  background: #1a1a1a; border: 1px solid #333; border-bottom-width: 2px;
  border-radius: 5px; padding: 2px 7px;
  font-family: 'SF Mono','Consolas',monospace; font-size: 0.78rem; color: #ddd;
}
