/* thedrawer/public/css/translator.css — BRIEF-123 */

/* ── Wrapper ── */

.tr-wrap {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 24px 16px;
}

/* ── Header ── */

.tr-header {
  text-align: center;
  margin-bottom: 16px;
}

.tr-title {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.tr-sub {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 300;
  color: rgba(248, 249, 247, 0.55);
}

/* ── Two-pane grid ── */

.tr-layout {
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  align-items: stretch;
}

/* ── Pane ── */

.tr-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: inset 0 0 0 0.5px rgba(46, 61, 58, 0.15);
  min-height: 260px;
}

/* ── Pane top ── */

.tr-pane-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Dialect select ── */

.tr-dialect {
  width: 100%;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--slate);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%232e3d3a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
  border: 1px solid rgba(46, 61, 58, 0.2);
  border-radius: 6px;
  padding: 8px 32px 8px 10px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.tr-dialect:focus {
  outline: none;
  border-color: var(--sage);
}

/* ── Dialect row (dropdown + info icon) ── */

.tr-dialect-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* ── Info icon ── */

.tr-info-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(46, 61, 58, 0.25);
  background: transparent;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
  color: rgba(46, 61, 58, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: border-color 0.12s, color 0.12s;
}

.tr-info-icon:hover {
  border-color: var(--sage);
  color: var(--sage);
}

/* ── Tooltip ── */

.tr-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #f4f8f6;
  border: 1px solid rgba(92, 138, 122, 0.3);
  border-radius: 4px;
  padding: 8px 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--slate);
  line-height: 1.4;
  max-width: 240px;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.tr-tooltip.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .tr-tooltip {
    max-width: 90vw;
  }
}

/* ── Regional toggle ── */

.tr-region {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tr-region-btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  padding: 4px 10px;
  border: 1px solid rgba(46, 61, 58, 0.2);
  border-radius: 4px;
  background: transparent;
  color: rgba(46, 61, 58, 0.65);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.tr-region-btn.is-active {
  border-color: var(--sage);
  color: var(--sage);
  background: rgba(92, 138, 122, 0.08);
}

.tr-region-btn:hover:not(.is-active) {
  border-color: rgba(46, 61, 58, 0.4);
  color: var(--slate);
}

/* ── Source textarea ── */

.tr-textarea {
  flex: 1;
  width: 100%;
  min-height: 160px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 300;
  color: var(--slate);
  line-height: 1.65;
  background: transparent;
  border: 1px solid rgba(46, 61, 58, 0.12);
  border-radius: 6px;
  padding: 12px;
  resize: none;
}

.tr-textarea:focus {
  outline: none;
  border-color: rgba(46, 61, 58, 0.3);
}

/* ── Output wrap (acts as container for all output states) ── */

.tr-output-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  border: 1px solid rgba(46, 61, 58, 0.12);
  border-radius: 6px;
  padding: 12px;
  overflow-y: auto;
}

/* ── Output textarea ── */

.tr-textarea--output {
  flex: 1;
  border: none;
  border-radius: 0;
  padding: 0;
  min-height: unset;
  resize: none;
  cursor: default;
}

.tr-textarea--output:focus {
  outline: none;
  border-color: transparent;
}

/* ── Idle placeholder ── */

.tr-idle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 300;
  color: rgba(46, 61, 58, 0.3);
  text-align: center;
}

/* ── Loading sequence ── */

.tr-loading {
  flex: 1;
  padding: 2px 0;
}

.tr-loading-step {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 300;
  color: rgba(46, 61, 58, 0.55);
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 280ms ease, transform 280ms ease;
}

.tr-loading-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tr-loading-step--waiting::after {
  content: '';
  display: inline-block;
  animation: tr-dots 1.4s infinite;
}

@keyframes tr-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* ── Error ── */

.tr-error {
  flex: 1;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 300;
  color: var(--rose);
  padding: 2px 0;
}

/* ── Rate limit message ── */

.tr-rate-limit-message {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 2px 0;
}

.tr-rate-limit-message p {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 300;
  color: rgba(46, 61, 58, 0.65);
  margin: 0;
}

.tr-rate-limit-message a {
  color: var(--sage);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tr-rate-limit-message a:hover {
  opacity: 0.8;
}

/* ── No-translation note ── */

.tr-no-translation-note {
  font-family: var(--sans);
  font-size: 12px;
  font-style: italic;
  font-weight: 300;
  color: rgba(46, 61, 58, 0.42);
  margin-top: 8px;
}

/* ── Ick Meter ── */

.tr-ick {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tr-ick-track {
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--sage) 0%, var(--amber) 58%, var(--rose) 100%);
  position: relative;
}

.tr-ick-marker {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--slate);
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: left 500ms ease;
}

.tr-ick-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  color: rgba(46, 61, 58, 0.42);
  letter-spacing: 0.02em;
}

/* ── Output dial ── */

.tr-output-dial {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 6px 4px;
}

.tr-dial-track {
  position: relative;
  height: 6px;
  background: rgba(46, 61, 58, 0.12);
  border-radius: 3px;
}

.tr-dial-notch {
  position: absolute;
  width: 1px;
  height: 10px;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(46, 61, 58, 0.25);
  pointer-events: none;
}

.tr-dial-thumb {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sage);
  border: 2px solid var(--slate);
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  user-select: none;
}

.tr-dial-thumb:active {
  cursor: grabbing;
}

.tr-dial-thumb:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 2px;
}

.tr-dial-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  color: rgba(46, 61, 58, 0.55);
  letter-spacing: 0.02em;
}

@keyframes tr-thud-right {
  0%   { transform: translate(-50%, -50%); }
  60%  { transform: translate(calc(-50% + 3px), -50%); }
  100% { transform: translate(-50%, -50%); }
}

@keyframes tr-thud-left {
  0%   { transform: translate(-50%, -50%); }
  60%  { transform: translate(calc(-50% - 3px), -50%); }
  100% { transform: translate(-50%, -50%); }
}

.tr-dial-thumb.tr-thud-right {
  animation: tr-thud-right 280ms ease-out;
}

.tr-dial-thumb.tr-thud-left {
  animation: tr-thud-left 280ms ease-out;
}

.tr-dial-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.tr-dial-disabled .tr-dial-thumb {
  cursor: not-allowed;
}

/* ── Pane actions ── */

.tr-pane-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

/* ── Translate button ── */

.tr-translate-btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--white);
  background: var(--slate);
  border: none;
  border-radius: 6px;
  padding: 9px 22px;
  cursor: pointer;
  -webkit-font-smoothing: antialiased;
  transition: opacity 0.15s;
}

.tr-translate-btn:hover:not(:disabled) { opacity: 0.82; }
.tr-translate-btn:disabled             { opacity: 0.38; cursor: default; }

/* ── Copy button ── */

.tr-copy-btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: rgba(46, 61, 58, 0.65);
  background: transparent;
  border: 1px solid rgba(46, 61, 58, 0.2);
  border-radius: 6px;
  padding: 7px 16px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}

.tr-copy-btn:hover {
  border-color: var(--sage);
  color: var(--sage);
}

/* ── Email link ── */

.tr-email-link {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 300;
  color: rgba(46, 61, 58, 0.5);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.12s;
}

.tr-email-link:hover { color: var(--sage); }

/* ── Sign-in hint ── */

.tr-sign-in-hint {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 300;
  color: rgba(46, 61, 58, 0.45);
  text-align: left;
}

.tr-sign-in-hint a {
  color: var(--sage);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Swap column ── */

.tr-swap-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 56px;
}

.tr-swap-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--sage);
  padding: 0;
  transition: transform 0.15s, color 0.15s;
}

.tr-swap-icon {
  width: 28px;
  height: 28px;
  display: block;
}

.tr-swap-btn:hover:not(:disabled) {
  transform: scale(1.12);
  color: var(--white);
}

.tr-swap-btn:disabled {
  opacity: 0.22;
  cursor: default;
}

/* ── Copy-link button (admin only) ── */

.tr-copy-link-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.tr-copy-link-btn {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: rgba(248, 249, 247, 0.45);
  background: transparent;
  border: 1px solid rgba(248, 249, 247, 0.18);
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}

.tr-copy-link-btn:hover {
  color: var(--white);
  border-color: rgba(248, 249, 247, 0.5);
}

/* ── Drawer link ── */

.tr-drawer-link,
.tr-made-by {
  text-align: center;
  margin: 16px 0 0;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 300;
}

.tr-drawer-link a,
.tr-made-by a {
  color: rgba(248, 249, 247, 0.38);
  text-decoration: none;
  border-bottom: 0.5px solid rgba(248, 249, 247, 0.18);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.tr-drawer-link a:hover,
.tr-made-by a:hover {
  color: rgba(248, 249, 247, 0.72);
  border-color: rgba(248, 249, 247, 0.42);
}

/* ── Mobile ── */

/* ── Privacy disclosure ── */

.tr-privacy {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 0.5px solid rgba(248, 249, 247, 0.12);
}

.tr-privacy-toggle {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 300;
  color: rgba(248, 249, 247, 0.38);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-align: left;
  transition: color 0.15s;
}

.tr-privacy-toggle:hover { color: rgba(248, 249, 247, 0.65); }
.tr-privacy-toggle::after { content: ' +'; }
.tr-privacy-toggle.is-open::after { content: ' \2212'; }

.tr-privacy-panel {
  margin-top: 12px;
}

.tr-privacy-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.tr-privacy-list li {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 300;
  color: rgba(248, 249, 247, 0.42);
  line-height: 1.5;
}

.tr-privacy-list strong {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: rgba(248, 249, 247, 0.62);
}

.tr-privacy-note {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 300;
  color: rgba(248, 249, 247, 0.38);
  line-height: 1.5;
  margin: 0;
}

/* ── Mobile ── */

@media (max-width: 900px) {
  .tr-wrap {
    padding: 24px 16px 48px;
  }

  .tr-header {
    margin-bottom: 24px;
  }

  .tr-title {
    font-size: 28px;
  }

  .tr-layout {
    grid-template-columns: 1fr;
  }

  .tr-swap-wrap {
    padding: 8px 0;
    justify-content: center;
  }

  .tr-swap-icon {
    transform: rotate(90deg);
  }

  .tr-pane {
    min-height: unset;
  }

  .tr-textarea {
    min-height: 150px;
  }

  .tr-output-wrap {
    min-height: 150px;
  }

  .tr-privacy-list {
    grid-template-columns: 1fr;
  }
}

