/* assets/css/translator.css — translator page. Two cards, one language bar, nothing heavy:
   no shadows stacked on shadows, no blur, no animated backgrounds. */

.tr { max-width: 1120px; margin: 0 auto; padding: 1.75rem 1rem 2.5rem; }
.tr [hidden] { display: none !important; }
.tr-head { margin-bottom: 1.25rem; }
.tr-head h1 { font-family: var(--font-head, 'Space Grotesk', sans-serif); font-size: clamp(1.45rem, 3.2vw, 2.1rem); font-weight: 700; letter-spacing: -.02em; margin: 0 0 .3rem; color: var(--forest-2); }
.tr-head p { margin: 0; color: #5d6b63; font-size: .95rem; }

/* Language bar */
.tr-langs { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center; }
.tr-sel { position: relative; margin: 0; }
.tr-sel select {
  width: 100%; height: 50px; padding: 0 2.4rem 0 1rem; border-radius: 14px; border: 1px solid #e3dccb; background: #fff;
  font-weight: 700; font-size: 1rem; color: var(--forest-2); appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23c99a1e' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}
.tr-sel select:hover { border-color: var(--gold); }
.tr-sel select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,154,30,.2); }
.tr-swap {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid #e3dccb; background: #fff; color: var(--forest-2);
  display: grid; place-items: center; transition: transform .2s, border-color .15s;
}
.tr-swap:hover { border-color: var(--gold); transform: rotate(180deg); }
.tr-quick { display: flex; gap: .4rem; overflow-x: auto; padding: .7rem 0 .9rem; scrollbar-width: none; }
.tr-quick::-webkit-scrollbar { display: none; }
.tr-chip {
  flex: none; height: 36px; padding: 0 .9rem; border-radius: 999px; border: 1px solid #e3dccb; background: #fff;
  font-size: .85rem; font-weight: 600; color: var(--forest-2); white-space: nowrap; transition: border-color .15s, background-color .15s;
}
.tr-chip:hover { border-color: var(--gold); }
.tr-chip.is-on { background: var(--forest-2); border-color: var(--forest-2); color: var(--gold-lt); }
.tr-chip-ghost { background: var(--cream); font-weight: 500; }

/* Cards */
.tr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; align-items: stretch; }
.tr-card {
  display: flex; flex-direction: column; min-height: 290px; background: #fff; border: 1px solid #e3dccb; border-radius: 20px;
  box-shadow: 0 1px 2px rgba(17,38,29,.04), 0 8px 24px rgba(17,38,29,.05); overflow: hidden;
}
.tr-src:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,154,30,.15); }
.tr-out { background: linear-gradient(180deg, #fffdf6, #fff 60%); }
.tr-src textarea {
  flex: 1; width: 100%; min-height: 150px; border: 0; resize: none; padding: 1.1rem 1.2rem .5rem; background: transparent;
  font-size: 1.3rem; line-height: 1.45; color: var(--forest-2); outline: none;
}
.tr-src textarea::placeholder { color: #9aa49e; }
.tr-examples { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1.2rem .9rem; }
.tr-result {
  flex: 1; padding: 1.1rem 1.2rem .5rem; font-size: 1.45rem; line-height: 1.45; font-weight: 600; color: var(--forest-2);
  white-space: pre-wrap; word-break: break-word; min-height: 150px;
}
.tr-result.is-empty { color: #b3bab5; font-weight: 400; }
.tr-result.is-loading { opacity: .55; }
.tr-result.is-loading.is-empty::after { content: ''; display: inline-block; width: 1.1em; height: .25em; margin-left: .35em; vertical-align: middle; border-radius: 3px; background: linear-gradient(90deg, var(--gold) 0 30%, transparent 30%); background-size: 200% 100%; animation: trDots .8s linear infinite; }
@keyframes trDots { to { background-position: -200% 0; } }
.tr-error { margin: 0 1.2rem .6rem; padding: .6rem .8rem; border-radius: 12px; background: #fdecee; color: #a10f20; font-size: .88rem; }

/* Source of the answer */
.tr-note { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; margin: 0 1.2rem .6rem; padding: .55rem .8rem; border-radius: 12px; font-size: .82rem; background: #fff6da; color: #6b4e05; }
.tr-note.is-verified { background: #e6f4ee; color: #0a5a45; }
.tr-note a, .tr-link { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; background: none; border: 0; padding: 0; font-size: inherit; }
.tr-fix { margin: 0 1.2rem .8rem; }
.tr-fix label { font-size: .85rem; font-weight: 600; margin-bottom: .3rem; display: block; }
.tr-fix textarea { width: 100%; border: 1px solid #e3dccb; border-radius: 12px; padding: .55rem .7rem; font-size: 1rem; }
.tr-fix textarea:focus { outline: none; border-color: var(--gold); }
.tr-fix-row { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; }

/* Bottom bars */
.tr-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .7rem; border-top: 1px solid #f0ead9; }
.tr-tools { display: flex; align-items: center; gap: .15rem; min-width: 0; }
.tr-ib {
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: #4b5a52;
  display: grid; place-items: center; font-size: 1.05rem; transition: background-color .15s, color .15s;
}
.tr-ib:hover:not(:disabled) { background: #f3eee2; color: var(--forest-2); }
.tr-ib:disabled { opacity: .35; }
.tr-ib.is-ok { color: var(--cm-green); }
.tr-ib.is-playing { background: rgba(242,201,53,.22); color: #7a560a; }
.tr-ib.has-voice { color: var(--cm-green); }
.tr-count { font-size: .78rem; color: #8b958f; margin-left: .35rem; font-variant-numeric: tabular-nums; }
.tr-count.is-max { color: var(--cm-red); font-weight: 700; }
.tr-go {
  display: inline-flex; align-items: center; gap: .6rem; height: 46px; padding: 0 1.3rem; border: 0; border-radius: 14px;
  background: var(--gold-grad); color: #1a1405; font-weight: 800; font-size: .98rem; box-shadow: 0 4px 14px rgba(201,154,30,.3);
  transition: filter .15s, transform .1s;
}
.tr-go:hover { filter: brightness(1.05); }
.tr-go:active { transform: scale(.97); }
.tr-go kbd { background: rgba(0,0,0,.12); color: inherit; font-size: .68rem; padding: .15rem .35rem; border-radius: 6px; font-weight: 700; }
.tr-go.is-busy { pointer-events: none; opacity: .75; }
.tr-go.is-busy span::after { content: '…'; }
.tr-tee {
  display: inline-flex; align-items: center; gap: .5rem; height: 44px; padding: 0 1rem; border-radius: 12px;
  border: 1px solid var(--forest-2); background: var(--forest-2); color: var(--gold-lt); font-weight: 700; font-size: .88rem;
}
.tr-tee:hover:not(:disabled) { background: #1b3b2d; }
.tr-tee:disabled { opacity: .35; }

/* History */
.tr-history { margin-top: 1.2rem; background: #fff; border: 1px solid #e3dccb; border-radius: 16px; }
.tr-history summary { padding: .9rem 1.1rem; font-weight: 700; cursor: pointer; color: var(--forest-2); list-style: none; display: flex; gap: .55rem; align-items: center; }
.tr-history summary::-webkit-details-marker { display: none; }
.tr-history summary i { color: var(--gold); }
.tr-history summary span { color: #8b958f; font-weight: 500; }
.tr-history ul { list-style: none; margin: 0; padding: 0 .6rem .6rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem; }
.tr-history li button { width: 100%; text-align: left; border: 1px solid #f0ead9; background: var(--cream); border-radius: 12px; padding: .6rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.tr-history li button:hover { border-color: var(--gold); }
.tr-h-langs { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #8b958f; }
.tr-h-s, .tr-h-t { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-h-t { color: var(--cm-green); font-weight: 600; }
.tr-foot { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: center; margin: 1.5rem 0 0; font-size: .9rem; }
.tr-foot a { color: var(--forest-2); font-weight: 600; text-decoration: none; }
.tr-foot a i { color: var(--gold); margin-right: .25rem; }
.tr-foot a:hover { text-decoration: underline; }

@media (max-width: 767.98px) {
  .tr { padding: 1.1rem .75rem 2rem; }
  .tr-grid { grid-template-columns: 1fr; gap: .6rem; }
  .tr-card { min-height: 0; border-radius: 16px; }
  .tr-src textarea { font-size: 1.15rem; min-height: 120px; }
  .tr-result { font-size: 1.25rem; min-height: 90px; }
  .tr-go kbd, .tr-tee span { display: none; }
  .tr-tee { width: 44px; padding: 0; justify-content: center; }
  .tr-sel select { height: 46px; font-size: .92rem; padding-left: .8rem; }
  .tr-swap { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) { .tr-swap:hover { transform: none; } .tr-result.is-loading.is-empty::after { animation: none; } }
