/* Tool-specific: Hash Generator
   Layout-only. All colors come from src/shared/css/base.css tokens. */

#text-hash #input,
#hash-output-grid textarea {
  font-family: var(--font-mono, monospace);
}

/* Mode toggle (text / file) and encoding toggle (hex / base64) share the
   segmented control pattern. Each radio is hidden; the <label> styles
   pretend to be the button. */
.segmented {
  display: inline-flex;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-0);
  overflow: hidden;
  background: var(--color-bg-elevated);
}

.segmented input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  cursor: pointer;
  border-right: 1px solid var(--color-rule);
  user-select: none;
}

.segmented label:last-of-type {
  border-right: 0;
}

.segmented input[type="radio"]:checked + label {
  background: var(--color-signal-soft);
  color: var(--color-signal);
  font-weight: 600;
}

/* Options row: encoding toggle + live-mode + secondary controls. */
.hash-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.hash-options__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Four-panel hash output grid. Collapses to 2-up at medium widths and 1-up
   on narrow screens via auto-fit + minmax. */
.hash-output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.hash-output-grid .panel {
  margin-bottom: 0;
}

.hash-output-grid textarea {
  min-height: 96px;
  word-break: break-all;
  font-size: var(--text-xs);
}

.hash-output-grid .actions-row {
  margin-top: var(--space-2);
}

/* Per-panel header row with optional deprecation badge. */
.hash-panel__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Deprecation pill — uses the signal-soft token (terracotta tint) as a
   warning surrogate since the project does not ship a dedicated --color-warn
   token. Consistent with the privacy-callout signal-soft usage in JWT
   Decoder. */
.badge--deprecated {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  background: var(--color-signal-soft);
  color: var(--color-signal);
  border: 1px solid var(--color-signal);
  border-radius: var(--radius-0);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  cursor: help;
  position: relative;
}

/* Custom tooltip rendered via ::after pseudo-element using the title attribute
   text. Shows immediately on hover/focus (vs. native title's 1.5s delay), and
   on tap via JS-toggled [data-open="true"] for touch devices. Native title=
   stays in place as a screen-reader fallback. */
.badge--deprecated::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + var(--space-2));
  left: 50%;
  transform: translateX(-50%);
  white-space: normal;
  width: max-content;
  max-width: 22rem;
  padding: var(--space-2) var(--space-3);
  background: var(--color-ink);
  color: var(--color-bg-elevated);
  border: 1px solid var(--color-rule);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 4px 12px rgba(20, 17, 13, 0.15);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms ease, visibility 0s linear 120ms;
  z-index: 10;
}
.badge--deprecated::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--color-ink);
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease, visibility 0s linear 120ms;
  z-index: 11;
}
.badge--deprecated:hover::after,
.badge--deprecated:focus::after,
.badge--deprecated:focus-visible::after,
.badge--deprecated[data-open="true"]::after,
.badge--deprecated:hover::before,
.badge--deprecated:focus::before,
.badge--deprecated:focus-visible::before,
.badge--deprecated[data-open="true"]::before {
  opacity: 1;
  visibility: visible;
  transition: opacity 120ms ease;
}

/* RTL nudge — left: 50% is relative to the badge's own box, so the LTR
   centering math works identically in Arabic / Urdu layouts. Selector is
   kept (empty rule) to document the intent for future maintainers. */
[dir="rtl"] .badge--deprecated::after,
[dir="rtl"] .badge--deprecated::before { /* anchor positions still work — same left:50% logic */ }

/* Compact per-panel copy button (smaller than the primary copy button). */
.hash-output-grid .btn--ghost {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

/* File dropzone — re-use the canonical .dropzone pattern from base.css
   where possible. Local overrides only nudge spacing. */
#file-hash .dropzone {
  margin-top: var(--space-2);
}

/* Large-file warning band beneath the dropzone. */
.file-warning {
  display: block;
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-signal-soft);
  border-left: 2px solid var(--color-signal);
  color: var(--color-ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

[dir="rtl"] .file-warning {
  border-left: 0;
  border-right: 2px solid var(--color-signal);
}

/* RTL: the per-panel header row flips automatically via flex. */
