/* =========================
   Cards, loaders, tooltips
   ========================= */

/* Card shells */
.item, .mount {
  display: inline-block;
  width: 120px;
  margin: 10px;
  text-align: center;
  position: relative;
  background-color: #222;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #333;
}
.item img, .mount img { width: 64px; height: 64px; border-radius: 4px; }
.item.missing-image, .mount.missing-image { border: 1px solid red; }

/* Loader */
.loader-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
}
.loader {
  border: 6px solid #333;
  border-top: 6px solid #00aaff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loader-text { margin-top: 10px; font-size: 14px; color: #ccc; text-align: center; }

/* ==== Anti-copy deterrents (site-wide) ==== */
img, .img-protected, canvas {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}
/* Make grid images non-interactive (no right-click target) */
.item img, .mount img { pointer-events: none; }
/* Allow opt-out */
.allow-interact {
  pointer-events: auto !important;
  -webkit-user-drag: auto !important;
  user-select: auto !important;
  -webkit-touch-callout: default !important;
}

/* Small meta line under names */
.item .meta { margin-top: 4px; font-size: 12px; color: #aaa; }

/* --- Tooltip redesign --- */
.tooltip {
  display: none;
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #1b1b1b;
  color: #e6e6e6;
  border: 1px solid #333;
  border-radius: 10px;
  width: 320px;
  padding: 10px;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  font-size: 13px;
  text-align: left;
  white-space: normal;
  line-height: 1.4;
}
.item:hover .tooltip, .mount:hover .tooltip { display: block; }

.tt-wrap { display: flex; gap: 10px; max-width: 350px; }
.tt-left { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tooltip-thumb { width: 64px; height: 64px; border-radius: 4px; flex-shrink: 0; background: #111; border: 1px solid #333; }
.tt-body { flex: 1; display: flex; flex-direction: column; }
.tt-title { font-weight: bold; margin-bottom: 6px; color: #fff; }

/* Two columns of label:value */
.tt-grid { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tt-grid .kv { display: flex; flex: 0 0 calc(50% - 10px); align-items: flex-start; gap: 4px; }
.tt-grid .k { font-weight: bold; white-space: nowrap; }
.tt-grid .v { flex: 1; word-break: break-word; }

/* Full-width rows */
.tt-grid .kv-full { flex: 0 0 100%; display: block; margin-top: 6px; }
.tt-grid .kv-full .k { display: block; font-weight: bold; margin-bottom: 2px; }
.tt-grid .kv-full .v { display: block; white-space: normal; word-break: break-word; }

/* Copy buttons */
.tt-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.copy-btn {
  font-size: 11px;
  padding: 3px 6px;
  background: #2b2b2b;
  border: 1px solid #2ea043;
  border-radius: 6px;
  color: #ddd;
  cursor: pointer;
  text-align: center;
}
.copy-btn:hover { background: #3a3a3a; }
.copy-btn.copied { background: #1c7c2f; border-color: #2ea043; color: #fff; }

/* =========================
   Sidebar helpers (arrows, focus)
   ========================= */

/* Remove outlines / focus rings anywhere in the sidebar */
.sidebar .nav-link:focus,
.sidebar .nav-link:active,
.sidebar-nav summary:focus,
.sidebar-nav summary:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Hide native disclosure marker */
.sidebar-nav details > summary::-webkit-details-marker { display: none; }

/* Top-level groups (Client, Server, Database, Guides) caret */
.sidebar-nav .nav-group > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
}
.sidebar-nav .nav-group > summary::after {
  content: "▸";
  margin-left: auto;
  font-size: 0.95em;
  transition: transform .18s ease;
}
.sidebar-nav .nav-group[open] > summary::after { content: "▾"; }

/* Inner drawers (Equipment / Items) caret */
.sidebar-nav .nav-group > ul > li > details > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 8px;    /* neutral; avoids any theme ring */
  outline: none;
}
.sidebar-nav .nav-group > ul > li > details > summary::after {
  content: "▸";
  margin-left: auto;
  font-size: 0.9em;
  transition: transform .18s ease;
}
.sidebar-nav .nav-group > ul > li > details[open] > summary::after { content: "▾"; }

/* Active link look */
.sidebar-nav a.active { color: #fff; font-weight: 700; }
