/* nexusmind-shell.css — khung chung cho trang Việc và trang Brain 3D:
   nền app, header, vùng nội dung. Biến màu lấy từ nexusmind-styles.css. */
/* ── App shell ── */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

.nm-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  /* dvh = chiều cao thực sau khi trừ address bar Chrome mobile (fallback 100vh ở trên) */
  height: 100dvh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

/* Header */
.nm-header {
  display: flex;
  align-items: center;
  gap: 0;
  height: 48px;
  min-height: 48px;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
  padding: 0 16px;
  flex-shrink: 0;
}

.nm-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-right: 20px;
  white-space: nowrap;
}

.nm-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.nm-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  /* Nổi trên .nm-tabs (nav giãn full có thể phủ lên vùng này → chặn click nút 🎁/🪙). */
  position: relative;
  z-index: 12;
}

.nm-live-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Body */
.nm-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Main area */
.nm-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
@media (max-width: 768px), (pointer: coarse) {
  /* Header cao tự động, bám sát chiều cao tab (tránh tab tràn xuống đè nội dung). */
  .nm-header {
    min-height: 48px;
  }

  /* Logo "NexusMind" thừa trên mobile → ẩn, giải phóng ~120px cho nút 🎁/🪙.
     Trước đây header tràn 65px ra ngoài viewport 360 → 2 nút bị đẩy khuất hẳn. */
  .nm-logo {
    display: none;
  }

  /* Header là mốc định vị cho .nm-header-right (pin cố định góc phải). */
  .nm-header {
    position: relative;
  }

  /* Nút 🎁/🪙: PIN tuyệt đối góc phải header → không bao giờ bị flex đẩy ra ngoài viewport. */
  .nm-header-right {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    margin-left: 0;
    flex-shrink: 0;
    gap: 2px;
    z-index: 30;
    background: var(--bg, #0a0e1a);
    padding-left: 4px;
  }

  .nm-reward-box-btn {
    font-size: 1.25rem;
    padding: 4px 4px;
    min-height: 38px;
    display: flex;
    align-items: center;
  }

  /* ── Tab "Bản đồ" mobile: xếp dọc (main trên, sidebar dưới), graph vừa màn ── */
  .nm-body {
    flex-direction: column;
    overflow-y: auto;
  }

  .nm-main {
    overflow: visible;
  }

  /* Sidebar (Streak/Novelty) → full-width xuống dưới, không chiếm cạnh */
  .nm-sidebar {
    width: auto;
    min-width: 0;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 12px;
  }

  .nm-sidebar.collapsed {
    width: auto;
    min-width: 0;
  }

  /* Nút thu gọn sidebar dọc bên trái không hợp lý trên mobile → ẩn */
  .nm-sidebar-toggle {
    display: none;
  }

  /* Bản đồ sao: cao vừa phải trên mobile, không quá chật */
  .nm-constellation-wrap {
    min-height: 52vh;
  }
}

/* Liên kết sang trang khác trên thanh đầu (Brain 3D, OpenDesign, quay về Việc) */
.nm-navlink {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 11px;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.12s;
}

.nm-navlink:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}
