/* Mastermind admin UI — dodatni stili poleg Tailwind CDN */

/* Inter font apply */
html, body { font-family: 'Inter', system-ui, sans-serif; }

/* Onemogoči pinch-to-zoom in double-tap zoom na mobile (PWA-style) */
html {
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body {
  /* Preprečimo horizontalni "page slide" če katero koli notranje
     vsebnostno polje preraste viewport (npr. <pre> v MCP entry JSON,
     tool signaturen). Notranji elementi z overflow-x-auto ohranijo
     lokalen scroll. */
  overflow-x: hidden;
  max-width: 100%;
}

/* Line clamp utility (Tailwind 3.3+ has it, ampak CDN ne nujno) */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Prose za rendered markdown agent body */
.prose pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
  margin: 1rem 0;
}
.prose code {
  background: #f1f5f9;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
  font-weight: 500;
}
.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-weight: 400;
}
/* Rendered markdown — usklajeno z velikostjo telesa strani (text-sm vibe).
   H1 ni večji kot page_header naslov, da bralnik ne »kriči«. */
.prose { font-size: 0.875rem; line-height: 1.55; color: #334155; }
.prose h1 {
  font-size: 1.125rem;     /* ≈ text-lg, primerljivo s panel headerji */
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.5rem;
  padding-top: 0;
  color: #0f172a;
  letter-spacing: -0.01em;
}
/* Če bi se h1 pojavil sredi dokumenta (redko), naj ima vsaj malo prostora navzgor. */
.prose * + h1 { margin-top: 1.25rem; }
.prose h2 {
  font-size: 1rem;          /* ≈ text-base */
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.3rem;
}
.prose h3 {
  font-size: 0.9375rem;     /* ≈ 15px */
  font-weight: 600;
  margin-top: 0.9rem;
  margin-bottom: 0.3rem;
  color: #334155;
}
.prose h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.7rem;
  margin-bottom: 0.25rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.prose p { margin: 0.5rem 0; line-height: 1.6; color: #334155; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0.5rem 0; }
.prose li { margin: 0.2rem 0; color: #334155; }
.prose ul li::marker { color: #94a3b8; }
.prose ol li::marker { color: #94a3b8; }
.prose strong { color: #0f172a; font-weight: 600; }
/* Horizontal scroll wrapper za tabele v rendered markdownu (mobile safe) */
.md-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.md-table-scroll table {
  margin: 0;
  min-width: 100%;
  border: 0;
}
.md-table-scroll th, .md-table-scroll td {
  white-space: nowrap;
}
.prose table {
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9em;
  width: 100%;
}
.prose th, .prose td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
}
.prose th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
}
.prose blockquote {
  border-left: 4px solid #c4b5fd;
  background: #faf5ff;
  padding: 10px 16px;
  margin: 1rem 0;
  color: #6b21a8;
  border-radius: 0 8px 8px 0;
}
.prose a {
  color: #7c3aed;
  font-weight: 500;
}
.prose a:hover { text-decoration: underline; }
.prose strong { color: #0f172a; font-weight: 600; }
.prose hr { border-color: #e2e8f0; margin: 1.5rem 0; }

/* Toggle switch (pill + drsno krogec).
   Markup:
     <button class="mm-toggle [mm-toggle-on]" type="submit">
       <span class="mm-toggle-dot"></span>
     </button>
   Velikost 44×24 — mobile-friendly tap target, normalna velikost. */
.mm-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  background: #cbd5e1;
  border-radius: 9999px;
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s;
}
.mm-toggle:hover { background: #94a3b8; }
.mm-toggle.mm-toggle-on { background: #10b981; }
.mm-toggle.mm-toggle-on:hover { background: #059669; }
.mm-toggle-dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}
.mm-toggle.mm-toggle-on .mm-toggle-dot { transform: translateX(20px); }
.mm-toggle:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Toggle kot label z vgnezdenim checkbox-om — za uporabo v formah,
   kjer toggle ne sme takoj submit-ati. Stanje se določi prek
   :has(:checked) selektorja (modern brskalniki). */
label.mm-toggle { cursor: pointer; }
label.mm-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
label.mm-toggle:has(input:checked) { background: #10b981; }
label.mm-toggle:has(input:checked):hover { background: #059669; }
label.mm-toggle:has(input:checked) .mm-toggle-dot { transform: translateX(20px); }
label.mm-toggle:has(input:focus-visible) {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
