/**
 * Cockpit Core CSS v1.0
 *
 * Gedeelde toast styling voor alle cockpit/platform apps.
 * Apps kunnen eigen prefix-varianten behouden maar de core class
 * `grexx-toast` is de standaard.
 *
 * Gebruik: <link rel="stylesheet" href="/meta-lib/cockpit.core.css">
 * Of kopieer relevante regels naar app.css.
 */

/* ── Toast container ────────────────────────────────────────── */

.grexx-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: #1e293b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: min(90vw, 480px);
}

.grexx-toast-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ── Toast types ────────────────────────────────────────────── */

.grexx-toast-success {
  background: #166534;
  border: 1px solid #22c55e;
}

.grexx-toast-error {
  background: #991b1b;
  border: 1px solid #ef4444;
}

.grexx-toast-info {
  background: #1e40af;
  border: 1px solid #60a5fa;
}

.grexx-toast-undo {
  background: #1e293b;
  border: 1px solid #475569;
}

/* ── Toast message ──────────────────────────────────────────── */

.grexx-toast-message {
  flex: 1;
  line-height: 1.4;
}

/* ── Toast close button ─────────────────────────────────────── */

.grexx-toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.grexx-toast-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.grexx-toast-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── Toast undo button ──────────────────────────────────────── */

.grexx-toast-undo-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fbbf24;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.grexx-toast-undo-btn:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: #fbbf24;
}

/* ── Paused indicator ───────────────────────────────────────── */

.grexx-toast-paused .grexx-toast-close {
  color: rgba(255, 255, 255, 0.9);
}

/* ── Help button (rechtsonder, naast de feedback-widget) ────── */

.grexx-help-btn {
  position: fixed;
  bottom: 24px;
  right: 96px;          /* feedback-widget zit op right: 24px */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #475569;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  font-family: ui-sans-serif, system-ui, sans-serif;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9998;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.grexx-help-btn:hover {
  background: #334155;
  transform: scale(1.06);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.grexx-help-btn:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* ── Help drawer (rechter zijpaneel) ────────────────────────── */

.grexx-help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(440px, 92vw);
  background: #fff;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.grexx-help-drawer-open {
  transform: translateX(0);
}

.grexx-help-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

.grexx-help-drawer-title {
  font-weight: 600;
  color: #334155;
  font-size: 15px;
}

.grexx-help-drawer-close {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 2px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.grexx-help-drawer-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.grexx-help-drawer-close:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.grexx-help-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  line-height: 1.6;
  color: #1e293b;
  font-size: 14px;
}

.grexx-help-drawer-body h1,
.grexx-help-drawer-body h2,
.grexx-help-drawer-body h3 {
  margin-top: 1.4em;
  margin-bottom: 0.4em;
  color: #0f172a;
  font-weight: 600;
}

.grexx-help-drawer-body h1:first-child,
.grexx-help-drawer-body h2:first-child,
.grexx-help-drawer-body h3:first-child {
  margin-top: 0;
}

.grexx-help-drawer-body h1 { font-size: 1.25rem; }
.grexx-help-drawer-body h2 { font-size: 1.1rem; }
.grexx-help-drawer-body h3 { font-size: 1rem; }

.grexx-help-drawer-body p {
  margin: 0.5em 0;
}

.grexx-help-drawer-body ul {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.grexx-help-drawer-body li {
  margin: 0.25em 0;
}

.grexx-help-drawer-body strong {
  color: #0f172a;
}

.grexx-help-drawer-body em {
  color: #475569;
}

.grexx-help-drawer-body a {
  color: #2563eb;
  text-decoration: underline;
}

.grexx-help-drawer-body a:hover {
  color: #1d4ed8;
}

.grexx-help-drawer-body code {
  font-family: ui-monospace, monospace;
  font-size: 0.92em;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  color: #475569;
}

/* ── Help backdrop ──────────────────────────────────────────── */

.grexx-help-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9997;
}

.grexx-help-backdrop-open {
  opacity: 1;
  pointer-events: auto;
}

/* Bij smal scherm: help-knop iets dichter bij rand */
@media (max-width: 640px) {
  .grexx-help-btn {
    right: 80px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* ── Assistent ("jouw handen") ──────────────────────────────── */
.grexx-assistant-btn {
  position: fixed;
  bottom: 24px;
  right: 150px;          /* links van de help-knop (96px) + feedback (24px) */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 20px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  z-index: 9998;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.grexx-assistant-btn:hover { background: #4f46e5; transform: scale(1.06); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24); }
.grexx-assistant-btn:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }

.grexx-assistant-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.28);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 9998;
}
.grexx-assistant-backdrop-open { opacity: 1; pointer-events: auto; }

.grexx-assistant-drawer {
  position: fixed; top: 0; right: 0; height: 100%;
  width: 420px; max-width: 92vw;
  background: #fff; box-shadow: -8px 0 28px rgba(0, 0, 0, 0.18);
  transform: translateX(100%); transition: transform 0.22s ease;
  z-index: 9999; display: flex; flex-direction: column;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}
.grexx-assistant-drawer.grexx-asst-open { transform: translateX(0); }
.grexx-asst-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #e2e8f0; }
.grexx-asst-title { font-size: 15px; font-weight: 700; color: #1e293b; }
.grexx-asst-title small { font-weight: 500; color: #6366f1; margin-left: 4px; }
.grexx-asst-close { background: none; border: none; font-size: 26px; line-height: 1; color: #94a3b8; cursor: pointer; }
.grexx-asst-log { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.grexx-asst-msg { font-size: 13px; line-height: 1.5; padding: 9px 12px; border-radius: 12px; max-width: 88%; }
.grexx-asst-user { align-self: flex-end; background: #6366f1; color: #fff; border-bottom-right-radius: 3px; }
.grexx-asst-bot { align-self: flex-start; background: #f1f5f9; color: #1e293b; border-bottom-left-radius: 3px; }
.grexx-asst-proposal { align-self: flex-start; max-width: 88%; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 10px; padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grexx-asst-prop-desc { flex: 1 1 100%; font-size: 12px; color: #3730a3; }
.grexx-asst-confirm { background: #6366f1; color: #fff; border: none; border-radius: 7px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.grexx-asst-confirm:disabled { opacity: .6; cursor: default; }
.grexx-asst-cancel { background: #fff; color: #64748b; border: 1px solid #cbd5e1; border-radius: 7px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.grexx-asst-done { align-self: flex-start; font-size: 12px; color: #475569; font-style: italic; }
.grexx-asst-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid #e2e8f0; }
.grexx-asst-input { flex: 1; resize: none; border: 1px solid #cbd5e1; border-radius: 9px; padding: 8px 11px; font-size: 13px; font-family: inherit; }
.grexx-asst-input:focus { outline: none; border-color: #6366f1; }
.grexx-asst-send { background: #6366f1; color: #fff; border: none; border-radius: 9px; padding: 0 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
.grexx-asst-send:hover { background: #4f46e5; }
@media (max-width: 640px) {
  .grexx-assistant-btn { right: 134px; }
}

/* ── Audit / activiteitenlog ─────────────────────────────────── */
.grexx-audit-btn {
  position: fixed; bottom: 24px; right: 204px;
  width: 44px; height: 44px; border-radius: 50%;
  background: #0f766e; color: #fff; font-size: 19px; border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); z-index: 9998;
  transition: background 0.15s ease, transform 0.15s ease; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.grexx-audit-btn:hover { background: #0d5d56; transform: scale(1.06); }
.grexx-audit-btn:focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }
.grexx-audit-drawer {
  position: fixed; top: 0; right: 0; height: 100%;
  width: 500px; max-width: 94vw;
  background: #fff; box-shadow: -8px 0 28px rgba(0, 0, 0, 0.18);
  transform: translateX(100%); transition: transform 0.22s ease;
  z-index: 9999; display: flex; flex-direction: column;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}
.grexx-audit-drawer.grexx-asst-open { transform: translateX(0); }
.grexx-audit-bar { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px; border-bottom: 1px solid #e2e8f0; }
.grexx-audit-chain { font-size: 12px; font-weight: 600; color: #94a3b8; }
.grexx-audit-chain.ok { color: #16a34a; }
.grexx-audit-chain.bad { color: #dc2626; }
.grexx-audit-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.grexx-audit-filters input, .grexx-audit-filters select { border: 1px solid #cbd5e1; border-radius: 7px; padding: 5px 8px; font-size: 12px; font-family: inherit; }
.grexx-audit-filters input { flex: 1; min-width: 90px; }
.grexx-audit-refresh { border: 1px solid #cbd5e1; background: #fff; border-radius: 7px; padding: 5px 9px; font-size: 13px; cursor: pointer; }
.grexx-audit-log { flex: 1 1 auto; overflow-y: auto; padding: 6px 16px 16px; }
.grexx-audit-empty { color: #94a3b8; font-size: 13px; padding: 20px 0; text-align: center; }
.grexx-audit-row { display: grid; grid-template-columns: 92px 1fr auto; align-items: baseline; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f1f5f9; font-size: 12px; }
.grexx-audit-when { color: #94a3b8; font-variant-numeric: tabular-nums; }
.grexx-audit-who { font-weight: 600; color: #1e293b; }
.grexx-audit-what { color: #475569; }
.grexx-audit-via-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; color: #64748b; background: #f1f5f9; border-radius: 5px; padding: 1px 6px; align-self: center; }
.grexx-audit-via-tag.asst { color: #4338ca; background: #eef2ff; }
@media (max-width: 640px) {
  .grexx-audit-btn { right: 188px; }
}

/* ── Drawer vergroten (help/assistent/activiteit) ────────────── */
.grexx-asst-head-actions { display: flex; align-items: center; gap: 2px; }
.grexx-asst-expand, .grexx-help-drawer-expand {
  background: none; border: none; font-size: 17px; line-height: 1; color: #94a3b8;
  cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.grexx-asst-expand:hover, .grexx-help-drawer-expand:hover { color: #475569; background: #f1f5f9; }
.grexx-assistant-drawer, .grexx-audit-drawer, .grexx-help-drawer { transition: transform 0.22s ease, width 0.18s ease; }
.grexx-assistant-drawer.grexx-wide { width: min(860px, 94vw); }
.grexx-audit-drawer.grexx-wide { width: min(960px, 96vw); }
.grexx-help-drawer.grexx-wide { width: min(760px, 94vw); }
