:root {
  --hub-primary: #6366f1;
  --hub-secondary: #8b5cf6;
  --hub-bg: #111022;
  --hub-card: #1a1a2e;
  --hub-text: #e2e8f0;
  --hub-muted: #94a3b8;
  --hub-border: #2d2d4e;
  --hub-success: #10b981;
  --hub-warning: #f59e0b;
  --hub-danger: #ef4444;
  --hub-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  --hub-radius: 20px;
}

* { box-sizing: border-box; }

body.hub-page {
  margin: 0;
  font-family: "Poppins", "Space Grotesk", sans-serif;
  color: var(--hub-text);
  background: radial-gradient(circle at 0 0, rgba(99, 102, 241, 0.18), transparent 45%), var(--hub-bg);
}

.hub-shell { max-width: 1240px; margin: 0 auto; padding: 24px 18px 40px; }

.hub-banner {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  background: linear-gradient(135deg, #1f2658, #333b8a);
  color: #fff; border-radius: 16px; padding: 10px 14px; margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(35, 41, 94, 0.3);
}
.hub-banner strong { font-size: 14px; }
.hub-banner button { border: 0; background: rgba(255,255,255,.15); color:#fff; border-radius: 999px; width: 28px; height: 28px; cursor: pointer; }

.hub-header {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  box-shadow: var(--hub-shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.hub-header-top { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:14px; }
.hub-title h1 { margin: 0; font-size: 26px; font-family: "Space Grotesk", sans-serif; }
.hub-title p { margin: 4px 0 0; color: var(--hub-muted); }

#hubRoot .btn-primary,
.filter-panel .btn-primary,
.modal-card .btn-primary,
.pdf-modal .btn-primary {
  border: 0; background: linear-gradient(135deg, var(--hub-primary), var(--hub-secondary)); color:#fff;
  border-radius: 14px; padding: 10px 16px; font-weight: 700; cursor:pointer; transition:.2s transform,.2s box-shadow;
  box-shadow: 0 12px 24px rgba(99, 102, 241, .35);
}
#hubRoot .btn-primary:hover,
.filter-panel .btn-primary:hover,
.modal-card .btn-primary:hover,
.pdf-modal .btn-primary:hover { transform: translateY(-2px); }

#hubRoot .btn-soft,
.filter-panel .btn-soft,
.modal-card .btn-soft,
.pdf-modal .btn-soft {
  border: 1px solid var(--hub-border); background: var(--hub-card); color: var(--hub-text); border-radius: 12px; padding: 9px 12px; cursor: pointer;
}

.hub-toolbar { display:grid; grid-template-columns: 1.3fr 180px 140px auto; gap:10px; }
.hub-toolbar input, .hub-toolbar select {
  border:1px solid var(--hub-border); border-radius: 12px; padding: 11px 12px; font: inherit; background: var(--hub-card); color: var(--hub-text);
}

.chip-row, .tab-row { display:flex; flex-wrap:wrap; gap:8px; margin-top: 14px; }
.chip, .tab-pill {
  border:1px solid var(--hub-border); background: var(--hub-card); color:var(--hub-muted); border-radius:999px; padding:7px 12px; font-size:13px; cursor:pointer;
}
.chip.active, .tab-pill.active { background: rgba(99,102,241,.12); color: var(--hub-primary); border-color: rgba(99,102,241,.35); }
.chip.star { background: linear-gradient(135deg, rgba(245,158,11,.16), rgba(139,92,246,.12)); color: #7c4a06; }

.hub-main { display:grid; grid-template-columns: 1fr; gap: 16px; }
.hub-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.resource-card {
  background: var(--hub-card); border:1px solid var(--hub-border); border-radius: 18px; padding: 14px; box-shadow: var(--hub-shadow);
  transition: .2s transform, .2s box-shadow;
  animation: hubCardGlow 3.4s ease-in-out infinite;
}
.resource-card:hover { transform: translateY(-3px); box-shadow: 0 22px 40px rgba(25,33,74,.14), 0 0 20px rgba(99,102,241,.28); }
@keyframes hubCardGlow {
  0%, 100% { box-shadow: 0 16px 32px rgba(0, 0, 0, 0.34), 0 0 0 rgba(99,102,241,.16); }
  50% { box-shadow: 0 22px 40px rgba(20, 24, 52, 0.38), 0 0 18px rgba(99,102,241,.22); }
}
.resource-top { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.resource-badges { display:flex; gap:6px; flex-wrap:wrap; }
.badge {
  border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 700; border:1px solid transparent;
}
.badge.type { background: rgba(99,102,241,.12); color: var(--hub-primary); }
.badge.pin { background: rgba(16,185,129,.13); color: #047857; }
.badge.version { background: rgba(139,92,246,.13); color:#6d28d9; }

.card-actions { display:flex; gap:6px; }
.icon-btn {
  border:1px solid var(--hub-border); background: var(--hub-card); color: var(--hub-text); width:30px; height:30px; border-radius:10px; cursor:pointer;
}

.preview {
  margin: 12px 0; border:1px solid var(--hub-border); border-radius: 14px; overflow:hidden; background:#f8f9ff;
}
.preview.pdf .bar { padding: 8px 10px; background: #1c1c38; font-size:12px; color:var(--hub-muted); }
.preview.pdf .frame { height: 130px; background: linear-gradient(180deg, #181830, #13132a); display:grid; place-items:center; color:var(--hub-muted); font-size:12px; }
.preview.media { height: 130px; display:grid; place-items:center; color:#fff; background: linear-gradient(135deg,#111936,#4b2f95); font-weight:600; }
.preview.media .play { width:46px; height:46px; border-radius:50%; border:0; background:rgba(255,255,255,.22); color:#fff; cursor:pointer; }

.resource-card h3 { margin: 0 0 6px; font-size: 17px; font-family: "Space Grotesk", sans-serif; }
.resource-meta, .resource-desc { margin: 0; font-size: 13px; color: var(--hub-muted); }
.resource-desc { margin-top: 7px; min-height: 38px; }
.resource-footer { margin-top: 12px; display:flex; justify-content:space-between; align-items:center; gap:8px; }
.vote { display:flex; align-items:center; gap:6px; }
.vote button { border:1px solid var(--hub-border); background: var(--hub-card); color: var(--hub-text); border-radius:8px; width:26px; height:26px; cursor:pointer; }

.details-toggle { margin-top:8px; }
.details-toggle summary { cursor:pointer; color:var(--hub-primary); font-size:13px; }
.details-toggle p { margin:8px 0 0; font-size:12px; color:var(--hub-muted); }

.recommended-block, .qa-block, .request-cta, .empty-state, .skeleton-wrap {
  background: var(--hub-card); border:1px solid var(--hub-border); border-radius:18px; padding:14px; box-shadow: var(--hub-shadow);
}
.recommended-block h2, .qa-block h2 { margin:0 0 10px; font-size:18px; font-family:"Space Grotesk",sans-serif; }

.request-cta { display:flex; justify-content:space-between; align-items:center; gap:10px; }

.empty-state { text-align:center; padding: 30px 16px; }
.empty-state h3 { margin: 0 0 6px; font-size: 22px; }
.empty-actions { margin-top: 14px; display:flex; justify-content:center; gap:10px; flex-wrap:wrap; }

.skeleton-wrap { display:none; }
.skeleton-wrap.visible { display:block; }
.skeleton-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
.skeleton-card { border:1px solid var(--hub-border); border-radius:14px; padding:10px; }
.shimmer { height: 12px; border-radius: 6px; background: linear-gradient(90deg,#1e1e40,#2d2d60,#1e1e40); background-size:200% 100%; animation: shimmer 1.2s infinite; margin-bottom:8px; }
.shimmer.big { height: 110px; border-radius: 10px; }
@keyframes shimmer { from { background-position:200% 0; } to { background-position:-200% 0; } }

.filter-drawer, .overlay-modal {
  position: fixed; inset: 0; background: rgba(6, 10, 24, .55); opacity: 0; pointer-events: none; transition: .2s;
  display:flex; justify-content:flex-end; z-index: 1000;
}
.filter-drawer.open, .overlay-modal.open { opacity: 1; pointer-events: auto; }
.filter-panel {
  width: min(380px, 92%); height: 100%; background: #16163a; padding:18px; transform: translateX(100%); transition: .25s; overflow:auto; color: var(--hub-text);
}
.filter-drawer.open .filter-panel { transform: translateX(0); }
.filter-panel h3 { margin-top: 0; }
.filter-group { margin-bottom: 14px; }
.filter-group label { display:block; font-size:12px; color:var(--hub-muted); margin-bottom:6px; }
.filter-group input, .filter-group select { width:100%; border:1px solid var(--hub-border); border-radius:10px; padding:9px; background: var(--hub-card); color: var(--hub-text); }

.modal-card {
  background: #16163a; border-radius: 16px; border:1px solid var(--hub-border); padding:16px; width:min(520px,92%); margin:auto; color: var(--hub-text);
}
.modal-head { display:flex; justify-content:space-between; align-items:center; margin-bottom: 8px; }
.modal-head h3 { margin:0; }
.modal-body textarea { width:100%; min-height:130px; border:1px solid var(--hub-border); border-radius:10px; padding:10px; font:inherit; background: var(--hub-card); color: var(--hub-text); }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }

#mediaModal {
  justify-content: center;
  align-items: center;
}

#mediaModal .modal-card {
  width: min(1100px, 94%);
  max-height: 90vh;
  overflow: auto;
}

#mediaModal .modal-body iframe {
  width: 100%;
  min-height: 560px;
  border: 0;
}

.hidden { display: none !important; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.text-right { text-align: right; }

#resourcePagination .btn-soft[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.pdf-modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  z-index: 1100;
}

.pdf-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-modal-content {
  background: #16163a;
  border-radius: 20px;
  width: min(1100px, 92%);
  height: 88%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hub-border);
  box-shadow: var(--hub-shadow);
}

.pdf-modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--hub-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1c1c3c;
  color: var(--hub-text);
}

.pdf-modal-body {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--hub-muted);
  background: linear-gradient(180deg, #181830, #13132a);
}

.pdf-modal-close {
  border: 1px solid var(--hub-border);
  background: var(--hub-card);
  color: var(--hub-text);
  border-radius: 10px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .24s ease; }
@keyframes fade { from { opacity:.4; transform: translateY(6px);} to { opacity:1; transform:none; } }

@media (max-width: 980px) {
  .hub-toolbar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hub-toolbar { grid-template-columns: 1fr; }
}
