/*
 * Tabs, converter panels, and result preview for the online document tools page.
 * Web-only: webtranslate.html is the sole page that loads this file (the Office
 * plugin never navigates here). Consumes terminology.css custom properties;
 * terminology.css itself is shared with plugin pages and is not modified.
 */

/* ---------- tabs ---------- */

.tc-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--tc-border);
  background: var(--tc-surface);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
  overflow-x: auto;
  scrollbar-width: none;
}
.tc-tabs::-webkit-scrollbar { display: none; }

.tc-tab {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--tc-muted);
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.tc-tab:hover:not(.is-active) {
  color: var(--tc-text);
  background: color-mix(in srgb, var(--tc-border) 35%, transparent);
}
.tc-tab.is-active {
  color: var(--tc-accent);
  background: var(--tc-accent-soft);
  font-weight: 600;
}
.tc-tab:focus-visible {
  outline: 2px solid var(--tc-accent);
  outline-offset: 1px;
}

.tc-tabpanel[hidden] { display: none; }

/* ---------- converter panel ---------- */

.tc-d2x-prompt {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tc-text);
  background: var(--tc-surface);
}
.tc-d2x-prompt:focus {
  outline: none;
  border-color: var(--tc-accent);
  box-shadow: 0 0 0 3px var(--tc-accent-soft);
}
.tc-d2x-prompt::placeholder { color: #9aa4b2; }

.tc-d2x-prompt-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: #9aa4b2;
}

.tc-d2x-credits-gate {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(196, 43, 28, 0.22);
  background: rgba(196, 43, 28, 0.06);
}
.tc-d2x-credits-gate.hidden { display: none; }
.tc-d2x-credits-gate__text {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--tc-danger);
}
.tc-d2x-credits-gate__btn {
  width: 100%;
  min-height: 40px;
  font-size: 14px;
  border-radius: 10px;
}

/* Selected-file chips */
.tc-d2x-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.tc-d2x-files:empty { display: none; }

.tc-d2x-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 8px 5px 10px;
  border: 1px solid var(--tc-border);
  border-radius: 999px;
  background: var(--tc-bg);
  font-size: 12px;
}
.tc-d2x-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.tc-d2x-file-remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--tc-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 50%;
}
.tc-d2x-file-remove:hover { color: var(--tc-danger); background: rgba(196, 43, 28, 0.08); }

.tc-btn.tc-d2x-cancel {
  margin-top: 10px;
  width: 100%;
  min-height: 40px;
  font-size: 14px;
  border-radius: 10px;
}
.tc-btn.tc-d2x-cancel.hidden { display: none; }
