/* artifacthost — KDE-Dolphin-flavored file browser. No frameworks. */

:root {
  --bg: #fcfcfc;
  --bg-alt: #eff0f1;
  --fg: #232629;
  --muted: #6e7175;
  --accent: #3daee9;          /* KDE Breeze blue */
  --accent-soft: #d6ecf8;
  --border: #d4d6d8;
  --danger: #da4453;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1e20;
    --bg-alt: #232629;
    --fg: #eff0f1;
    --muted: #9a9ea2;
    --accent: #3daee9;
    --accent-soft: #17394c;
    --border: #3a3d40;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.45 "Segoe UI", "Noto Sans", system-ui, sans-serif;
}
main { max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem 4rem; }
a { color: var(--accent); text-decoration: none; }
code { background: var(--bg-alt); padding: 0.1em 0.35em; border-radius: 4px; word-break: break-all; }
hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.5rem 1.25rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--fg); }
.brand span { color: var(--accent); }
.views { display: flex; gap: 0.25rem; }
.views a {
  padding: 0.3rem 0.75rem; border-radius: var(--radius); color: var(--fg);
}
.views a.active, .views a:hover { background: var(--accent-soft); color: var(--accent); }
.who { color: var(--muted); font-size: 0.85rem; }
.inline-form { display: inline; }

/* Buttons */
.button, button {
  font: inherit; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--fg);
  padding: 0.35rem 0.9rem;
  display: inline-block;
}
.button:hover, button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost { background: transparent; border: none; color: var(--muted); }
button.ghost:hover { color: var(--fg); }

/* Toolbar / breadcrumbs */
.toolbar { display: flex; align-items: center; gap: 0.75rem; margin: 0.75rem 0 1rem; }
.toolbar h2 { margin: 0; font-size: 1.15rem; }
.crumb { font-size: 1.05rem; }
.crumb-sep { color: var(--muted); }

/* Icon grid (the Dolphin part) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.5rem;
}
.tile {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 0.3rem;
  padding: 0.9rem 0.5rem 0.7rem;
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: default; user-select: none;
}
.tile:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.tile.selected, .tile:focus {
  background: var(--accent-soft);
  border-color: var(--accent);
  outline: none;
}
.tile-icon {
  font-size: 2.3rem; line-height: 1;
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); border-radius: 10px;
}
.tile-icon.file-ext {
  font-size: 0.9rem; font-weight: 700; text-transform: uppercase; color: var(--accent);
}
.tile-name {
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600;
}
.tile-meta { font-size: 0.72rem; color: var(--muted); }

.empty { color: var(--muted); padding: 3rem 1rem; text-align: center; }

/* Context menu */
.ctx-menu {
  position: fixed; z-index: 100; min-width: 200px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  padding: 4px;
}
.ctx-menu button {
  display: block; width: 100%; text-align: left;
  border: none; background: none; border-radius: 4px;
  padding: 0.4rem 0.75rem;
}
.ctx-menu button:hover { background: var(--accent-soft); color: var(--accent); }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover { background: rgba(218, 68, 83, 0.12); color: var(--danger); }
.ctx-sub { position: relative; }
.ctx-submenu {
  display: none;
  position: absolute; left: 100%; top: -5px; min-width: 190px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  padding: 4px;
}
.ctx-sub:hover .ctx-submenu { display: block; }

/* Drag & drop */
.browser.dragover { outline: 2px dashed var(--accent); outline-offset: -6px; }
.drophint {
  position: fixed; inset: auto 1rem 1rem 1rem; z-index: 90;
  text-align: center; padding: 1rem;
  background: var(--accent); color: #fff; border-radius: var(--radius);
  pointer-events: none;
}

/* Doc facts */
.doc-facts {
  display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem;
  margin: 0 0 1.25rem; font-size: 0.9rem;
}
.doc-facts dt { color: var(--muted); }
.doc-facts dd { margin: 0; }

/* Tokens */
.mint-form { display: flex; gap: 0.5rem; margin: 1rem 0; flex-wrap: wrap; }
.mint-form input, .mint-form select {
  font: inherit; padding: 0.35rem 0.6rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--fg);
}
.mint-form input { flex: 1; min-width: 200px; }
.token-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.token-table th, .token-table td {
  text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.token-table th { color: var(--muted); font-weight: 600; }
.token-table tr.revoked td { color: var(--muted); text-decoration: line-through; }
.code-block {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem 1rem; overflow-x: auto; font-size: 0.82rem;
}

/* Notices, login, toast */
.notice {
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 0.75rem 1rem; margin: 1rem 0;
}
.login-card {
  max-width: 430px; margin: 14vh auto 0; text-align: center;
  padding: 2rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-alt);
}
.login-card h1 { margin-top: 0; }
.login-card .accent { color: var(--accent); }
.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  z-index: 200;
  background: var(--fg); color: var(--bg);
  padding: 0.5rem 1.1rem; border-radius: 20px; font-size: 0.85rem;
}
