/* Translation Service — frontend styles. Loaded on /translate pages. */

.translate-page-content {
    max-width: 1100px;
    margin: 0 auto;
}

.translate-user-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--muted-border-color, #e5e7eb);
    font-size: 14px;
}

.translate-signin-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #18181b;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}
.translate-signin-btn:hover { background: #27272a; }
.translate-signin-hint { color: #71717a; font-size: 13px; }

.translate-link-btn {
    background: none;
    border: none;
    color: #2563eb;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}

/* Project list web component */
translation-projects {
    display: block;
}

.tp-loading, .tp-empty {
    padding: 32px;
    text-align: center;
    color: #71717a;
    font-size: 14px;
}
.tp-error {
    padding: 12px 14px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 8px;
    font-size: 13px;
    margin: 8px 0;
}

.tp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.tp-card {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    background: var(--card-background-color, #fff);
    text-decoration: none;
    color: inherit;
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.tp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border-color: #d4d4d8;
}
.tp-card-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tp-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    background: #f4f4f5;
    color: #6b7280;
    font-weight: 500;
    text-transform: capitalize;
}
.tp-badge-active { background: #dcfce7; color: #15803d; }
.tp-badge-paused { background: #f4f4f5; color: #71717a; }
.tp-card-meta {
    font-size: 12.5px;
    color: #71717a;
    line-height: 1.5;
}
.tp-card-meta code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
    background: #f4f4f5;
    padding: 1px 5px;
    border-radius: 3px;
}
.tp-card-stats {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f4f4f5;
    font-size: 12px;
    color: #6b7280;
}
.tp-card-stats strong { color: #18181b; font-weight: 600; }

/* ───────────────────────── breadcrumb + section header ───────────────────── */

.te-breadcrumb {
    font-size: 13px;
    color: #71717a;
    margin: 4px 0 16px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.te-breadcrumb a { color: #2563eb; text-decoration: none; }
.te-breadcrumb a:hover { text-decoration: underline; }
.te-crumb-sep { color: #d4d4d8; }

.te-header { margin-bottom: 18px; }
.te-header h2 {
    margin: 0 0 4px;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.te-header h2::before,
.te-header h2::after { content: none; display: none; }
.te-header-meta { font-size: 13px; color: #71717a; }
.te-header-meta code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
    background: #f4f4f5;
    padding: 1px 5px;
    border-radius: 3px;
}
.te-lang-pill {
    background: #ede9fe;
    color: #5b21b6;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.te-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #52525b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 22px 0 10px;
}

/* ───────────────────────────────── toolbar ──────────────────────────────── */

.te-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}
.te-toolbar input[type="search"],
.te-toolbar select {
    padding: 6px 10px;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    font: inherit;
    background: #fff;
}
.te-toolbar input[type="search"] { flex: 1 1 200px; min-width: 160px; }
.te-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #52525b;
}
.te-toolbar-spacer { flex: 1; }
.te-count { color: #71717a; font-size: 12.5px; }

/* ───────────────────────────── editor layout ────────────────────────────── */

.te-layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 14px;
    align-items: start;
}
@media (max-width: 760px) {
    .te-layout { grid-template-columns: 1fr; }
}

.te-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: opacity .15s;
}
.te-list--busy { opacity: 0.6; }

.te-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "key meta" "en  meta";
    gap: 2px 8px;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid #f4f4f5;
    padding: 10px 12px;
    width: 100%;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.te-row:hover { background: #fafafa; }
.te-row:last-child { border-bottom: none; }
.te-row--active { background: #eff6ff; }
.te-row--active:hover { background: #dbeafe; }

.te-row-key {
    grid-area: key;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
    color: #2563eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.te-row-en {
    grid-area: en;
    font-size: 13px;
    color: #3f3f46;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.te-row-meta {
    grid-area: meta;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
}
.te-row-status {
    font-size: 10.5px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f4f4f5;
    color: #6b7280;
    text-transform: capitalize;
}
.te-status-approved          { background: #dcfce7; color: #15803d; }
.te-status-published         { background: #cffafe; color: #0e7490; }
.te-status-needs_review      { background: #fef3c7; color: #b45309; }
.te-status-ai_suggested      { background: #ede9fe; color: #6d28d9; }
.te-status-validation_failed { background: #fee2e2; color: #b91c1c; }
.te-status-stale_orphan      { background: #f5f5f4; color: #57534e; }
.te-row-issue {
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 700;
    border-radius: 999px;
    padding: 0 6px;
    font-size: 10.5px;
}

.te-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #f4f4f5;
    background: #fafafa;
    font-size: 12.5px;
    color: #52525b;
}
.te-pager-btn {
    background: #fff;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font: inherit;
}
.te-pager-btn[disabled] { opacity: 0.4; cursor: default; }

/* ───────────────────────────── detail pane ──────────────────────────────── */

.te-detail {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    padding: 16px;
}
.te-detail-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid #f4f4f5;
    margin-bottom: 14px;
}
.te-key {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
}
.te-meta-pill {
    background: #f4f4f5;
    color: #52525b;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
}

.te-pair { margin-bottom: 14px; }
.te-pair-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.te-source {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    color: #18181b;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.te-placeholder {
    display: inline-block;
    background: #ede9fe;
    color: #5b21b6;
    border-radius: 4px;
    padding: 0 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
}
.te-placeholders {
    font-size: 12px;
    color: #71717a;
    margin: -8px 0 14px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.te-target {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    background: #fff;
    resize: vertical;
    min-height: 96px;
    box-sizing: border-box;
}
.te-target:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.te-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.te-actions-spacer { flex: 1; }
.te-btn {
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 7px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: #fff;
    color: #18181b;
}
.te-btn--primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.te-btn--primary:hover { background: #1d4ed8; }
.te-btn--ok      { background: #16a34a; color: #fff; border-color: #16a34a; }
.te-btn--ok:hover { background: #15803d; }
.te-btn--warn    { background: #fff; color: #b91c1c; border-color: #fecaca; }
.te-btn--warn:hover { background: #fef2f2; }
.te-btn--ghost   { background: #fafafa; color: #52525b; border-color: #e5e7eb; }
.te-btn--ghost:hover { background: #f4f4f5; }

.te-status-msg {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12.5px;
    color: #71717a;
}
.te-status-msg--ok  { color: #15803d; }
.te-status-msg--err { color: #b91c1c; }

/* ────────────────────────── history + comments ─────────────────────────── */

.te-history, .te-comments {
    margin-top: 18px;
    border-top: 1px solid #f4f4f5;
    padding-top: 12px;
    font-size: 13px;
}
.te-history > summary, .te-comments > summary {
    cursor: pointer;
    color: #52525b;
    font-weight: 600;
    padding: 4px 0;
    list-style: revert;
}
.te-history-body, .te-comments-body { margin-top: 10px; }

.te-hist-row {
    border: 1px solid #f4f4f5;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: #fafafa;
}
.te-hist-head {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #71717a;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.te-hist-action { font-weight: 600; color: #3f3f46; text-transform: capitalize; }
.te-hist-status { color: #6b7280; }
.te-hist-val {
    font-size: 13px;
    color: #18181b;
    white-space: pre-wrap;
    word-break: break-word;
}
.te-hist-comment {
    margin-top: 4px;
    font-size: 12.5px;
    color: #6b7280;
    font-style: italic;
}

.te-comment {
    border: 1px solid #f4f4f5;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: #fff;
}
.te-comment-head {
    font-size: 12px;
    color: #71717a;
    margin-bottom: 4px;
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.te-comment-head strong { color: #18181b; }
.te-comment-body { font-size: 13px; white-space: pre-wrap; word-break: break-word; }

.te-comment-form {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    align-items: flex-start;
}
.te-comment-form textarea {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    resize: vertical;
    min-height: 40px;
}
