/* Translator-specific styles */

/* Slightly wider main column for side-by-side panels */
.main-wide { max-width: 1200px; }

.translate-controls {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}
.control-group-flex { flex: 1; min-width: 200px; }

.form-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-select {
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.swap-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-bottom: 0;
  transition: color .15s, border-color .15s;
}
.swap-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.swap-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.translate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 800px) {
  .translate-grid { grid-template-columns: 1fr; }
}

.translate-panel {
  background: var(--card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.translate-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-secondary);
}
.translate-panel-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}
.translate-panel-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.char-count {
  font-size: 11px;
  color: var(--text-quaternary);
  font-variant-numeric: tabular-nums;
}

.translate-textarea {
  flex: 1;
  width: 100%;
  min-height: 360px;
  padding: 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14.5px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  white-space: pre-wrap;
}
.translate-textarea:focus {
  outline: none;
}

.translate-loading {
  position: absolute;
  inset: 38px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: blur(2px);
  color: var(--text-secondary);
  font-size: 13px;
}
.spinner-sm {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-link {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: inherit;
}
.btn-link:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); }

.btn-copy {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.btn-copy:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-copy:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-copy.copied {
  background: rgba(34, 197, 94, 0.12);
  border-color: #16a34a;
  color: #15803d;
}

.run-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
  flex-wrap: wrap;
}
.btn-lg { padding: 12px 26px; font-size: 14px; font-weight: 600; }
.run-hint { font-size: 13px; color: var(--text-tertiary); }

/* Back link (shared pattern) */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-tertiary);
  text-decoration: none; border: 0.5px solid var(--border-default);
  background: var(--bg-primary); flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.back-link:hover {
  color: var(--primary); border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--bg-primary));
}
.back-link svg { opacity: 0.8; }
@media (max-width: 640px) {
  .back-link span { display: none; }
  .back-link { padding: 6px; }
}
