/* shared/llm-status-bar.css — Shared LLM Status Bar & Settings Modal
   All classes prefixed with llm- to avoid conflicts with host pages.
   Uses CSS variable fallback chains for theme compatibility. */

/* ─── Status Bar ─── */
.llm-status-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--card, var(--surface, #1a1a1a));
  border-top: 1px solid var(--accent, var(--border, #333));
  display: flex; align-items: center; padding: 0 1.2rem; height: 36px;
  gap: 0.6rem; font-size: 0.75rem;
  color: var(--muted, #888);
  font-family: inherit;
}
.llm-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted, #888); flex-shrink: 0;
}
.llm-status-dot.llm-connected { background: var(--green, #4caf50); }
.llm-status-dot.llm-error { background: var(--red, #f44336); }
.llm-status-dot.llm-idle { background: var(--muted, #888); }
.llm-status-dot.llm-checking {
  background: var(--amber, #ff9800);
  animation: llm-pulse-dot 1s ease-in-out infinite;
}
@keyframes llm-pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.llm-status-separator { color: var(--accent, var(--border, #333)); }
.llm-status-elapsed {
  font-size: 0.65rem; color: var(--amber, #ff9800);
  font-variant-numeric: tabular-nums; min-width: 2ch;
  display: none;
}
.llm-status-error {
  color: var(--red, #f44336); font-size: 0.72rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw;
}
.llm-status-settings-btn {
  background: var(--accent, var(--border, #333));
  color: var(--muted, #888); border: 1px solid transparent;
  padding: 2px 10px; border-radius: 4px;
  font-family: inherit; font-size: 0.72rem;
  cursor: pointer; margin-left: auto; transition: all 0.2s; white-space: nowrap;
}
.llm-status-settings-btn:hover {
  border-color: var(--orange, var(--primary, #ff9800));
  color: var(--orange, var(--primary, #ff9800));
}

/* ─── Modal Overlay ─── */
.llm-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 2000;
  align-items: center; justify-content: center;
}
.llm-modal-overlay.llm-visible { display: flex; }

/* ─── Modal ─── */
.llm-modal {
  background: var(--card, var(--surface, #1a1a1a));
  border: 1px solid var(--orange, var(--primary, #ff9800));
  border-radius: 10px; padding: 1.5rem;
  width: min(460px, 92vw); max-height: 85vh; overflow-y: auto;
  color: var(--text, #e0e0e0); font-family: inherit;
}
.llm-modal h3 {
  color: var(--orange, var(--primary, #ff9800));
  margin: 0 0 1rem 0; font-size: 1rem;
}
.llm-modal label {
  display: block; font-size: 0.78rem;
  color: var(--muted, #888);
  margin-bottom: 0.3rem; margin-top: 0.6rem;
}
.llm-modal select,
.llm-modal input[type="text"],
.llm-modal input[type="password"] {
  width: 100%; padding: 0.5rem;
  background: var(--bg, #111); border: 1px solid var(--accent, var(--border, #333));
  border-radius: 6px; color: var(--text, #e0e0e0);
  font-family: inherit; font-size: 0.85rem;
  box-sizing: border-box;
}
.llm-modal select:focus,
.llm-modal input:focus {
  outline: none; border-color: var(--orange, var(--primary, #ff9800));
}

/* ─── Modal Buttons ─── */
.llm-modal .llm-modal-buttons {
  display: flex; gap: 0.6rem; margin-top: 1.2rem; flex-wrap: wrap;
}
.llm-modal .llm-btn-apply {
  background: var(--orange, var(--primary, #ff9800)); color: #000;
  border: none; padding: 0.5rem 1.2rem; border-radius: 6px;
  font-family: inherit; font-weight: bold; font-size: 0.85rem; cursor: pointer;
}
.llm-modal .llm-btn-apply:hover { opacity: 0.85; }
.llm-modal .llm-btn-cancel {
  background: var(--accent, var(--border, #333)); color: var(--text, #e0e0e0);
  border: none; padding: 0.5rem 1.2rem; border-radius: 6px;
  font-family: inherit; font-size: 0.85rem; cursor: pointer;
}
.llm-modal .llm-btn-cancel:hover { opacity: 0.85; }
.llm-modal .llm-btn-fetch {
  background: var(--accent, var(--border, #333)); color: var(--text, #e0e0e0);
  border: 1px solid var(--accent, var(--border, #333));
  padding: 0.4rem 0.8rem; border-radius: 4px;
  font-family: inherit; font-size: 0.78rem; cursor: pointer;
  white-space: nowrap; transition: all 0.2s;
}
.llm-modal .llm-btn-fetch:hover {
  border-color: var(--orange, var(--primary, #ff9800));
  color: var(--orange, var(--primary, #ff9800));
}
.llm-modal .llm-btn-fetch:disabled { opacity: 0.5; cursor: not-allowed; }
.llm-modal .llm-btn-test {
  background: var(--accent, var(--border, #333));
  color: var(--cyan, #00d4ff); border: 1px solid var(--cyan, #00d4ff);
  padding: 0.5rem 1.2rem; border-radius: 6px;
  font-family: inherit; font-size: 0.85rem; cursor: pointer; transition: all 0.2s;
}
.llm-modal .llm-btn-test:hover { background: rgba(0,212,255,0.1); }
.llm-modal .llm-btn-test:disabled { opacity: 0.5; cursor: not-allowed; }
.llm-modal .llm-btn-freeplay {
  background: var(--accent, var(--border, #333));
  color: var(--green, #4caf50); border: 1px solid var(--green, #4caf50);
  padding: 0.5rem 1.2rem; border-radius: 6px;
  font-family: inherit; font-size: 0.85rem; cursor: pointer; transition: all 0.2s;
}
.llm-modal .llm-btn-freeplay:hover { background: rgba(76,175,80,0.1); }

/* ─── Modal Sections ─── */
.llm-modal .llm-fetch-status {
  font-size: 0.75rem; color: var(--muted, #888);
  margin-top: 0.3rem; min-height: 1em;
}
.llm-modal .llm-test-results {
  margin-top: 0.8rem; padding: 0.8rem;
  background: var(--bg, #111); border: 1px solid var(--accent, var(--border, #333));
  border-radius: 6px; font-size: 0.78rem; line-height: 1.6; display: none;
}
.llm-modal .llm-test-pass { color: var(--green, #4caf50); }
.llm-modal .llm-test-fail { color: var(--red, #f44336); }
.llm-modal .llm-test-label { color: var(--muted, #888); }
.llm-modal .llm-test-value { color: var(--text, #e0e0e0); }

/* ─── Free Play Banner ─── */
.llm-free-play-banner {
  background: rgba(76,175,80,0.1); border: 1px solid var(--green, #4caf50);
  border-radius: 6px; padding: 0.6rem 0.8rem; margin-bottom: 0.8rem;
  font-size: 0.78rem; color: var(--green, #4caf50);
}

/* ─── Config Summary (inline in arena panels) ─── */
.llm-config-summary {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.8rem; background: var(--surface, #f5f7fa);
  border: 1px solid var(--border, #e0e4ea); border-radius: 6px;
  font-size: 0.85rem; margin-bottom: 0.8rem;
}
.llm-config-summary .llm-config-label { color: var(--muted, #888); }
.llm-config-summary .llm-config-value { font-weight: 500; }
.llm-config-summary .llm-config-btn {
  margin-left: auto; padding: 0.3rem 0.8rem;
  background: var(--accent, #e0e4ea); color: var(--text, #333);
  border: 1px solid var(--border, #ccc); border-radius: 4px;
  font-size: 0.78rem; cursor: pointer; white-space: nowrap;
}
.llm-config-summary .llm-config-btn:hover {
  border-color: var(--orange, var(--primary, #ff9800));
  color: var(--orange, var(--primary, #ff9800));
}

/* ─── Proxy Help (collapsible) ─── */
.llm-proxy-help {
  margin-top: 1rem; border-top: 1px solid var(--accent, var(--border, #333));
  padding-top: 0.8rem;
}
.llm-proxy-help summary {
  font-size: 0.78rem; color: var(--muted, #888);
  cursor: pointer; user-select: none;
}
.llm-proxy-help summary:hover { color: var(--text, #e0e0e0); }
.llm-proxy-help .llm-proxy-content {
  font-size: 0.75rem; color: var(--muted, #888);
  margin-top: 0.5rem; line-height: 1.6;
}
.llm-proxy-help code {
  background: var(--bg, #111); padding: 0.1rem 0.4rem;
  border-radius: 3px; font-size: 0.72rem;
}
.llm-proxy-help pre {
  background: var(--bg, #111); padding: 0.5rem;
  border-radius: 4px; overflow-x: auto; margin: 0.4rem 0;
  font-size: 0.72rem;
}
