/* Palette lifted from the Augustus ClickGui module defaults
   (net.augustus.modules.render.ClickGui) and the launcher button CSS. */
@font-face { font-family: "Rubik"; src: url("assets/fonts/rubik.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("assets/fonts/rubik-bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --page: #161616;
  --panel: #282727;          /* ClickGui background / outline */
  --header: #222222;         /* ClickGui header + divider lines */
  --raised: #303030;
  --text: #b9bbbe;           /* ClickGui text */
  --text-strong: #e6e7e8;
  --text-dim: #7d8084;
  --accent: #2992de;         /* ClickGui hover / client color */
  --accent-hover: #2279b8;   /* launcher .button:hover */
  --on: #00d600;             /* ClickGui enabled */
  --off: #d60000;            /* ClickGui disabled */
  --radius: 10px;
  --mono: Consolas, "Cascadia Mono", "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
  --sans: "Rubik", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(41, 146, 222, .12), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(41, 146, 222, .08), transparent 60%),
    var(--page);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
}
code { font-family: var(--mono); font-size: .92em; color: var(--text-strong); }

/* ---- window -------------------------------------------------------------- */
.window {
  width: min(1060px, 100%);
  background: var(--panel);
  border: 1px solid #1c1c1c;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  overflow: hidden;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--header);
  border-bottom: 3px solid var(--header);
  box-shadow: 0 3px 0 #1d1d1d;
}
.logo { width: 34px; height: auto; filter: drop-shadow(0 0 8px rgba(0, 110, 255, .35)); }
.titles { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.titlebar h1 { margin: 0; font-size: 22px; font-weight: 700; color: var(--text-strong); letter-spacing: .2px; }
.subtitle { font-family: var(--mono); color: var(--accent); font-size: 14px; }
.badge {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  padding: 4px 10px; border-radius: 999px; background: #1b1b1b; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--on); box-shadow: 0 0 6px var(--on); }

.body { display: grid; grid-template-columns: 230px 1fr; min-height: 460px; }

/* ---- sidebar (ClickGUI module list) -------------------------------------- */
.sidebar {
  padding: 18px 14px;
  border-right: 3px solid var(--header);
  display: flex; flex-direction: column; gap: 6px;
}
.category {
  font-weight: 700; font-size: 15px; color: var(--text-strong);
  padding: 0 8px 8px; margin-bottom: 4px; border-bottom: 1px solid #333;
}
.module {
  all: unset;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 6px;
  font-family: var(--mono); font-size: 15px;
  cursor: pointer; user-select: none;
  transition: background .12s;
}
.module:hover { background: rgba(255, 255, 255, .04); }
.module:hover .module-name { color: var(--accent); }
.module:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.module.locked { cursor: default; }
.module.locked:hover { background: none; }
.module.locked:hover .module-name { color: var(--on); }
.module-name { color: var(--off); transition: color .12s; }
.module-name.on, .module[aria-checked="true"] .module-name { color: var(--on); }
.module-meta { font-size: 11px; color: var(--text-dim); }

.switch {
  position: relative; width: 30px; height: 16px; border-radius: 999px;
  background: #3a3a3a; transition: background .15s; flex: none;
}
.knob {
  position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--text); transition: transform .15s, background .15s;
}
.module[aria-checked="true"] .switch { background: rgba(0, 214, 0, .35); }
.module[aria-checked="true"] .knob { transform: translateX(14px); background: var(--on); }

.module-desc { margin: 0 10px 8px; font-size: 12px; color: var(--text-dim); line-height: 1.45; }

/* ClickGUI-style setting under a module */
.setting { margin: 0 10px 8px; padding-left: 10px; border-left: 2px solid var(--accent); }
.setting label { display: block; font-family: var(--mono); font-size: 12px; color: var(--text); margin-bottom: 4px; }
.setting input {
  width: 100%; padding: 6px 8px; border-radius: 5px; border: 1px solid #3a3a3a;
  background: #1e1e1e; color: var(--text-strong); font: 13px var(--mono);
}
.setting input:focus { outline: none; border-color: var(--accent); }
.info s.was { color: var(--text-dim); text-decoration-color: rgba(214, 0, 0, .7); }

.advanced { margin-top: auto; padding: 10px; border-top: 1px solid #333; font-size: 12px; }
.advanced summary { cursor: pointer; color: var(--text-dim); font-family: var(--mono); font-size: 13px; }
.advanced summary:hover { color: var(--accent); }
.advanced label { display: block; margin: 10px 0 4px; color: var(--text); }
.advanced input {
  width: 100%; padding: 7px 8px; border-radius: 5px; border: 1px solid #3a3a3a;
  background: #1e1e1e; color: var(--text-strong); font: 12px var(--mono);
}
.advanced input:focus { outline: none; border-color: var(--accent); }
.advanced input.invalid { border-color: var(--off); }
.hint { margin: 6px 0 0; color: var(--text-dim); line-height: 1.4; }

/* ---- content ------------------------------------------------------------- */
.content { padding: 20px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 34px 16px; text-align: center;
  border: 2px dashed #3d3d3d; border-radius: var(--radius);
  background: rgba(0, 0, 0, .12);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(41, 146, 222, .07); }
.dropzone:focus-within { border-color: var(--accent); }
.dropzone.compact { padding: 14px 16px; flex-direction: row; gap: 12px; }
.dropzone.compact .drop-icon { width: 22px; height: 22px; }
.drop-icon { width: 34px; height: 34px; color: var(--accent); }
.drop-title { font-size: 16px; color: var(--text-strong); overflow-wrap: anywhere; }
.drop-sub { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

.error {
  padding: 10px 14px; border-radius: 6px;
  background: rgba(214, 0, 0, .1); border: 1px solid rgba(214, 0, 0, .45); color: #ff8a8a;
  font-family: var(--mono); font-size: 13px;
}

.result { display: flex; flex-direction: column; gap: 16px; }
.result-grid { display: grid; grid-template-columns: 1fr 220px; gap: 16px; align-items: start; }

.info {
  margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0;
  background: var(--header); border-radius: 8px; overflow: hidden;
}
.info dt, .info dd { margin: 0; padding: 7px 12px; border-bottom: 1px solid #2c2c2c; }
.info dt { color: var(--text-dim); font-size: 12px; padding-top: 9px; }
.info dd { font-family: var(--mono); color: var(--text-strong); overflow-wrap: anywhere; }
.info dt:nth-last-of-type(1), .info dd:last-of-type { border-bottom: 0; }
.tag { display: inline-block; padding: 0 7px; border-radius: 4px; font-size: 12px; line-height: 20px; }
.tag.on { color: var(--on); background: rgba(0, 214, 0, .1); }
.tag.off { color: #ff5c5c; background: rgba(214, 0, 0, .12); }
.tag.info { color: var(--accent); background: rgba(41, 146, 222, .12); }
.arrow { color: var(--text-dim); margin: 0 6px; }

/* Augustus ArrayList-style enabled modules */
.arraylist-wrap { background: var(--header); border-radius: 8px; padding: 10px 0 10px 10px; }
.arraylist-label { font-size: 12px; color: var(--text-dim); padding-right: 12px; margin-bottom: 6px; }
.arraylist {
  list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto;
  display: flex; flex-direction: column; align-items: flex-end;
}
.arraylist li {
  font-family: var(--mono); font-size: 13px; line-height: 19px;
  padding: 0 8px; background: rgba(0, 0, 0, .35); color: var(--accent);
  border-right: 2px solid var(--accent); white-space: nowrap;
}
.arraylist li.empty { color: var(--text-dim); border-color: transparent; background: none; }

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn {
  all: unset; cursor: pointer;
  padding: 9px 18px; border-radius: 6px; font-weight: 700; font-size: 14px;
  background: #3a3a3a; color: var(--text-strong);
  transition: background .12s, transform .12s;
}
.btn:hover { background: #444; transform: scale(1.01); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.out-name { font-family: var(--mono); font-size: 12px; color: var(--text-dim); overflow-wrap: anywhere; }

.preview-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-dim); margin-bottom: -10px; }
.preview {
  margin: 0; padding: 12px 14px; max-height: 360px; overflow: auto;
  background: #1b1b1b; border-radius: 8px; border: 1px solid #262626;
  font: 12.5px/1.55 var(--mono); color: var(--text); tab-size: 2;
}
.preview .k { color: #7fb8e6; }
.preview .s { color: #c3e88d; }
.preview .n { color: #f78c6c; }
.preview .b { color: #c792ea; }
.preview mark { background: rgba(0, 214, 0, .14); color: inherit; border-radius: 3px; outline: 1px solid rgba(0, 214, 0, .35); }
.preview mark.prot { background: rgba(214, 0, 0, .15); outline-color: rgba(214, 0, 0, .45); }

.statusbar {
  padding: 10px 18px; font-size: 12px; color: var(--text-dim);
  background: var(--header); border-top: 3px solid var(--header);
}

/* ---- Augustus-style notifications (Configsystem) ------------------------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.toast {
  width: 290px; max-width: calc(100vw - 32px);
  background: rgba(34, 34, 34, .96); border-radius: 6px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  animation: toast-in .22s ease-out;
}
.toast.out { animation: toast-out .22s ease-in forwards; }
.toast-body { padding: 9px 12px; }
.toast-title { font-weight: 700; font-size: 13px; color: var(--text-strong); }
.toast-msg { font-family: var(--mono); font-size: 12px; color: var(--text); overflow-wrap: anywhere; }
.toast-msg em { font-style: normal; color: #ff5555; } /* §c */
.toast-bar { height: 2px; background: var(--accent); transform-origin: left; animation: toast-bar linear forwards; }
.toast.error .toast-bar { background: var(--off); }
@keyframes toast-in { from { transform: translateX(110%); opacity: 0; } }
@keyframes toast-out { to { transform: translateX(110%); opacity: 0; } }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---- page tabs (titlebar) ------------------------------------------------ */
.tabs { display: flex; gap: 4px; margin-left: 18px; }
.tabs a {
  font-family: var(--mono); font-size: 14px; color: var(--text-dim); text-decoration: none;
  padding: 5px 10px; border-radius: 5px; border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--accent); background: rgba(255, 255, 255, .03); }
.tabs a[aria-current="page"] { color: var(--text-strong); border-bottom-color: var(--accent); border-radius: 5px 5px 0 0; }
.tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- configs page ----------------------------------------------------------- */
.cat-nav { display: flex; flex-direction: column; gap: 2px; }
.cat-nav .category { margin-top: 12px; }
.cat-link {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px; text-decoration: none;
  font-family: var(--mono); font-size: 15px; color: var(--text);
}
.cat-link:hover { background: rgba(255, 255, 255, .04); color: var(--accent); }
.cat-link.active { color: var(--on); background: rgba(0, 214, 0, .06); }
.cat-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.count { font-size: 11px; color: var(--text-dim); background: #1e1e1e; padding: 0 7px; border-radius: 999px; line-height: 18px; }

.install { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid #333; font-size: 12px; color: var(--text-dim); }
.install-title { font-family: var(--mono); font-size: 13px; color: var(--text); margin-bottom: 4px; }
.install p { margin: 0; line-height: 1.45; }
.install b { color: var(--text); font-weight: 400; font-family: var(--mono); }

.list-head h2 { margin: 0; font-size: 20px; color: var(--text-strong); }
.list-sub { margin: 2px 0 0; font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
#list { display: flex; flex-direction: column; gap: 22px; }

.cat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 3px solid var(--header); }
.cat-head h3 { margin: 0; font-size: 16px; color: var(--text-strong); }
.cat-note { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.tag.warn { color: #f0a640; background: rgba(240, 166, 64, .12); }

.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.cfg {
  background: var(--header); border-radius: 8px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  border: 1px solid transparent; transition: border-color .12s;
}
.cfg:hover { border-color: #353535; }
.cfg-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cfg-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.cfg-name h4 { margin: 0; font-family: var(--mono); font-size: 16px; font-weight: 400; color: var(--on); overflow-wrap: anywhere; }
.btn.small { padding: 6px 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.btn.small svg { width: 15px; height: 15px; }

.cfg-meta { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px 12px; }
.cfg-meta dt { font-size: 11px; color: var(--text-dim); }
.cfg-meta dd { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--text-strong); overflow-wrap: anywhere; }

.cfg-mods summary { cursor: pointer; font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.cfg-mods summary:hover { color: var(--accent); }
.chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; max-height: 220px; overflow-y: auto; }
.chips li {
  font-family: var(--mono); font-size: 12px; line-height: 19px; padding: 0 7px;
  background: rgba(0, 0, 0, .35); color: var(--accent); border-right: 2px solid var(--accent);
}

/* ---- small screens ------------------------------------------------------- */
@media (max-width: 760px) {
  body { padding: 16px; }
  .body { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 3px solid var(--header); }
  .advanced { margin-top: 4px; }
  .result-grid { grid-template-columns: 1fr; }
  .dropzone.compact { flex-direction: column; gap: 4px; }
  .arraylist { max-height: 160px; }
  .badge { display: none; }
  .titlebar { flex-wrap: wrap; }
  .tabs { margin-left: auto; }
  .cat-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .cat-nav .category { display: none; }
  .cat-link { font-size: 13px; padding: 5px 9px; background: rgba(255, 255, 255, .03); }
  .install { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; }
}
