/* ===== Showcase grid, module explorer, client preview ===== */

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

/* ---------- Module explorer ---------- */
.explorer {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(24, 33, 48, 0.72), rgba(11, 15, 22, 0.86));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  backdrop-filter: var(--blur);
}

.explorer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 20, 0.6);
}

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }

.tab {
  padding: 9px 16px;
  border-radius: 100px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-mute);
  font: 600 0.88rem/1 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.tab:hover { color: var(--text); background: rgba(140, 175, 220, 0.08); }
.tab.active {
  color: #06121f;
  background: var(--grad-ice);
  border-color: transparent;
  box-shadow: 0 8px 24px -12px rgba(47, 139, 255, 0.8);
}

.explorer-search {
  margin-left: auto;
  position: relative;
  min-width: 220px;
}
.explorer-search .input { padding-left: 40px; }
.explorer-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-mute);
  pointer-events: none;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 22px;
  max-height: 620px;
  overflow-y: auto;
}

.module {
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(13, 18, 27, 0.72);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s;
  animation: rise 0.45s var(--ease) both;
}
.module:hover {
  transform: translateY(-4px);
  border-color: rgba(87, 166, 255, 0.45);
  background: rgba(18, 26, 38, 0.9);
}

.module-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.module-name {
  font: 600 1rem/1.2 'Sora', sans-serif;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.module-name::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--ice-400);
  box-shadow: 0 0 10px var(--ice-400);
  transform: rotate(45deg);
}
.module p { font-size: 0.88rem; margin: 0 0 12px; color: var(--text-mute); line-height: 1.55; }
.module-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.module-toggle {
  width: 34px;
  height: 19px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: rgba(140, 175, 220, 0.12);
  position: relative;
  flex: 0 0 auto;
  transition: background 0.3s var(--ease), border-color 0.3s;
}
.module-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #8b98ab;
  transition: transform 0.3s var(--ease), background 0.3s;
}
.module:hover .module-toggle { background: rgba(47, 139, 255, 0.4); border-color: rgba(87, 166, 255, 0.6); }
.module:hover .module-toggle::after { transform: translateX(15px); background: #fff; }

.explorer-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: rgba(9, 13, 20, 0.6);
  font-size: 0.86rem;
  color: var(--text-mute);
}

/* ---------- In-client preview (pure CSS 3D) ---------- */
.preview-3d {
  perspective: 1600px;
  display: grid;
  place-items: center;
  padding: 20px 0;
}

.client-window {
  width: min(940px, 100%);
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(170deg, #101724, #0a0e15);
  box-shadow: 0 60px 120px -50px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(87, 166, 255, 0.12);
  transform: rotateX(14deg) rotateZ(-1deg) scale(0.98);
  transition: transform 0.9s var(--ease);
  overflow: hidden;
  will-change: transform;
}
.preview-3d:hover .client-window { transform: rotateX(4deg) rotateZ(0deg) scale(1); }

.cw-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: rgba(9, 13, 20, 0.9);
  border-bottom: 1px solid var(--line);
  font: 500 0.8rem/1 'Inter', sans-serif;
  color: var(--text-mute);
}
.cw-dots { display: flex; gap: 6px; margin-right: 6px; }
.cw-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a3546; }
.cw-body { display: grid; grid-template-columns: 190px 1fr; min-height: 330px; }

.cw-side { border-right: 1px solid var(--line); padding: 14px; display: grid; gap: 6px; align-content: start; }
.cw-side b {
  font: 600 0.68rem/1 'Inter', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 6px 8px 10px;
}
.cw-cat {
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 0.85rem;
  color: var(--text-soft);
  border: 1px solid transparent;
}
.cw-cat.on {
  color: #fff;
  background: linear-gradient(100deg, rgba(47, 139, 255, 0.22), rgba(47, 139, 255, 0.04));
  border-color: rgba(87, 166, 255, 0.3);
}

.cw-main { padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; }
.cw-mod {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(16, 22, 33, 0.8);
  font-size: 0.85rem;
  color: var(--text-soft);
}
.cw-mod.on { color: #fff; border-color: rgba(87, 166, 255, 0.45); background: rgba(47, 139, 255, 0.12); }
.cw-mod i {
  width: 26px; height: 14px; border-radius: 100px; background: rgba(140, 175, 220, 0.16); position: relative;
}
.cw-mod i::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #8b98ab;
}
.cw-mod.on i { background: var(--grad-ice); }
.cw-mod.on i::after { left: auto; right: 2px; background: #061020; }

@media (max-width: 640px) {
  .cw-body { grid-template-columns: 1fr; }
  .cw-side { display: none; }
  .module-grid { max-height: none; }
}
