/* ========================================================
   DAPPLESOFT NEXUS DESIGN SYSTEM - REUSABLE UI PRIMITIVES
   Consistent Flavor: Buttons, Badges, Switches, Cards & Panes
   ======================================================== */

/* 0. CANONICAL REUSABLE BRAND LOCKUP, EMBLEM & UNIFIED WORDMARK */
.nexus-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.nexus-brand-lockup.layout-stacked {
  flex-direction: column;
  text-align: center;
  gap: 14px;
}
.nexus-brand-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1.5px solid rgba(41, 121, 255, 0.22);
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.nexus-brand-emblem-img {
  object-fit: contain;
  display: block;
}
.nexus-brand-emblem.size-sm {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(41, 121, 255, 0.18);
}
.nexus-brand-emblem.size-sm .nexus-brand-emblem-img {
  width: 28px;
  height: 28px;
}
.nexus-brand-emblem.size-md {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 5px 14px rgba(41, 121, 255, 0.18);
}
.nexus-brand-emblem.size-md .nexus-brand-emblem-img {
  width: 36px;
  height: 36px;
}
.nexus-brand-emblem.size-lg {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  box-shadow: 0 8px 20px -4px rgba(41, 121, 255, 0.22), 0 0 0 4px rgba(0, 229, 255, 0.08);
}
.nexus-brand-emblem.size-lg .nexus-brand-emblem-img {
  width: 50px;
  height: 50px;
}
.nexus-brand-emblem.size-hero {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  box-shadow: 0 12px 26px -6px rgba(41, 121, 255, 0.24), 0 0 0 6px rgba(0, 229, 255, 0.08);
}
.nexus-brand-emblem.size-hero .nexus-brand-emblem-img {
  width: 66px;
  height: 66px;
}
.nexus-brand-wordmark {
  font-family: 'Plus Jakarta Sans', var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  display: inline-block;
  margin: 0;
  background: linear-gradient(90deg, #0284c7 0%, #2563eb 52%, #6d28d9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nexus-brand-wordmark.size-xs   { font-size: 12.5px; }
.nexus-brand-wordmark.size-sm   { font-size: 15.5px; }
.nexus-brand-wordmark.size-md   { font-size: 19px; }
.nexus-brand-wordmark.size-lg   { font-size: 23px; }
.nexus-brand-wordmark.size-hero { font-size: 27px; }

/* Official Brand Tagline — "Everything Connected, One Unified Ecosystem." */
.nexus-brand-text-stack {
  display: inline-flex;
  flex-direction: column;
  min-width: 0;
}
.nexus-brand-text-stack.layout-horizontal {
  align-items: flex-start;
  justify-content: center;
  gap: 1.5px;
}
.nexus-brand-text-stack.layout-stacked {
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nexus-brand-lockup.layout-horizontal.has-tagline .nexus-brand-wordmark.size-sm {
  font-size: 14.5px;
  line-height: 1.08;
}

.nexus-brand-tagline {
  font-family: 'Plus Jakarta Sans', var(--font-sans);
  line-height: 1.25;
}

/* Header Inline Subtitle (Persistent across every workspace page) */
.nexus-brand-tagline.variant-header {
  display: inline-block;
  font-size: 9.75px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #3b5998;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0.92;
}

/* Signature Executive Pill Badge (Login Hero, New Conversation Hero, Feature Banners) */
.nexus-brand-tagline.variant-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.1) 0%, rgba(41, 121, 255, 0.09) 50%, rgba(101, 31, 255, 0.1) 100%);
  border: 1px solid rgba(41, 121, 255, 0.24);
  box-shadow: 0 3px 12px -3px rgba(41, 121, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.015em;
  max-width: 100%;
}
.nexus-brand-tagline.variant-pill.size-hero {
  padding: 6px 15px;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.nexus-brand-tagline.variant-pill.size-lg {
  padding: 5.5px 14px;
  font-size: 12px;
}

/* Flagship About Hero Tagline Display */
.nexus-brand-tagline.variant-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-top: 4px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.11) 0%, rgba(41, 121, 255, 0.1) 50%, rgba(101, 31, 255, 0.11) 100%);
  border: 1px solid rgba(41, 121, 255, 0.26);
  box-shadow: 0 4px 14px -4px rgba(41, 121, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  color: #1e3a8a;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.012em;
}

.nexus-tagline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #00e5ff 0%, #2979ff 52%, #651fff 100%);
  box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.16);
}
.nexus-tagline-dot.size-xs {
  width: 5.5px;
  height: 5.5px;
  box-shadow: 0 0 0 2px rgba(41, 121, 255, 0.14);
}

[data-theme="dark"] .nexus-brand-tagline.variant-header {
  color: #93c5fd;
}
[data-theme="dark"] .nexus-brand-tagline.variant-pill,
[data-theme="dark"] .nexus-brand-tagline.variant-hero {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.14) 0%, rgba(41, 121, 255, 0.15) 50%, rgba(101, 31, 255, 0.16) 100%);
  border-color: rgba(96, 165, 250, 0.32);
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.35);
  color: #dbeafe;
}

/* 1. BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 1px 3px 0 rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.4);
}
.btn-secondary {
  background-color: var(--bg-surface, #ffffff);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-subtle);
}
.btn-danger {
  background-color: rgba(220, 38, 38, 0.1);
  color: var(--accent-danger);
  border-color: rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
  background-color: var(--accent-danger);
  color: #ffffff;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* 2. BADGES & STATUS PILLS */
.ws-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.badge-emerald { background: rgba(5, 150, 105, 0.12); color: #059669; }
.badge-amber { background: rgba(217, 119, 6, 0.14); color: #d97706; }
.badge-red { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.badge-purple { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.badge-slate { background: rgba(100, 116, 139, 0.14); color: #475569; }

[data-theme="dark"] .badge-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
[data-theme="dark"] .badge-emerald { background: rgba(16, 185, 129, 0.2); color: #34d399; }
[data-theme="dark"] .badge-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
[data-theme="dark"] .badge-red { background: rgba(239, 68, 68, 0.2); color: #f87171; }
[data-theme="dark"] .badge-purple { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
[data-theme="dark"] .badge-slate { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  background-color: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.status-pill.online {
  color: var(--accent-success);
  border-color: rgba(5, 150, 105, 0.3);
  background-color: rgba(5, 150, 105, 0.08);
}
.live-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.25);
}
.live-health-pill.offline {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

.pulse-dot {
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background-color: var(--accent-success);
  box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

/* 3. SWITCH TOGGLES */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.25s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
input:checked + .slider {
  background-color: var(--accent-primary);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* 4. WORKSPACE PRIMITIVES & PAGE CONTAINER */
.feature-layout-root {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.feature-workspace-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: var(--bg-primary);
}
.feature-workspace-header {
  height: 56px;
  min-height: 56px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}
.feature-header-title-box {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.feature-header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}
.feature-header-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.25;
}
.feature-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.feature-content-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
}
.feature-page-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* 5. UNIVERSAL TAB BADGE PRIMITIVE */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 17px;
  padding: 0 5px;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 9999px;
  background-color: rgba(100, 116, 139, 0.14);
  color: var(--text-subtle);
  line-height: 1;
  transition: all 0.18s ease;
}
