/* llm-config-page.css — LLM Config page */

/* ── Page root ─────────────────────────────────────────────── */

.llm-page {
    font-family: var(--app-font-primary, "Geist", sans-serif);
    color: var(--app-text-primary, rgba(17, 24, 39, 0.87));
    font-size: 14px;
    line-height: 22px;
    max-width: 1000px;
}

/* ── Tabs ──────────────────────────────────────────────────── */

/* Tab appearance and gap come from the shared dlg-tabs.css. */
.llm-tabs {
    margin-bottom: 16px;
}

.llm-tab-panel {
    display: none;
}

.llm-tab-panel--active {
    display: block;
}

/* ── Section headings ──────────────────────────────────────── */

/* Scale comes from the shared heading rules; only the spacing differs. */
.llm-section-title {
    margin-top: 24px;
}

.llm-section-title:first-of-type {
    margin-top: 0;
}

/* ── Category groups (details/summary) ─────────────────────── */

.llm-category {
    border: 1px solid hsla(0, 0%, 40%, 0.15);
    border-radius: 8px;
    margin-bottom: 10px;
    background: var(--app-bg-primary, #fff);
    overflow: hidden;
}

.llm-category summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    line-height: 22px;
    cursor: pointer;
    background: var(--app-bg-secondary, #f9f9f9);
    user-select: none;
    list-style: none;
}

.llm-category summary::-webkit-details-marker {
    display: none;
}

.llm-category summary::before {
    content: "\25B6";
    font-size: 10px;
    transition: transform 0.15s ease;
}

.llm-category[open] summary::before {
    transform: rotate(90deg);
}

.llm-category__body {
    padding: 8px 0;
}

/* ── Task row (inside category) ────────────────────────────── */

.llm-task-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
}

.llm-task-label {
    min-width: 180px;
    flex-shrink: 0;
    color: var(--app-text-secondary, #919191);
    font-weight: 500;
}

/* Look comes from the shared select.dlg-select rules in dialogue.css
   (this page's root isn't .dlg-page, so the blanket doesn't reach it). */
.llm-task-select {
    cursor: pointer;
    min-width: 160px;
}

/* ── Setup cards ───────────────────────────────────────────── */

.llm-setup-card {
    border: 1px solid hsla(0, 0%, 40%, 0.15);
    border-radius: 8px;
    margin-bottom: 10px;
    background: var(--app-bg-primary, #fff);
    overflow: hidden;
}

.llm-setup-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--app-bg-secondary, #f9f9f9);
    border-bottom: 1px solid hsla(0, 0%, 40%, 0.15);
}

.llm-setup-card__name {
    font-weight: 600;
    font-size: 14px;
    line-height: 22px;
    margin: 0;
}

.llm-setup-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.llm-setup-card__body {
    padding: 12px 16px;
}

/* ── Property field rows ───────────────────────────────────── */

.llm-field-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}

.llm-field-label {
    min-width: 180px;
    flex-shrink: 0;
    color: var(--app-text-secondary, #919191);
    font-weight: 500;
}

.llm-field-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid hsla(0, 0%, 40%, 0.15);
    border-radius: 6px;
    background: var(--app-bg-primary, #fff);
    font-family: inherit;
    font-size: 14px;
    line-height: 22px;
    color: var(--app-text-primary);
}

.llm-field-input:focus {
    outline: 2px solid var(--app-focus-ring, rgba(20, 27, 155, 0.6));
    outline-offset: -2px;
}

/* Look comes from the shared select.dlg-select rules in dialogue.css. */
.llm-field-select {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

/* ── Buttons ───────────────────────────────────────────────── */

.llm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 22px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border: none;
    text-decoration: none;
}

.llm-btn--primary {
    background-color: var(--app-action-primary, #212121);
    color: #f5f5f5;
}

.llm-btn--primary:hover {
    background-color: var(--app-action-hover, #141b9b);
}

.llm-btn--secondary {
    background-color: var(--app-bg-primary, #fff);
    color: var(--app-text-primary);
    border: 1px solid hsla(0, 0%, 40%, 0.15);
}

.llm-btn--secondary:hover {
    background-color: var(--app-bg-hover, #f5f5f5);
}

.llm-btn--danger {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--app-text-secondary, #919191);
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.llm-btn--danger:hover {
    color: var(--app-text-alert, #dc172e);
    background: rgba(220, 23, 46, 0.06);
}

.llm-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Test connection status ────────────────────────────────── */

.llm-test-status {
    font-size: 13px;
    line-height: 22px;
    margin-left: 8px;
}

.llm-test-status--ok {
    color: #16a34a;
}

.llm-test-status--error {
    color: #dc2626;
}

/* ── New setup form ────────────────────────────────────────── */

.llm-new-setup {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid hsla(0, 0%, 40%, 0.15);
    border-radius: 8px;
    padding: 12px 16px;
    background: var(--app-bg-primary, #fff);
}

.llm-new-setup__input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid hsla(0, 0%, 40%, 0.15);
    border-radius: 6px;
    background: var(--app-bg-primary, #fff);
    font-family: inherit;
    font-size: 14px;
    line-height: 22px;
    color: var(--app-text-primary);
}

.llm-new-setup__input:focus {
    outline: 2px solid var(--app-focus-ring, rgba(20, 27, 155, 0.6));
    outline-offset: -2px;
}

/* Save feedback uses the shared .dlg-status pill (dlg.flashStatus). */
