/* ══════════════════════════════════════════════════════════════════════
   UNIVERSAL FEATURE HUB MODAL (T2T Scalper Workstation Center Modal)
   Spacious Centered Pop-up (94vw / 90vh) - Zero Icons Minimalist Terminal
   ══════════════════════════════════════════════════════════════════════ */

.universal-hub-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10006;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.universal-hub-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.universal-hub-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.985);
  width: 94vw;
  max-width: 1540px;
  height: 90vh;
  max-height: 94vh;
  background: #0b0f17;
  border: 1px solid #2a3749;
  border-radius: 8px;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 10007;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  color: #f1f5f9;
  user-select: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.universal-hub-card.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* ── Top Header Bar ─────────────────────────────────────────────── */
.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: #111827;
  border-bottom: 1px solid #1f2937;
  flex-shrink: 0;
}

.hub-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.hub-ticker-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  background: #0284c7;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 4px;
}

.hub-ticker-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-ticker-name {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.hub-ticker-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hub-price {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}

.hub-price.up, .hub-change.up { color: #22c55e; }
.hub-price.down, .hub-change.down { color: #ef4444; }
.hub-price.neutral, .hub-change.neutral { color: #eab308; }

.hub-change {
  font-size: 11px;
  font-weight: 700;
}

.hub-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  font-size: 10px;
  color: #94a3b8;
}

.hub-stat-pill strong, .hub-stat-pill b {
  color: #f1f5f9;
  font-weight: 700;
}

.hub-stat-pill .c-ara { color: #a855f7; font-weight: 800; }
.hub-stat-pill .c-arb { color: #06b6d4; font-weight: 800; }

/* Mid: Quick Stock Ticker Search Switcher */
.hub-header-mid {
  flex: 1;
  max-width: 440px;
  display: flex;
  justify-content: center;
}

.hub-search-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.hub-search-input {
  width: 100%;
  padding: 6px 12px;
  background: #0b0f17;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #38bdf8;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-search-input::placeholder {
  color: #64748b;
  font-weight: 500;
  text-transform: none;
}

.hub-search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.hub-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-close-btn {
  padding: 5px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
}

.hub-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

/* ── Tab Navigation Strip (Clean Typography, ZERO ICONS) ──────────── */
.hub-tabs-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  scrollbar-width: none;
}

.hub-tabs-nav::-webkit-scrollbar {
  display: none;
}

.hub-tab-item {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #94a3b8;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.hub-tab-item:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.hub-tab-item.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: inset 0 1px 0 rgba(56, 189, 248, 0.2);
}

/* ── Viewport Body Container ─────────────────────────────────────── */
.hub-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  background: #0b0f17;
}

.hub-pane {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  flex-direction: column;
}

.hub-pane.active {
  display: flex;
}

/* ── Seamless Embedded Drawer Adaptations ────────────────────────── */
.in-hub-modal {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  transform: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 1 !important;
}

.hub-header,
.hub-tabs-nav {
  display: none !important;
}

/* Hide duplicate individual drawer close buttons inside the workstation modal (except broksum drawer-close-btn) */
.in-hub-modal .settings-close-btn,
.in-hub-modal .watchlist-close-btn,
.in-hub-modal .signals-close-btn,
.in-hub-modal .movers-close-btn,
.in-hub-modal .news-close-btn,
.in-hub-modal .chart-drawer-close-float,
.in-hub-modal .aichat-close-btn,
.in-hub-modal .brokeract-close-btn,
.in-hub-modal .rec-close-btn,
.in-hub-modal .disclosure-close-btn,
.in-hub-modal .insider-close-btn {
  display: none !important;
}

.in-hub-modal .drawer-close-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Hide redundant duplicate backdrops ONLY when hub modal is actively open */
body.hub-modal-open .broksum-drawer-backdrop,
body.hub-modal-open .chart-drawer-backdrop {
  display: none !important;
}

/* Specific wide viewport adaptations for Broksum / Stock Activity */
.in-hub-modal.broksum-drawer .broksum-content,
.in-hub-modal.broksum-drawer .broksum-body {
  padding: 14px;
  overflow-y: auto;
}

.hub-chart-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #0b0f17;
}

/* Mode Chart: Completely delete / hide outer header and tab bar */
.universal-hub-card.is-chart-mode .hub-header,
.universal-hub-card.is-chart-mode .hub-tabs-nav {
  display: none !important;
}

.universal-hub-card.is-chart-mode {
  background: #080c14;
  border: 1px solid #1e293b;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.98);
}

.universal-hub-card.is-chart-mode .hub-viewport,
.universal-hub-card.is-chart-mode .hub-pane {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

.hub-chart-floating-close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 99999;
  width: 32px;
  height: 32px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #cbd5e1;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  backdrop-filter: blur(6px);
}

.hub-chart-floating-close:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

/* ── Light Theme Adaptations ─────────────────────────────────────── */
body.theme-light .universal-hub-card {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.25);
}

body.theme-light .hub-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

body.theme-light .hub-price {
  color: #0f172a;
}

body.theme-light .hub-stat-pill {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

body.theme-light .hub-stat-pill strong,
body.theme-light .hub-stat-pill b {
  color: #0f172a;
}

body.theme-light .hub-search-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0284c7;
}

body.theme-light .hub-tabs-nav {
  background: #f1f5f9;
  border-bottom-color: #e2e8f0;
}

body.theme-light .hub-tab-item {
  color: #475569;
}

body.theme-light .hub-tab-item:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.04);
}

body.theme-light .hub-tab-item.active {
  color: #0284c7;
  background: #e0f2fe;
  border-color: #bae6fd;
}

body.theme-light .hub-close-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

/* ── Mobile Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .universal-hub-card {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .hub-header {
    flex-wrap: wrap;
    padding: 8px 10px;
  }
  .hub-header-mid {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .hub-tabs-nav {
    padding: 4px 8px;
    gap: 2px;
  }
  .hub-tab-item {
    padding: 5px 8px;
    font-size: 10px;
  }
}
