/* Tool page styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f0e8;
  --ink: #1a1a18;
  --ink-muted: #6b6560;
  --gold: #c9992a;
  --gold-dark: #a67b1e;
  --accent: #2c4a3e;
  --accent-light: #3d6b5a;
  --surface: #fffdf8;
  --surface-alt: #f0ebe1;
  --border: #ddd5c8;
  --error: #b84040;
  --success: #2c6b4a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.back-bar {
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.back-bar a {
  font-size: 0.875rem;
  color: var(--ink-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.back-bar a:hover { color: var(--accent); }

/* TOOL LAYOUT */
.tool-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.tool-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.tool-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.tool-header h1 em {
  font-style: normal;
  color: var(--accent);
}

.tool-header p {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* SEARCH FORM */
.search-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.search-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.6rem;
}

.input-row {
  display: flex;
  gap: 0.75rem;
}

#mos-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

#mos-input:focus { border-color: var(--gold); }
#mos-input::placeholder { color: var(--ink-muted); opacity: 0.6; }

#translate-btn {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

#translate-btn:hover { background: var(--accent-light); }
#translate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* SEARCH SUGGESTIONS */
.suggestions {
  margin-top: 0.75rem;
}

.suggestions-label {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.suggest-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}

.suggest-chip:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
  background: var(--surface);
}

/* RESULT */
.result {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.result.visible { display: block; }

.result-header {
  background: var(--accent);
  color: #fff;
  padding: 1.5rem;
}

.result-header .branch-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.4rem;
}

.result-header .mos-code {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.result-header .mos-title {
  font-size: 0.9rem;
  opacity: 0.85;
}

.result-body {
  padding: 1.75rem;
}

.civ-role-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.civ-role-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

.civ-role-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
}

.salary-badge {
  text-align: right;
  flex-shrink: 0;
}

.salary-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

.salary-range {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-dark);
}

/* BULLETS */
.bullets-section h3 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.bullet-list { list-style: none; }

.bullet-list li {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
}

.bullet-list li:last-child { border-bottom: none; }

.bullet-num {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 0.1rem;
}

.copy-btn-row {
  padding: 1.25rem 1.75rem;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.12s;
}

.copy-btn:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.copy-btn.copied {
  border-color: var(--success);
  color: var(--success);
}

/* ERROR STATE */
.error-box {
  display: none;
  background: #fdf0f0;
  border: 1px solid #e8c0c0;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.error-box.visible { display: block; }

.error-box .err-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--error);
  margin-bottom: 0.35rem;
}

.error-box .err-body {
  font-size: 0.85rem;
  color: var(--error);
  opacity: 0.8;
}

/* LOADING */
.loading {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
}

.loading.visible { display: block; }

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 0.75rem;
}

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

.loading p {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* SEARCH RESULTS DROPDOWN */
.search-results {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 0.75rem;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}

.search-results.visible { display: block; }

.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface-alt); }

.result-item-left .result-code {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.1rem;
}

.result-item-left .result-title {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.result-item-right .result-role {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}

.result-item-right .result-branch {
  font-size: 0.7rem;
  color: var(--ink-muted);
  text-align: right;
}

/* ALL CODES LIST */
.all-codes {
  margin-top: 2.5rem;
}

.all-codes h3 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.code-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.code-chip {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}

.code-chip:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* FOOTER */
.tool-footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.tool-footer a { color: var(--accent); }