/* Reverse Text - new two-column layout */

.tr-tool .tr-panels {
  margin: 0 -8px;
}
.tr-tool [class*='col-'] {
  padding: 0 8px;
}

.tr-input-panel,
.tr-output-panel {
  height: 100%;
}

.tr-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tr-stats {
  font-size: 12px;
  color: var(--text-secondary, #5f6b7a);
  white-space: nowrap;
}

.tr-body {
  display: flex;
  flex-direction: column;
}

.tr-textarea {
  font-family: Consolas, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  min-height: 180px;
}

.tr-result {
  background: var(--code-bg, #f8f9fa);
}

.tr-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.tr-option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tr-option-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary, #212529);
}

.tr-radio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tr-radio-card {
  border: 1px solid var(--border-color, #dde1e6);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tr-radio-card:hover {
  border-color: var(--brand-color, #2f6fed);
}

.tr-radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tr-radio-card:has(input:checked) {
  border-color: var(--brand-color, #2f6fed);
  background: color-mix(in srgb, var(--brand-color, #2f6fed) 6%, transparent);
}

.tr-radio-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary, #212529);
}

.tr-radio-desc {
  font-size: 11.5px;
  color: var(--text-secondary, #5f6b7a);
  line-height: 1.4;
}

.tr-separator-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tr-separator-row.hidden {
  display: none;
}

.tr-separator-row .form-control:first-child {
  flex: 1;
  min-width: 140px;
}

.tr-separator-row .form-control:last-child {
  flex: 1;
  min-width: 150px;
}

.tr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.tr-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary, #5f6b7a);
  cursor: pointer;
  margin-left: auto;
}

.tr-live input {
  cursor: pointer;
}

/* ---- output side ---- */
.tr-output-panel .tr-body {
  gap: 14px;
}

.tr-output-panel .result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.tr-meta-stack {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.tr-meta {
  font-size: 12px;
  color: var(--text-secondary, #5f6b7a);
}

.tr-output-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tr-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 8px;
  padding: 10px 12px;
  transition: opacity 0.25s ease;
}

.tr-message.is-fading {
  opacity: 0;
}

.tr-message.hidden {
  display: none;
}

.tr-msg-error {
  background: rgba(220, 53, 69, 0.08);
  border: 1px solid rgba(220, 53, 69, 0.35);
  color: #c0392b;
}

.tr-msg-success {
  background: rgba(40, 167, 69, 0.08);
  border: 1px solid rgba(40, 167, 69, 0.35);
  color: #1e7e34;
}

.tr-msg-info {
  background: rgba(47, 111, 237, 0.07);
  border: 1px solid rgba(47, 111, 237, 0.3);
  color: var(--brand-color, #2f6fed);
}

[data-theme='dark'] .tr-msg-error {
  color: #f08a8a;
}

[data-theme='dark'] .tr-msg-success {
  color: #7fd88f;
}

[data-theme='dark'] .tr-msg-info {
  color: #7fb0ff;
}

.tr-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary, #5f6b7a);
  line-height: 1.6;
  background: var(--bg-subtle, #f8f9fa);
  border: 1px solid var(--border-color, #e3e6ea);
  border-radius: 8px;
  padding: 10px 12px;
}

.tr-note i {
  margin-top: 2px;
}

/* ---- responsive ---- */
@media (max-width: 991px) {
  .tr-panels [class*='col-'] {
    margin-bottom: 16px;
  }
}

@media (max-width: 575px) {
  .tr-radio-grid {
    grid-template-columns: 1fr;
  }
  .tr-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .tr-actions .btn {
    width: 100%;
  }
  .tr-live {
    margin-left: 0;
    justify-content: center;
  }
  .tr-output-panel .result-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .tr-output-actions .btn {
    flex: 1;
  }
}

/* dark mode tweaks */
[data-theme='dark'] .tr-result {
  background: var(--code-bg, #1b212c);
}
