/* ===========================================================
   gate.css — Demo 模式遮罩 + CTA 浮條 + Admin Switcher
   =========================================================== */

/* ============ DEMO GATING ============ */

/* 任何加上 .demo-gated 的元素 - 模糊 + 不可選 + 鎖頭 */
.mode-demo .demo-gated {
  position: relative;
  pointer-events: none;
  user-select: none;
}
.mode-demo .demo-gated > * {
  filter: blur(6px) grayscale(0.7) brightness(0.7);
  transition: filter 0.3s;
}

/* Lock overlay — 真正顯示給用戶看的層 */
.mode-demo .demo-gated::after {
  content: "🔒 升級 VIP 解鎖";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono, monospace);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--warn, #c49956);
  background:
    linear-gradient(135deg, rgba(196,153,86,0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(196,153,86,0.10) 0%, rgba(10,14,20,0.50) 100%);
  border: 1px dashed var(--warn, #c49956);
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
  letter-spacing: 0.2em;
}
.mode-demo .demo-gated:hover::after {
  background:
    linear-gradient(135deg, rgba(196,153,86,0.14) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(196,153,86,0.16) 0%, rgba(10,14,20,0.55) 100%);
}

/* Premium 模式時完全不顯示 gate */
.mode-premium .demo-gated::after { display: none; }
.mode-premium .demo-gated { pointer-events: auto; user-select: auto; }
.mode-premium .demo-gated > * { filter: none; }

/* Variants - 對不同類型的遮罩 */
.demo-gated.gate-soft > * { filter: blur(3px) brightness(0.8); }
.demo-gated.gate-soft::after { font-size: 12px; }
.demo-gated.gate-hard > * { filter: blur(10px) grayscale(1) brightness(0.5); }

/* 卡片風遮罩 - 顯示完整 lock card 而非單純 blur */
.demo-locked-card {
  position: relative;
  min-height: 200px;
  background: var(--bg-1, #0f1419);
  border: 1px dashed var(--warn, #c49956);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 40px 24px;
}
.demo-locked-card .lock-icon {
  font-size: 28px;
  color: var(--warn, #c49956);
}
.demo-locked-card .lock-title {
  font-family: var(--f-serif, serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg, #e8ebed);
  letter-spacing: 0.04em;
}
.demo-locked-card .lock-sub {
  font-family: var(--f-mono, monospace);
  font-size: 11px;
  color: var(--fg-2, #7a8590);
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.7;
  max-width: 320px;
}
.demo-locked-card .lock-cta {
  margin-top: 8px;
  padding: 8px 20px;
  border: 1px solid var(--warn, #c49956);
  background: rgba(196,153,86,0.08);
  color: var(--warn, #c49956);
  font-family: var(--f-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-decoration: none;
  font-weight: 700;
  transition: all .15s;
}
.demo-locked-card .lock-cta:hover {
  background: rgba(196,153,86,0.18);
  letter-spacing: 0.18em;
}

/* ============ DEMO CTA FLOATING BAR ============ */
#demo-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  background:
    linear-gradient(180deg, rgba(10,14,20,0.96) 0%, rgba(10,14,20,1) 100%);
  border-top: 2px solid var(--warn, #c49956);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
  transition: transform 0.3s ease;
}
#demo-cta.collapsed {
  transform: translateY(calc(100% - 4px));
}
#demo-cta.collapsed::before {
  content: "🔒";
  position: absolute;
  top: -28px;
  right: 24px;
  background: var(--warn, #c49956);
  color: #0a0e14;
  font-size: 14px;
  width: 36px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
}

.dcta-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
}

.dcta-l {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.dcta-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.dcta-text {
  min-width: 0;
}
.dcta-h {
  font-family: var(--f-serif, serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg, #e8ebed);
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}
.dcta-s {
  font-family: var(--f-mono, monospace);
  font-size: 11px;
  color: var(--fg-2, #7a8590);
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dcta-r {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dcta-line, .dcta-tg {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 16px;
  border: 1px solid var(--line-2, #283342);
  background: var(--bg-1, #0f1419);
  color: var(--fg-1, #b8bfc6);
  text-decoration: none;
  font-family: var(--f-mono, monospace);
  font-size: 10px;
  line-height: 1.2;
  transition: all .15s;
  cursor: pointer;
}
.dcta-line:hover, .dcta-tg:hover {
  border-color: var(--warn, #c49956);
  color: var(--warn, #c49956);
}
.dcta-line span, .dcta-tg span {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--fg-3, #4a5560);
  margin-bottom: 2px;
}
.dcta-line b, .dcta-tg b {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg, #e8ebed);
}
.dcta-tg {
  background: linear-gradient(135deg, rgba(196,153,86,0.10) 0%, var(--bg-1, #0f1419) 100%);
  border-color: var(--warn, #c49956);
  color: var(--warn, #c49956);
}
.dcta-tg b { color: var(--warn, #c49956); }
.dcta-tg:hover { background: rgba(196,153,86,0.18); }

.dcta-close {
  background: transparent;
  border: 1px solid var(--line-2, #283342);
  color: var(--fg-3, #4a5560);
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}
.dcta-close:hover {
  color: var(--fg, #e8ebed);
  border-color: var(--fg-2, #7a8590);
}

/* 已登入時 demo cta 消失 */
.mode-premium #demo-cta { display: none; }

@media (max-width: 700px) {
  .dcta-inner { grid-template-columns: 1fr; gap: 10px; padding: 12px 16px; }
  .dcta-r { width: 100%; justify-content: space-between; }
  .dcta-line, .dcta-tg { flex: 1; min-width: 0; padding: 8px 10px; }
  .dcta-line b, .dcta-tg b { font-size: 11px; }
}

/* ============ ADMIN TENANT SWITCHER ============ */
#brand-switcher {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 300;
  background: rgba(10,14,20,0.96);
  border: 1px solid var(--accent, #4a9d6d);
  padding: 14px 16px;
  width: 260px;
  font-family: var(--f-mono, monospace);
  backdrop-filter: blur(8px);
}
#brand-switcher .bs-h {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent, #4a9d6d);
  margin-bottom: 10px;
  font-weight: 700;
}
#brand-switcher .bs-list {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}
#brand-switcher .bs-btn {
  display: grid;
  grid-template-columns: 1fr auto 12px;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  background: var(--bg-1, #0f1419);
  border: 1px solid var(--line, #1a2230);
  color: var(--fg-1, #b8bfc6);
  font-family: var(--f-mono, monospace);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}
#brand-switcher .bs-btn:hover {
  border-color: var(--fg-2, #7a8590);
  color: var(--fg, #e8ebed);
}
#brand-switcher .bs-btn.active {
  background: rgba(74,157,109,0.10);
  border-color: var(--accent, #4a9d6d);
  color: var(--accent, #4a9d6d);
}
#brand-switcher .bs-id {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--fg-3, #4a5560);
  font-weight: 600;
}
#brand-switcher .bs-n {
  font-size: 11px;
  font-weight: 600;
}
#brand-switcher .bs-c {
  font-size: 14px;
}
#brand-switcher .bs-green  { color: #4a9d6d; }
#brand-switcher .bs-blue   { color: #5d8dc4; }
#brand-switcher .bs-orange { color: #ff7e3a; }
#brand-switcher .bs-purple { color: #b08fc9; }
#brand-switcher .bs-red    { color: #c25450; }

#brand-switcher .bs-foot {
  font-size: 9.5px;
  color: var(--fg-3, #4a5560);
  letter-spacing: 0.04em;
  line-height: 1.6;
  padding-top: 8px;
  border-top: 1px dashed var(--line, #1a2230);
}
#brand-switcher .bs-foot b { color: var(--accent, #4a9d6d); }

@media (max-width: 700px) {
  #brand-switcher { width: calc(100% - 24px); right: 12px; top: 72px; }
}
