/* ═══════════════════════════════════════════════════
   SIGNALPULSE — admin.css  v2
   Icon-first slim sidebar · glowing nav rail
═══════════════════════════════════════════════════ */

#screen-admin { background: var(--bg); overflow: hidden; }

/* ── TOPBAR ── */
.admin-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px; height: 52px;
  background: var(--bg1); border-bottom: 1px solid var(--border);
  flex-shrink: 0; z-index: 20;
}
.admin-logo {
  display: flex; align-items: center; gap: 9px; flex-shrink: 0;
}
.admin-logo-hex {
  width: 28px; height: 32px; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.admin-logo-hex svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.admin-logo-target { position: relative; z-index: 2; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; }
.admin-logo-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); animation: cBlink .8s ease-in-out infinite; }
.admin-logo-cross-h { position: absolute; width: 12px; height: 1px; background: rgba(168,85,247,0.6); }
.admin-logo-cross-v { position: absolute; width: 1px; height: 12px; background: rgba(168,85,247,0.6); }
.admin-appname {
  font-family: var(--fh); font-size: 1rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--accent-grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Tabs */
.admin-tabs { display: flex; gap: 2px; background: var(--bg2); border-radius: var(--rs); padding: 3px; margin-left: 8px; }
.admin-tab {
  font-family: var(--fh); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  background: none; border: none; cursor: pointer;
  padding: 5px 14px; border-radius: 6px;
  color: var(--sub); transition: all .15s;
  display: flex; align-items: center; gap: 6px;
}
.admin-tab.active { background: var(--bg3); color: var(--text); }
.admin-tab:hover:not(.active) { color: var(--text); }
.admin-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status-pill {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--fm); font-size: 10px; color: var(--sub);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px;
}

/* ── LAYOUT ── */
.admin-body {
  display: flex;
  flex-direction: row;
  flex: 1; overflow: hidden;
}

/* ── SIDEBAR ── */
.admin-sidebar {
  background: var(--bg1); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: visible;
  padding: 12px 0; gap: 2px;
  position: relative; z-index: 40;
  width: 56px; flex-shrink: 0;
}

/* Icon-first nav items */
.nav-item {
  display: flex; align-items: center; gap: 0;
  padding: 10px 16px; cursor: pointer;
  position: relative; overflow: hidden;
  border-left: 2px solid transparent;
  transition: background .15s, border-color .15s;
  color: var(--sub); white-space: nowrap;
}
.nav-item:hover { background: rgba(45,212,255,0.04); color: var(--text); }
.nav-item.active {
  background: rgba(45,212,255,0.08);
  border-left-color: var(--accent);
  color: var(--text);
}
/* Glow bleed on active */
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 40px;
  background: linear-gradient(90deg, rgba(45,212,255,0.15), transparent);
  pointer-events: none;
}
.nav-icon { font-size: 16px; flex-shrink: 0; width: 24px; text-align: center; }
.nav-label {
  font-family: var(--fh); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  max-width: 0; overflow: hidden; opacity: 0;
  transition: max-width .25s ease, opacity .2s ease, margin-left .25s ease;
  margin-left: 0;
}
/* nav labels hidden — icon-only sidebar */

/* Slide-in underline on hover */
.nav-item::after {
  content: ''; position: absolute; bottom: 0; left: 16px; right: 16px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .2s ease;
}
.nav-item:hover::after, .nav-item.active::after { transform: scaleX(1); }

.nav-badge {
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--red); color: #fff;
  font-family: var(--fm); font-size: 9px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px; margin-left: auto; flex-shrink: 0;
}

/* Sidebar pull tab — protrudes from right edge of icon rail */
.sidebar-tab {
  position: absolute;
  top: 50%;
  right: -20px; /* always protrudes 20px past the panel's right edge */
  transform: translateY(-50%);
  width: 20px;
  height: 52px;
  background: var(--bg1);
  border: 1px solid var(--border2);
  border-left: none;
  border-radius: 0 8px 8px 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 50;
  color: var(--sub); font-size: 14px; font-weight: 700;
  transition: color .15s, background .15s, box-shadow .15s;
  user-select: none;
  line-height: 1;
}
.sidebar-tab:hover {
  color: var(--accent);
  background: var(--bg2);
  box-shadow: 2px 0 12px var(--accent-glow);
}

/* ── SIDEBAR EXPANDED CONTENT ── */
.sidebar-panel {
  width: 0;
  overflow: visible; /* tab must be visible outside the 0-width panel */
  background: var(--bg1);
  border-right: none;
  display: flex; flex-direction: column;
  flex-shrink: 0;
  position: relative;
  transition: width .28s cubic-bezier(.16,1,.3,1);
  z-index: 30;
}
.sidebar-panel.open {
  width: 220px;
  border-right: 1px solid var(--border2);
}
/* Clip the inner content — not the panel itself (tab lives outside) */
.sidebar-panel-inner {
  width: 220px;
  min-width: 220px;
  padding: 16px 14px;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 14px;
  flex: 1;
  /* Hide content when panel is closed */
  clip-path: inset(0 0 0 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.sidebar-panel.open .sidebar-panel-inner {
  opacity: 1;
  pointer-events: auto;
}

/* Stats */
.stats-row { display: flex; gap: 6px; }
.stat-box {
  flex: 1; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rs); padding: 8px 6px; text-align: center;
}
.stat-num { font-family: var(--fm); font-size: 18px; color: var(--accent); font-weight: 500; }
.stat-lbl { font-size: 8px; color: var(--sub); text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }

/* Source inputs */
.source-section { display: flex; flex-direction: column; gap: 7px; }
.inp-row { display: flex; gap: 6px; }
.pills-row { display: flex; flex-wrap: wrap; gap: 4px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-family: var(--fh); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; border: 1.5px solid transparent; transition: all .15s; user-select: none;
}
.pill-bsky { border-color: #002d66; color: #60a5fa; }
.pill-bsky.on { background: var(--bluesky); color: #fff; border-color: var(--bluesky); }
.pill-redd { border-color: #5c1a00; color: #fb923c; }
.pill-redd.on { background: var(--reddit); color: #fff; border-color: var(--reddit); }
.pill-yt { border-color: #5c0000; color: #f87171; }
.pill-yt.on { background: var(--youtube); color: #fff; border-color: var(--youtube); }

.tag-list { display: flex; flex-direction: column; gap: 4px; max-height: 150px; overflow-y: auto; }
.tag-row {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rs); padding: 6px 9px;
  font-size: 12px; font-weight: 600; animation: rIn .2s ease;
}
@keyframes rIn { from{opacity:0;transform:translateY(-3px);} to{opacity:1;transform:none;} }
.tag-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--fm); font-size: 11px; }
.tag-dots { display: flex; gap: 3px; flex-shrink: 0; }
.tag-dot { width: 6px; height: 6px; border-radius: 50%; }
.tag-del { background: none; border: none; color: var(--sub); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 1px; transition: color .15s; flex-shrink: 0; }
.tag-del:hover { color: var(--red); }
.empty-msg { font-family: var(--fm); font-size: 10px; color: var(--sub); text-align: center; padding: 10px; border: 1px dashed var(--dim); border-radius: var(--rs); }

/* Settings */
.settings-list { display: flex; flex-direction: column; gap: 0; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 11px; color: var(--sub); letter-spacing: .03em; }
.setting-val { font-family: var(--fm); font-size: 11px; color: var(--accent); min-width: 28px; text-align: right; }

/* CORS warning */
#cors-warn {
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--rs); padding: 9px 11px;
  font-size: 10px; color: #fbbf24; gap: 7px; align-items: flex-start; line-height: 1.5;
  font-family: var(--fm);
}

/* ── MAIN ── */
.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.panel { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.panel.active { display: flex; }

/* ── MOD PANEL ── */
.mod-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 18px; background: var(--bg1); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.mod-panel-title { font-family: var(--fh); font-size: .95rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; flex: 1; }

.mod-grid {
  flex: 1; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; padding: 16px; align-content: start;
}
.mod-empty {
  grid-column: 1/-1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 60px 20px; color: var(--sub);
}
.mod-empty-icon { font-size: 44px; opacity: .2; }
.mod-empty-text { font-family: var(--fh); font-size: 13px; letter-spacing: .05em; }

/* ── MOD CARDS ── */
.mc {
  background: var(--bg2); border: 1px solid var(--border);
  border-top: 2px solid var(--pc, var(--accent));  /* platform-colored top border */
  border-radius: var(--r); overflow: hidden;
  display: flex; flex-direction: column; position: relative;
  transition: border-color .2s, transform .18s, box-shadow .18s;
  animation: mcIn .28s ease; cursor: pointer;
}
@keyframes mcIn { from{opacity:0;transform:scale(.96);} to{opacity:1;transform:scale(1);} }

/* Hover: glow only — no transform (avoids stacking context issues with buttons) */
.mc:hover {
  box-shadow: 0 4px 24px var(--pc-glow, rgba(56,189,248,0.2));
  border-color: var(--pc, var(--accent));
}

/* Selected state: slight tilt + glow */
.mc.selected {
  box-shadow: 0 0 0 2px var(--accent), 0 8px 24px var(--accent-glow);
  border-color: var(--accent);
}

.mc-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: var(--bg3); flex-shrink: 0; }
.mc-yt-thumb { position: relative; }
.mc-yt-thumb::after { content:'▶'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.4); font-size:24px; color:rgba(255,255,255,.9); pointer-events:none; }

.mc-body { padding: 9px 12px 9px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.mc-header { display: flex; align-items: center; gap: 7px; }
.mc-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--bg3); flex-shrink: 0; border: 1.5px solid var(--border2); }
.mc-user { flex: 1; min-width: 0; }
.mc-name { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-handle { font-size: 10px; color: var(--sub); font-family: var(--fm); }
.plat-tag { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; letter-spacing: .06em; text-transform: uppercase; }
.pt-bsky { background: rgba(0,133,255,.15); color: #60a5fa; }
.pt-redd { background: rgba(255,69,0,.15); color: #fb923c; }
.pt-yt   { background: rgba(255,0,0,.15); color: #f87171; }

.mc-text { font-size: 12px; line-height: 1.5; color: #b8c4e0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.mc-text .ht { color: var(--accent); font-weight: 600; }
.mc-time { font-size: 9px; color: var(--sub); font-family: var(--fm); }

.mc-actions { display: flex; gap: 5px; padding: 9px 11px; border-top: 1px solid var(--border); flex-shrink: 0; }
.mc-actions .btn { flex: 1; justify-content: center; padding: 6px; font-size: 10px; }

/* ── WALL PREVIEW PANEL ── */
.wall-preview-area { flex: 1; background: #03050d; position: relative; overflow: hidden; }

/* ── PLAY MODE ── */
.play-mode-wrap { display: flex; gap: 5px; }
.play-mode-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 6px; background: var(--bg2);
  border: 1.5px solid var(--dim); border-radius: var(--rs); cursor: pointer;
  transition: all .15s; font-family: var(--fh); font-size: 9px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--sub);
}
.play-mode-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.play-mode-btn:hover:not(.active) { border-color: var(--border2); color: var(--text); }
.play-mode-icon { font-size: 18px; }

/* ── MOD TABS ── */
.mod-tabs {
  display: flex;
  gap: 3px;
  background: var(--bg2);
  border-radius: var(--rs);
  padding: 3px;
}
.mod-tab {
  background: none; border: none; cursor: pointer;
  font-family: var(--fh); font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 6px;
  color: var(--sub); transition: all .15s;
  display: flex; align-items: center; gap: 6px;
}
.mod-tab.active { background: var(--bg3); color: var(--text); }
.mod-tab:hover:not(.active) { color: var(--text); }
.mod-tab-badge {
  min-width: 16px; height: 16px;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(56,189,248,0.3);
  border-radius: 8px; font-size: 9px; font-weight: 700;
  font-family: var(--fm); display: inline-flex;
  align-items: center; justify-content: center; padding: 0 4px;
}
.mod-tab.active .mod-tab-badge {
  background: var(--accent); color: #000; border-color: transparent;
}
