/* ═══════════════════════════════════════════════════
   Tools — Shared Styles
   ═══════════════════════════════════════════════════ */

/* ── Tool Input Area ─────────────────────────────── */
.tool-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-family: monospace;
  font-size: 0.76rem;
  line-height: 1.5;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-1);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tool-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.tool-textarea::placeholder { color: var(--text-3); font-size: 0.73rem; }

/* ── Tool Input (single line) ────────────────────── */
.tool-input-lg {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-1);
  font-family: monospace;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tool-input-lg:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.tool-input-lg::placeholder { color: var(--text-3); }

/* ── Result Cards ─────────────────────────────────── */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.result-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  transition: var(--transition);
}

.result-card:hover { border-color: var(--border-2); }
.result-card--success { border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.04); }
.result-card--error { border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.04); }
.result-card--warn { border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.04); }

.result-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.result-value {
  font-family: monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
}

.result-value--sm {
  font-size: 0.82rem;
  font-weight: 500;
}

.result-sub {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 0.15rem;
}

/* ── JWT Specific ──────────────────────────────────── */
.jwt-parts { display: flex; flex-direction: column; gap: 0.5rem; }

.jwt-part {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  overflow: hidden;
}

.jwt-part-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.jwt-header-label { color: var(--red); }
.jwt-payload-label { color: var(--accent); }
.jwt-signature-label { color: var(--blue); }

.jwt-json {
  font-family: monospace;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
}

.jwt-expiry {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: monospace;
  margin-top: 0.35rem;
}

.jwt-expiry--valid { background: var(--green-glow); color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.jwt-expiry--expired { background: var(--red-glow); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }

/* ── Crontab Specific ──────────────────────────────── */
.cron-description {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.95rem;
  color: var(--text-1);
  line-height: 1.55;
  margin-bottom: 0.5rem;
}

.cron-next-runs {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cron-next-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: monospace;
  font-size: 0.74rem;
  color: var(--text-2);
  padding: 0.3rem 0.5rem;
  background: var(--surface);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.cron-next-num {
  font-weight: 700;
  color: var(--accent);
  min-width: 1.2rem;
}

/* ── Preset Buttons ────────────────────────────────── */
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.preset-btn {
  padding: 0.22rem 0.5rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.68rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: monospace;
}

.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.preset-btn--sm { font-size: 0.62rem; padding: 0.15rem 0.35rem; }
.preset-group { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: center; }

.utm-tabs { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.utm-tab-btn { background: none; border: none; padding: 0.4rem 0.8rem; color: var(--text-2); cursor: pointer; font-size: 0.85rem; border-radius: 4px; transition: var(--transition); }
.utm-tab-btn:hover { background: var(--surface-2); }
.utm-tab-btn.active { background: var(--accent); color: #fff; }

/* ── Validation Table ──────────────────────────────── */
.val-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
}

.val-table th {
  background: var(--surface-2);
  padding: 0.4rem 0.6rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
}

.val-table td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-family: monospace;
  font-size: 0.72rem;
  word-break: break-all;
  max-width: 200px;
}

.val-table tr:last-child td { border-bottom: none; }
.val-table tr:hover { background: rgba(255,255,255,0.015); }

.val-pass { color: var(--green); }
.val-fail { color: var(--red); }
.val-warn { color: var(--yellow); }

/* ── Salary Gauge ──────────────────────────────────── */
.salary-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.salary-bar-wrap {
  background: var(--surface);
  border-radius: var(--radius-xs);
  overflow: hidden;
  height: 24px;
  border: 1px solid var(--border);
}

.salary-bar {
  height: 100%;
  border-radius: var(--radius-xs);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
  min-width: 20px;
}

.salary-bar--net { background: var(--green); }
.salary-bar--federal { background: var(--accent); }
.salary-bar--state { background: var(--yellow); }
.salary-bar--fica { background: var(--blue); }

/* ── Regex Match Highlights ────────────────────────── */
.regex-match {
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 3px;
  padding: 0 0.15rem;
  color: var(--accent);
  font-weight: 600;
}

.regex-no-match {
  color: var(--text-3);
  text-decoration: line-through;
}

/* ── ASCII Table Styles ────────────────────────────── */
.ascii-style-select {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

/* ── Tool-Specific Responsive ──────────────────────── */
@media (max-width: 600px) {
  .result-grid { grid-template-columns: 1fr; }
  .result-value { font-size: 1.1rem; }
}
