/* tool-base.css - 全ツール共通ベーススタイル */

:root {
  --blue:     #3b82f6;  --blue-dk:  #2563eb;
  --green:    #22c55e;  --green-dk: #16a34a;
  --red:      #ef4444;  --red-dk:   #dc2626;
  --orange:   #f97316;  --orange-dk:#ea580c;
  --text:     #1e293b;  --text-sub: #64748b;
  --bg:       #f8fafc;  --surface:  #ffffff;  --border: #e2e8f0;
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ヘッダー */
.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* メニューに戻るボタン */
.backmenu-button {
  padding: 0.45rem 1rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  font-size: 0.9rem;
  font-family: var(--font);
  transition: border-color 0.2s, color 0.2s;
}
.backmenu-button:hover { border-color: var(--blue); color: var(--blue); }

/* メインコンテンツ */
.tool-main {
  flex: 1;
  padding: 2rem 1rem;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

/* ページタイトル */
h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* カード */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* フォームグループ */
.form-group { margin-bottom: 1rem; }

label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-sub);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

/* 共通フォーム入力 */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
}
input[type="range"] {
  width: 100%;
  cursor: pointer;
  accent-color: var(--blue);
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--blue);
  cursor: pointer;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
textarea { resize: vertical; }

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s, transform 0.05s;
  text-decoration: none;
  line-height: 1;
}
.btn:hover  { background: var(--blue-dk); }
.btn:active { transform: scale(0.98); }
.btn:disabled {
  background: var(--border);
  color: var(--text-sub);
  cursor: not-allowed;
  transform: none;
}

.btn-full    { width: 100%; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); background: var(--surface); }

.btn-danger { background: var(--red); }
.btn-danger:hover { background: var(--red-dk); }

.btn-success { background: var(--green); }
.btn-success:hover { background: var(--green-dk); }

/* タブ切り替え */
.tab-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-sub);
  font-size: 0.875rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ダークモード */
html[data-theme="dark"] {
  --text:    #e2e8f0;
  --text-sub:#94a3b8;
  --bg:      #0f172a;
  --surface: #1e293b;
  --border:  #334155;
}
html[data-theme="dark"] input:not([type="range"]):not([type="color"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #0f172a;
}
html[data-theme="dark"] .btn-secondary {
  background: #1e293b;
}
html[data-theme="dark"] .btn-secondary:hover {
  background: #0f172a;
}
